linux/tools/perf/util
Arnaldo Carvalho de Melo 30d7a77dd5 perf_counter tools: Adjust symbols in ET_EXEC files too
Ingo Molnar wrote:

> i just bisected a 'perf report' bug that would cause us to not
> resolve all user-space symbols in a 'git gc' run to:
>
> f5812a7a33 is first bad commit
> commit f5812a7a33
> Author: Arnaldo Carvalho de Melo <acme@redhat.com>
> Date:   Tue Jun 30 11:43:17 2009 -0300
>
>     perf_counter tools: Adjust only prelinked symbol's addresses

Rename ->prelinked to ->adjust_symbols and making what was done
only for prelinked libraries also to ET_EXEC binaries, such as
/usr/bin/git:

[acme@doppio pahole]$ readelf -h /usr/bin/git | grep Type
  Type:                              EXEC (Executable file)
[acme@doppio pahole]$

And after installing the 'git-debuginfo' package, I get correct results:

[acme@doppio linux-2.6-tip]$ perf report --sort comm,dso,symbol -d /usr/bin/git | head -20

 #
 # (1139614 samples)
 #
 # Overhead           Command  Shared Object              Symbol
 # ........  ................  .........................  ......
 #
    34.98%               git  /usr/bin/git               [.] send_sideband
    33.39%               git  /usr/bin/git               [.] enter_repo
     6.81%               git  /usr/bin/git               [.] diff_opt_parse
     4.95%               git  /usr/bin/git               [.] is_repository_shallow
     3.24%               git  /usr/bin/git               [.] odb_mkstemp
     1.39%               git  /usr/bin/git               [.] output
     1.34%               git  /usr/bin/git               [.] xmmap
     1.25%               git  /usr/bin/git               [.] receive_pack_config
     1.16%               git  /usr/bin/git               [.] git_pathdup
     0.90%               git  /usr/bin/git               [.] read_object_with_reference
     0.86%               git  /usr/bin/git               [.] show_patch_diff
     0.85%               git  /usr/bin/git               0x00000000095e2e
     0.69%               git  /usr/bin/git               [.] display
[acme@doppio linux-2.6-tip]$

I'll check what are the last cases where we can't resolve symbols, like
this 0x00000000095e2e later.

And I guess this will fix the problems Mike were seeing too:

 [acme@doppio linux-2.6-tip]$ readelf -h ../build/perf/vmlinux | grep Type
   Type:                              EXEC (Executable file)
 [acme@doppio linux-2.6-tip]$

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-07-03 08:24:13 +02:00
..
include perf_counter tools: Share list.h with the kernel 2009-07-01 22:37:23 +02:00
abspath.c perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
alias.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
cache.h perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
callchain.c perf_counter tools: Set the minimum percent for callchains to be displayed 2009-07-02 21:38:37 +02:00
callchain.h perf_counter tools: Set the minimum percent for callchains to be displayed 2009-07-02 21:38:37 +02:00
color.c perf_counter tools: Provide helper to print percents color 2009-07-02 21:38:37 +02:00
color.h perf_counter tools: Provide helper to print percents color 2009-07-02 21:38:37 +02:00
config.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
ctype.c perf_counter tools: Add and use isprint() 2009-06-18 09:46:00 +02:00
environment.c perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
exec_cmd.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
exec_cmd.h perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
generate-cmdlist.sh perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
header.c perf_counter tools: Rework the file format 2009-06-25 21:39:04 +02:00
header.h perf_counter tools: Rework the file format 2009-06-25 21:39:04 +02:00
help.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
help.h perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
levenshtein.c perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
levenshtein.h perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
module.c perf_counter tools: Add infrastructure to support loading of kernel module symbols 2009-07-02 08:42:20 +02:00
module.h perf_counter tools: Add infrastructure to support loading of kernel module symbols 2009-07-02 08:42:20 +02:00
pager.c perf_counter tools: Remove dead code 2009-06-27 06:06:39 +02:00
parse-events.c perf list: Add cache events 2009-07-01 15:25:03 +02:00
parse-events.h perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
parse-options.c perf_counter tools: Add new OPT_CALLBACK_DEFAULT option 2009-07-02 20:47:14 +02:00
parse-options.h perf_counter tools: Add new OPT_CALLBACK_DEFAULT option 2009-07-02 20:47:14 +02:00
path.c perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
PERF-VERSION-GEN perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
quote.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
quote.h perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
run-command.c perf_counter tools: Remove dead code 2009-06-27 06:06:39 +02:00
run-command.h perf_counter tools: Remove dead code 2009-06-27 06:06:39 +02:00
sigchain.c perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
sigchain.h perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
strbuf.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
strbuf.h perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
string.c perf_counter tools: Define and use our own u64, s64 etc. definitions 2009-06-19 18:25:47 +02:00
string.h perf_counter tools: Rework the file format 2009-06-25 21:39:04 +02:00
strlist.c perf report: Add --dsos parameter 2009-07-01 00:07:09 +02:00
strlist.h perf_counter tools: Share rbtree.with the kernel 2009-07-01 22:37:22 +02:00
symbol.c perf_counter tools: Adjust symbols in ET_EXEC files too 2009-07-03 08:24:13 +02:00
symbol.h perf_counter tools: Adjust symbols in ET_EXEC files too 2009-07-03 08:24:13 +02:00
types.h perf_counter tools: Rework the file format 2009-06-25 21:39:04 +02:00
usage.c perf top: Fall back to cpu-clock-tick hrtimer sampling if no cycle counter available 2009-06-07 17:31:52 +02:00
util.h perf_counter tools: Remove dead code 2009-06-27 06:06:39 +02:00
wrapper.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00