linux-stable/tools/perf
Arnaldo Carvalho de Melo c1a3a4b90a 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>
2010-11-22 14:01:55 -02:00
..
arch Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-08-06 09:30:52 -07:00
bench perf options: Check v type in OPT_U?INTEGER 2010-05-17 15:43:38 -03:00
Documentation perf trace: update Documentation with new perf trace variants 2010-11-10 08:19:35 -06:00
scripts perf trace scripting: remove system-wide param from shell scripts 2010-11-10 08:08:20 -06:00
util perf, ui: Eliminate stack-smashing protection compiler complaint 2010-11-10 09:04:32 +01:00
.gitignore perf tools: .gitignore += config.make config.make.autogen 2010-06-17 10:24:31 -03:00
builtin-annotate.c perf tools: Add --tui and --stdio to choose the UI 2010-08-21 10:49:46 -03:00
builtin-bench.c perf options: Type check all the remaining OPT_ variants 2010-05-17 16:22:41 -03:00
builtin-buildid-cache.c perf buildid: add perfconfig option to specify buildid cache dir 2010-06-05 09:34:04 -03:00
builtin-buildid-list.c perf tools: Remove unneeded code for tracking the cwd in perf sessions 2010-07-27 11:46:12 -03:00
builtin-diff.c perf tools: Remove unneeded code for tracking the cwd in perf sessions 2010-07-27 11:46:12 -03:00
builtin-help.c perf options: Type check all the remaining OPT_ variants 2010-05-17 16:22:41 -03:00
builtin-inject.c perf inject: Add missing bits 2010-05-04 10:48:22 -03:00
builtin-kmem.c perf: add perf-inject builtin 2010-05-02 13:36:56 -03:00
builtin-kvm.c perf options: Type check all the remaining OPT_ variants 2010-05-17 16:22:41 -03:00
builtin-list.c
builtin-lock.c perf options: Type check OPT_BOOLEAN and fix the offenders 2010-05-17 16:22:37 -03:00
builtin-probe.c perf probe: Add basic module support 2010-10-21 16:11:44 -02:00
builtin-record.c perf record: Handle restrictive permissions in /proc/{kallsyms,modules} 2010-11-22 14:01:55 -02:00
builtin-report.c perf: Rename append_callchain into callchain_append 2010-08-22 20:43:51 +02:00
builtin-sched.c perf: Use event__process_task from perf sched 2010-06-01 00:10:32 +02:00
builtin-stat.c perf tools: Add the ability to specify list of cpus to monitor 2010-06-05 09:33:01 -03:00
builtin-test.c perf options: Type check OPT_BOOLEAN and fix the offenders 2010-05-17 16:22:37 -03:00
builtin-timechart.c perf timechart: Adjust confusing if indentation 2010-08-05 19:38:02 -03:00
builtin-top.c perf: Fix usages of profile_cpu in builtin-top.c to use cpu_list 2010-11-10 09:16:12 +01:00
builtin-trace.c perf trace: update usage 2010-11-10 08:20:45 -06:00
builtin.h perf: add perf-inject builtin 2010-05-02 13:36:56 -03:00
command-list.txt perf inject: Add missing bits 2010-05-04 10:48:22 -03:00
CREDITS
design.txt perf: Fix few typos + cosmetics 2010-01-13 17:39:44 +01:00
feature-tests.mak Merge branch 'linus' into perf/core 2010-08-25 13:10:00 +02:00
Makefile Merge branch 'perf/urgent' into perf/core 2010-10-05 09:47:14 +02:00
MANIFEST perf tools: Make target to generate self contained source tarball 2010-06-05 09:33:35 -03:00
perf-archive.sh perf buildid: add perfconfig option to specify buildid cache dir 2010-06-05 09:34:04 -03:00
perf.c perf buildid: add perfconfig option to specify buildid cache dir 2010-06-05 09:34:04 -03:00
perf.h perf, MIPS: Support cross compiling of tools/perf for MIPS 2010-10-12 13:34:37 +02:00