aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-11-22 11:01:55 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-11-22 11:01:55 -0500
commitc1a3a4b90a5a47adcca0e587f5d7e9ea61329b26 (patch)
treec756520ea4e1eaa007bba3c32c9eab154d13a1a6 /tools
parentde31ec8a31046111befd16a7083e3bdda2ff42cf (diff)
perf record: Handle restrictive permissions in /proc/{kallsyms,modules}
The 59365d1 commit, even being reverted by 33e0d57, showed a non robust behavior in 'perf record': it really should just warn the user that some functionality will not be available. The new behavior then becomes: [acme@felicio linux]$ ls -la /proc/{kallsyms,modules} -r-------- 1 root root 0 Nov 22 12:19 /proc/kallsyms -r-------- 1 root root 0 Nov 22 12:19 /proc/modules [acme@felicio linux]$ perf record ls -R > /dev/null Couldn't record kernel reference relocation symbol Symbol resolution may be skewed if relocation was used (e.g. kexec). Check /proc/kallsyms permission or run as root. [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.004 MB perf.data (~161 samples) ] [acme@felicio linux]$ perf report --stdio [kernel.kallsyms] with build id 77b05e00e64e4de1c9347d83879779b540d69f00 not found, continuing without symbols # Events: 98 cycles # # Overhead Command Shared Object Symbol # ........ ....... ............... .................... # 48.26% ls [kernel] [k] ffffffff8102b92b 22.49% ls libc-2.12.90.so [.] __strlen_sse2 8.35% ls libc-2.12.90.so [.] __GI___strcoll_l 8.17% ls ls [.] 11580 3.35% ls libc-2.12.90.so [.] _IO_new_file_xsputn 3.33% ls libc-2.12.90.so [.] _int_malloc 1.88% ls libc-2.12.90.so [.] _int_free 0.84% ls libc-2.12.90.so [.] malloc_consolidate 0.84% ls libc-2.12.90.so [.] __readdir64 0.83% ls ls [.] strlen@plt 0.83% ls libc-2.12.90.so [.] __GI_fwrite_unlocked 0.83% ls libc-2.12.90.so [.] __memcpy_sse2 # # (For a higher level overview, try: perf report --sort comm,dso) # [acme@felicio linux]$ It still has the build-ids for DSOs in the maps with hits: [acme@felicio linux]$ perf buildid-list 77b05e00e64e4de1c9347d83879779b540d69f00 [kernel.kallsyms] 09c4a431a4a8b648fcfc2c2bdda70f56050ddff1 /bin/ls af75ea9ad951d25e0f038901a11b3846dccb29a4 /lib64/libc-2.12.90.so [acme@felicio linux]$ That can be used in another machine to resolve kernel symbols. Cc: Eugene Teo <eugeneteo@kernel.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jesper Juhl <jj@chaosbits.net> Cc: Marcus Meissner <meissner@suse.de> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Stephane Eranian <eranian@google.com> Cc: Tejun Heo <tj@kernel.org> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-record.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 93bd2ff001fb..e2c2de201eec 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -697,17 +697,18 @@ static int __cmd_record(int argc, const char **argv)
697 if (err < 0) 697 if (err < 0)
698 err = event__synthesize_kernel_mmap(process_synthesized_event, 698 err = event__synthesize_kernel_mmap(process_synthesized_event,
699 session, machine, "_stext"); 699 session, machine, "_stext");
700 if (err < 0) { 700 if (err < 0)
701 pr_err("Couldn't record kernel reference relocation symbol.\n"); 701 pr_err("Couldn't record kernel reference relocation symbol\n"
702 return err; 702 "Symbol resolution may be skewed if relocation was used (e.g. kexec).\n"
703 } 703 "Check /proc/kallsyms permission or run as root.\n");
704 704
705 err = event__synthesize_modules(process_synthesized_event, 705 err = event__synthesize_modules(process_synthesized_event,
706 session, machine); 706 session, machine);
707 if (err < 0) { 707 if (err < 0)
708 pr_err("Couldn't record kernel reference relocation symbol.\n"); 708 pr_err("Couldn't record kernel module information.\n"
709 return err; 709 "Symbol resolution may be skewed if relocation was used (e.g. kexec).\n"
710 } 710 "Check /proc/modules permission or run as root.\n");
711
711 if (perf_guest) 712 if (perf_guest)
712 perf_session__process_machines(session, event__synthesize_guest_os); 713 perf_session__process_machines(session, event__synthesize_guest_os);
713 714