diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-15 14:44:01 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-23 18:28:58 -0400 |
commit | 9e69c210822c4035708a6111567c96364ca244d5 (patch) | |
tree | 3bae4b7f4309ec18bf4628b81cf85bb1570f6a31 /tools/perf/builtin-inject.c | |
parent | 880f57318450dbead6a03f9e31a1468924d6dd88 (diff) |
perf session: Pass evsel in event_ops->sample()
Resolving the sample->id to an evsel since the most advanced tools,
report and annotate, and the others will too when they evolve to
properly support multi-event perf.data files.
Good also because it does an extra validation, checking that the ID is
valid when present. When that is not the case, the overhead is just a
branch + function call (perf_evlist__id2evsel).
Cc: Frederic 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: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-inject.c')
-rw-r--r-- | tools/perf/builtin-inject.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index e29f04ed3396..8dfc12bb119b 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
@@ -43,6 +43,14 @@ static int perf_event__repipe(union perf_event *event, | |||
43 | return perf_event__repipe_synth(event, session); | 43 | return perf_event__repipe_synth(event, session); |
44 | } | 44 | } |
45 | 45 | ||
46 | static int perf_event__repipe_sample(union perf_event *event, | ||
47 | struct perf_sample *sample __used, | ||
48 | struct perf_evsel *evsel __used, | ||
49 | struct perf_session *session) | ||
50 | { | ||
51 | return perf_event__repipe_synth(event, session); | ||
52 | } | ||
53 | |||
46 | static int perf_event__repipe_mmap(union perf_event *event, | 54 | static int perf_event__repipe_mmap(union perf_event *event, |
47 | struct perf_sample *sample, | 55 | struct perf_sample *sample, |
48 | struct perf_session *session) | 56 | struct perf_session *session) |
@@ -124,6 +132,7 @@ static int dso__inject_build_id(struct dso *self, struct perf_session *session) | |||
124 | 132 | ||
125 | static int perf_event__inject_buildid(union perf_event *event, | 133 | static int perf_event__inject_buildid(union perf_event *event, |
126 | struct perf_sample *sample, | 134 | struct perf_sample *sample, |
135 | struct perf_evsel *evsel __used, | ||
127 | struct perf_session *session) | 136 | struct perf_session *session) |
128 | { | 137 | { |
129 | struct addr_location al; | 138 | struct addr_location al; |
@@ -164,7 +173,7 @@ repipe: | |||
164 | } | 173 | } |
165 | 174 | ||
166 | struct perf_event_ops inject_ops = { | 175 | struct perf_event_ops inject_ops = { |
167 | .sample = perf_event__repipe, | 176 | .sample = perf_event__repipe_sample, |
168 | .mmap = perf_event__repipe, | 177 | .mmap = perf_event__repipe, |
169 | .comm = perf_event__repipe, | 178 | .comm = perf_event__repipe, |
170 | .fork = perf_event__repipe, | 179 | .fork = perf_event__repipe, |