diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-06-01 11:37:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-06-01 15:16:11 -0400 |
commit | b5c874f14c5f57cc8654e9184694196c466147bb (patch) | |
tree | 91d1a814fb1bf3ccaf68140b45dd18ba4ed5e146 /tools | |
parent | c02514850d67be8db6b2b6658cbc23ac1fbf8bc7 (diff) |
perf buildid-list: Fix --with-hits event processing
When we use plain 'perf buildid-list' we use only what is in the buildid
table in the perf.data header. And those have absolute pathnames because
at 'perf record' time we used __perf_session__process_events and that
doesn't sets up the path shortening code in map__new() that happens if
symbol_conf.full_paths is false, the default.
On the other hand, when we use 'perf buildid-list --with-hits' we
process all the events using perf_session__process_events, adding
entries to the global DSO list _after_ removing the current directory
from the DSO name, for presentation purposes.
Because of that we end up having two entries in the DSO list when
recording events for binaries using relative pathnames.
Fix it minimally by setting symbol_conf.full_paths to true when marking
the DSOs with hits in 'perf buildid-list --with-hits', as used by 'perf
archive'
Right fix longer term is to shorten the path only at presentation time.
Will be done for 2.6.36.
Reported-by: Stephane Eranian <eranian@google.com>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
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: <20100601183837.GC4093@ghostprotocols.net>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-buildid-list.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c index 44a47e13bd67..99890728409e 100644 --- a/tools/perf/builtin-buildid-list.c +++ b/tools/perf/builtin-buildid-list.c | |||
@@ -43,8 +43,10 @@ static int __cmd_buildid_list(void) | |||
43 | if (session == NULL) | 43 | if (session == NULL) |
44 | return -1; | 44 | return -1; |
45 | 45 | ||
46 | if (with_hits) | 46 | if (with_hits) { |
47 | symbol_conf.full_paths = true; | ||
47 | perf_session__process_events(session, &build_id__mark_dso_hit_ops); | 48 | perf_session__process_events(session, &build_id__mark_dso_hit_ops); |
49 | } | ||
48 | 50 | ||
49 | perf_session__fprintf_dsos_buildid(session, stdout, with_hits); | 51 | perf_session__fprintf_dsos_buildid(session, stdout, with_hits); |
50 | 52 | ||