aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-01-14 15:30:05 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-16 04:58:46 -0500
commit8d0591f6ad9edf66697ce29de176fb6f3213b9e3 (patch)
treeb68a8a05b8f1122dc881efe768a7f16d849f5e1e /tools/perf/util
parent1b75962e92d48a41019d4b440e221638aa2a7238 (diff)
perf symbols: Don't try to load kallsyms if doesn't match the record build-id
Now a perf.data file collected on a x86_64 fedora 12 machine gets properly parsed on a Debian testing PARISC64 machine with 32-bit userland: acme@parisc:~/git/linux-2.6-tip$ perf report 2> /dev/null | head -15 # Samples: 293085637 # # Overhead Command Shared Object Symbol # ........ ............... ................................. ...... # 35.11% find [kernel.kallsyms] [k] 0xffffffff81002b5a 18.25% perf [kernel.kallsyms] [k] 0xffffffff8102235f 9.07% find find [.] 0x0000000000fb0e 5.80% swapper [kernel.kallsyms] [k] 0xffffffff8102235f 3.29% perf libc-2.10.2.so [.] __GI_strcmp 2.70% find libc-2.10.2.so [.] __GI_memmove 2.33% init [kernel.kallsyms] [k] 0xffffffff810091b9 2.03% find libc-2.10.2.so [.] _int_malloc 1.67% find libc-2.10.2.so [.] _IO_vfprintf_internal 1.65% sshd libcrypto.so.0.9.8k [.] 0x00000000105440 acme@parisc:~/git/linux-2.6-tip$ Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1263501006-14185-2-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/symbol.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 381999dd5c1f..71d23e1e30e8 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1608,11 +1608,11 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
1608 u8 kallsyms_build_id[BUILD_ID_SIZE]; 1608 u8 kallsyms_build_id[BUILD_ID_SIZE];
1609 1609
1610 if (sysfs__read_build_id("/sys/kernel/notes", kallsyms_build_id, 1610 if (sysfs__read_build_id("/sys/kernel/notes", kallsyms_build_id,
1611 sizeof(kallsyms_build_id)) == 0) 1611 sizeof(kallsyms_build_id)) == 0) {
1612 1612 is_kallsyms = dso__build_id_equal(self, kallsyms_build_id);
1613 is_kallsyms = dso__build_id_equal(self, kallsyms_build_id); 1613 if (is_kallsyms)
1614 if (is_kallsyms) 1614 goto do_kallsyms;
1615 goto do_kallsyms; 1615 }
1616 goto do_vmlinux; 1616 goto do_vmlinux;
1617 } 1617 }
1618 1618
@@ -1623,6 +1623,9 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
1623do_vmlinux: 1623do_vmlinux:
1624 err = dso__load_vmlinux(self, map, session, self->long_name, filter); 1624 err = dso__load_vmlinux(self, map, session, self->long_name, filter);
1625 if (err <= 0) { 1625 if (err <= 0) {
1626 if (self->has_build_id)
1627 return -1;
1628
1626 pr_info("The file %s cannot be used, " 1629 pr_info("The file %s cannot be used, "
1627 "trying to use /proc/kallsyms...", self->long_name); 1630 "trying to use /proc/kallsyms...", self->long_name);
1628do_kallsyms: 1631do_kallsyms: