aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-10-05 14:26:18 -0300
committerIngo Molnar <mingo@elte.hu>2009-10-05 20:35:23 +0200
commita2a99e8e12798706ec1026e5d8fc36f7c86122ce (patch)
treee5f3f236ad600b5221d1ecd9217ca6fdbd2f7b58 /tools/perf/util/symbol.c
parentperf tools: Create maps for modules when processing kallsyms (diff)
downloadlinux-dev-a2a99e8e12798706ec1026e5d8fc36f7c86122ce.tar.xz
linux-dev-a2a99e8e12798706ec1026e5d8fc36f7c86122ce.zip
perf tools: /proc/modules names don't always match its name
$ cut -d' ' -f1 /proc/modules|grep _|wc -l 29 $ cut -d' ' -f1 /proc/modules|grep _|sed 's/$/.ko'/g|while read n;do find /lib/modules/`uname -r` -name $n;done|wc -l 12 For instance: $ grep ^aes_x86 /proc/modules aes_x86_64 9056 2 - Live 0xffffffffa0091000 $ l /lib/modules/2.6.31-tip/kernel/arch/x86/crypto/aes-x86_64.ko -rw-r--r-- 1 root root 136438 2009-09-22 19:05 /lib/modules/2.6.31-tip/kernel/arch/x86/crypto/aes-x86_64.ko Handle that by introducing a strxfrchar routine that replaces dashes with underscores when matching file names to loaded modules. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mike Galbraith <efault@gmx.de> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 4dfdefd5ec7e..e3eebdd682d9 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -189,7 +189,7 @@ struct symbol *dso__find_symbol(struct dso *self, u64 ip)
size_t dso__fprintf(struct dso *self, FILE *fp)
{
- size_t ret = fprintf(fp, "dso: %s\n", self->long_name);
+ size_t ret = fprintf(fp, "dso: %s\n", self->short_name);
struct rb_node *nd;
for (nd = rb_first(&self->syms); nd; nd = rb_next(nd)) {
@@ -977,6 +977,7 @@ static int dsos__load_modules_sym_dir(char *dirname,
snprintf(dso_name, sizeof(dso_name), "[%.*s]",
(int)(dot - dent->d_name), dent->d_name);
+ strxfrchar(dso_name, '-', '_');
map = kernel_maps__find_by_dso_name(dso_name);
if (map == NULL)
continue;