1. 30 Nov, 2010 2 commits
    • Ming Lei's avatar
      perf symbols: Figure out start address of kernel map from kallsyms · d214afbd
      Ming Lei authored
      On ARM, module symbol start address is ahead of kernel symbol start address, so
      we can't suppose that the start address of kernel map always is zero, otherwise
      may cause incorrect .start and .end of kernel map (caused by fixup) when there
      are modules loaded, then map_groups__find may return incorrect map for symbol
      query.
      
      This patch always figures out the start address of kernel map from
      /proc/kallsyms if the file is available, so fix the issues on ARM for module
      loaded case.
      
      This patch fixes the following issues on ARM when modules are loaded:
      
      	- vmlinux symbol can't be found by kallsyms maps doing 'perf test'
      	- module symbols are parsed mistakenlly when doing 'perf top'/'perf report'
      
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20101125192725.62d31b42@tom-lei>
      Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d214afbd
    • Arnaldo Carvalho de Melo's avatar
      perf symbols: Fix kallsyms kernel/module map splitting · 8a953312
      Arnaldo Carvalho de Melo authored
      On ARM, module addresss space is ahead of kernel space, so the module
      symbols are handled before kernel symbol in dso__split_kallsyms, then
      was causing one map to be created for each kernel symbol.
      Reported-by: default avatarMing Lei <tom.leiming@gmail.com>
      Tested-by: default avatarMing Lei <tom.leiming@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20101124144540.GB15875@ghostprotocols.net>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8a953312
  2. 26 Nov, 2010 4 commits
  3. 23 Nov, 2010 1 commit
    • Rabin Vincent's avatar
      perf symbols: Remove incorrect open-coded container_of() · 02a9d037
      Rabin Vincent authored
      At least on ARM, padding is inserted between rb_node and sym in struct
      symbol_name_rb_node, causing "((void *)sym) - sizeof(struct rb_node)" to
      point inside rb_node rather than to the symbol_name_rb_node.  Fix this
      by converting the code to use container_of().
      
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20101123163106.GA25677@debian>
      Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      02a9d037
  4. 22 Nov, 2010 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf record: Handle restrictive permissions in /proc/{kallsyms,modules} · c1a3a4b9
      Arnaldo Carvalho de Melo authored
      The 59365d13 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c1a3a4b9
  5. 18 Nov, 2010 6 commits
  6. 16 Nov, 2010 1 commit
  7. 15 Nov, 2010 25 commits