Skip to content

Commit

Permalink
perf tools: Improve message about missing symtabs for deleted DSOs
Browse files Browse the repository at this point in the history
Instead of:

  no symbols found in /usr/lib/gstreamer-0.10/libgsttypefindfunctions.so (deleted), maybe install a debug package?
  no symbols found in /usr/lib/gstreamer-0.10/libgstaudioconvert.so (deleted), maybe install a debug package?

We now emit:

  /usr/lib/gstreamer-0.10/libgsttypefindfunctions.so was updated, restart the long running apps that use it!
  /usr/lib/gstreamer-0.10/libgstaudioconvert.so was updated, restart the long running apps that use it!

Which is far less misleading about what the cause of the
symbol mismatch is.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1256927305-4628-3-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Nov 2, 2009
1 parent 00a192b commit d70a540
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen)
return NULL;
}

#define DSO__DELETED "(deleted)"

struct symbol *
map__find_symbol(struct map *self, u64 ip, symbol_filter_t filter)
{
Expand All @@ -86,8 +88,18 @@ map__find_symbol(struct map *self, u64 ip, symbol_filter_t filter)
self->dso->long_name);
return NULL;
} else if (nr == 0) {
pr_warning("No symbols found in %s, maybe install a debug package?\n",
self->dso->long_name);
const char *name = self->dso->long_name;
const size_t len = strlen(name);
const size_t real_len = len - sizeof(DSO__DELETED);

if (len > sizeof(DSO__DELETED) &&
strcmp(name + real_len + 1, DSO__DELETED) == 0)
pr_warning("%.*s was updated, restart the "
"long running apps that use it!\n",
real_len, name);
else
pr_warning("no symbols found in %s, maybe "
"install a debug package?\n", name);
return NULL;
}
}
Expand Down

0 comments on commit d70a540

Please sign in to comment.