path: root/tools/perf/builtin-buildid-list.c
diff options
authorIan Munsie <>2010-12-10 14:09:16 +1100
committerArnaldo Carvalho de Melo <>2010-12-21 20:17:51 -0200
commit21ef97f05a7da5bc23b26cb34d6746f83ca9bf20 (patch)
treec47c09c178f7929f01dcb7b302ceed21f3758ded /tools/perf/builtin-buildid-list.c
parent7639dae0ca11038286bbbcda05f2bef601c1eb8d (diff)
perf session: Fallback to unordered processing if no sample_id_all
If we are running the new perf on an old kernel without support for sample_id_all, we should fall back to the old unordered processing of events. If we didn't than we would *always* process events without timestamps out of order, whether or not we hit a reordering race. In other words, instead of there being a chance of not attributing samples correctly, we would guarantee that samples would not be attributed. While processing all events without timestamps before events with timestamps may seem like an intuitive solution, it falls down as PERF_RECORD_EXIT events would also be processed before any samples. Even with a workaround for that case, samples before/after an exec would not be attributed correctly. This patch allows commands to indicate whether they need to fall back to unordered processing, so that commands that do not care about timestamps on every event will not be affected. If we do fallback, this will print out a warning if report -D was invoked. This patch adds the test in perf_session__new so that we only need to test once per session. Commands that do not use an event_ops (such as record and top) can simply pass NULL in it's place. Acked-by: Thomas Gleixner <> Cc: Frederic Weisbecker <> Cc: Ingo Molnar <> Cc: Peter Zijlstra <> Cc: Thomas Gleixner <> LKML-Reference: <> Signed-off-by: Ian Munsie <> Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/builtin-buildid-list.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index 44a47e13bd67..3b06f9ca2638 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -39,7 +39,8 @@ static int __cmd_buildid_list(void)
int err = -1;
struct perf_session *session;
- session = perf_session__new(input_name, O_RDONLY, force, false);
+ session = perf_session__new(input_name, O_RDONLY, force, false,
+ &build_id__mark_dso_hit_ops);
if (session == NULL)
return -1;