diff options
author | Andrew Vagin <avagin@openvz.org> | 2012-08-07 08:56:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-26 09:22:25 -0400 |
commit | 54a3cf59b53b3f01989a28344ecf4cb68217a6f6 (patch) | |
tree | d5bb089080e23701b5f6af98c5c9ce74d9df85ca /tools/perf/builtin-inject.c | |
parent | 26a031e136f4f8dc82c64df48cca0eb3b5d3eb4f (diff) |
perf inject: Mark a dso if it's used
Otherwise they will be not written in an output file.
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1344344165-369636-5-git-send-email-avagin@openvz.org
[ committer note: Fixed up wrt changes made in the immediate previous patches ]
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, 8 insertions, 3 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index a4a307258fa3..84ad6abe4258 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include "util/session.h" | 14 | #include "util/session.h" |
15 | #include "util/tool.h" | 15 | #include "util/tool.h" |
16 | #include "util/debug.h" | 16 | #include "util/debug.h" |
17 | #include "util/build-id.h" | ||
17 | 18 | ||
18 | #include "util/parse-options.h" | 19 | #include "util/parse-options.h" |
19 | 20 | ||
@@ -116,6 +117,8 @@ static int perf_event__repipe_sample(struct perf_tool *tool, | |||
116 | return f(tool, event, sample, evsel, machine); | 117 | return f(tool, event, sample, evsel, machine); |
117 | } | 118 | } |
118 | 119 | ||
120 | build_id__mark_dso_hit(tool, event, sample, evsel, machine); | ||
121 | |||
119 | return perf_event__repipe_synth(tool, event, machine); | 122 | return perf_event__repipe_synth(tool, event, machine); |
120 | } | 123 | } |
121 | 124 | ||
@@ -310,6 +313,7 @@ found: | |||
310 | sample_sw.time = sample->time; | 313 | sample_sw.time = sample->time; |
311 | perf_event__synthesize_sample(event_sw, evsel->attr.sample_type, | 314 | perf_event__synthesize_sample(event_sw, evsel->attr.sample_type, |
312 | &sample_sw, false); | 315 | &sample_sw, false); |
316 | build_id__mark_dso_hit(tool, event_sw, &sample_sw, evsel, machine); | ||
313 | return perf_event__repipe(tool, event_sw, &sample_sw, machine); | 317 | return perf_event__repipe(tool, event_sw, &sample_sw, machine); |
314 | } | 318 | } |
315 | 319 | ||
@@ -342,8 +346,7 @@ static int __cmd_inject(struct perf_inject *inject) | |||
342 | 346 | ||
343 | signal(SIGINT, sig_handler); | 347 | signal(SIGINT, sig_handler); |
344 | 348 | ||
345 | if (inject->build_ids) { | 349 | if (inject->build_ids || inject->sched_stat) { |
346 | inject->tool.sample = perf_event__inject_buildid; | ||
347 | inject->tool.mmap = perf_event__repipe_mmap; | 350 | inject->tool.mmap = perf_event__repipe_mmap; |
348 | inject->tool.fork = perf_event__repipe_fork; | 351 | inject->tool.fork = perf_event__repipe_fork; |
349 | inject->tool.tracing_data = perf_event__repipe_tracing_data; | 352 | inject->tool.tracing_data = perf_event__repipe_tracing_data; |
@@ -353,7 +356,9 @@ static int __cmd_inject(struct perf_inject *inject) | |||
353 | if (session == NULL) | 356 | if (session == NULL) |
354 | return -ENOMEM; | 357 | return -ENOMEM; |
355 | 358 | ||
356 | if (inject->sched_stat) { | 359 | if (inject->build_ids) { |
360 | inject->tool.sample = perf_event__inject_buildid; | ||
361 | } else if (inject->sched_stat) { | ||
357 | struct perf_evsel *evsel; | 362 | struct perf_evsel *evsel; |
358 | 363 | ||
359 | inject->tool.ordered_samples = true; | 364 | inject->tool.ordered_samples = true; |