diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-01-11 08:37:09 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-01-12 10:42:07 -0500 |
commit | 6156681b73f2fffe56493e9a50518c0cbfcd8ba3 (patch) | |
tree | 5bdbc06f4e1f6fb6361a80e7f195c9212f1c5162 /tools | |
parent | 24b1e5d7f552eb6da430d5264d671ba45d634804 (diff) |
perf record: Add --buildid-all option
The --buildid-all option is to record build-id of all DSOs in the file.
It might be very costly to postprocess samples to find which DSO hits.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1452519429-31779-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Documentation/perf-record.txt | 3 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 26 |
2 files changed, 23 insertions, 6 deletions
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 3a1a32f5479f..fbceb631387c 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt | |||
@@ -338,6 +338,9 @@ Options passed to clang when compiling BPF scriptlets. | |||
338 | Specify vmlinux path which has debuginfo. | 338 | Specify vmlinux path which has debuginfo. |
339 | (enabled when BPF prologue is on) | 339 | (enabled when BPF prologue is on) |
340 | 340 | ||
341 | --buildid-all:: | ||
342 | Record build-id of all DSOs regardless whether it's actually hit or not. | ||
343 | |||
341 | SEE ALSO | 344 | SEE ALSO |
342 | -------- | 345 | -------- |
343 | linkperf:perf-stat[1], linkperf:perf-list[1] | 346 | linkperf:perf-stat[1], linkperf:perf-list[1] |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index dc4e0adf5c5b..319712a4e02b 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -50,6 +50,7 @@ struct record { | |||
50 | int realtime_prio; | 50 | int realtime_prio; |
51 | bool no_buildid; | 51 | bool no_buildid; |
52 | bool no_buildid_cache; | 52 | bool no_buildid_cache; |
53 | bool buildid_all; | ||
53 | unsigned long long samples; | 54 | unsigned long long samples; |
54 | }; | 55 | }; |
55 | 56 | ||
@@ -362,6 +363,13 @@ static int process_buildids(struct record *rec) | |||
362 | */ | 363 | */ |
363 | symbol_conf.ignore_vmlinux_buildid = true; | 364 | symbol_conf.ignore_vmlinux_buildid = true; |
364 | 365 | ||
366 | /* | ||
367 | * If --buildid-all is given, it marks all DSO regardless of hits, | ||
368 | * so no need to process samples. | ||
369 | */ | ||
370 | if (rec->buildid_all) | ||
371 | rec->tool.sample = NULL; | ||
372 | |||
365 | return perf_session__process_events(session); | 373 | return perf_session__process_events(session); |
366 | } | 374 | } |
367 | 375 | ||
@@ -756,12 +764,8 @@ out_child: | |||
756 | 764 | ||
757 | if (!rec->no_buildid) { | 765 | if (!rec->no_buildid) { |
758 | process_buildids(rec); | 766 | process_buildids(rec); |
759 | /* | 767 | |
760 | * We take all buildids when the file contains | 768 | if (rec->buildid_all) |
761 | * AUX area tracing data because we do not decode the | ||
762 | * trace because it would take too long. | ||
763 | */ | ||
764 | if (rec->opts.full_auxtrace) | ||
765 | dsos__hit_all(rec->session); | 769 | dsos__hit_all(rec->session); |
766 | } | 770 | } |
767 | perf_session__write_header(rec->session, rec->evlist, fd, true); | 771 | perf_session__write_header(rec->session, rec->evlist, fd, true); |
@@ -1138,6 +1142,8 @@ struct option __record_options[] = { | |||
1138 | "options passed to clang when compiling BPF scriptlets"), | 1142 | "options passed to clang when compiling BPF scriptlets"), |
1139 | OPT_STRING(0, "vmlinux", &symbol_conf.vmlinux_name, | 1143 | OPT_STRING(0, "vmlinux", &symbol_conf.vmlinux_name, |
1140 | "file", "vmlinux pathname"), | 1144 | "file", "vmlinux pathname"), |
1145 | OPT_BOOLEAN(0, "buildid-all", &record.buildid_all, | ||
1146 | "Record build-id of all DSOs regardless of hits"), | ||
1141 | OPT_END() | 1147 | OPT_END() |
1142 | }; | 1148 | }; |
1143 | 1149 | ||
@@ -1255,6 +1261,14 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1255 | if (err) | 1261 | if (err) |
1256 | goto out_symbol_exit; | 1262 | goto out_symbol_exit; |
1257 | 1263 | ||
1264 | /* | ||
1265 | * We take all buildids when the file contains | ||
1266 | * AUX area tracing data because we do not decode the | ||
1267 | * trace because it would take too long. | ||
1268 | */ | ||
1269 | if (rec->opts.full_auxtrace) | ||
1270 | rec->buildid_all = true; | ||
1271 | |||
1258 | if (record_opts__config(&rec->opts)) { | 1272 | if (record_opts__config(&rec->opts)) { |
1259 | err = -EINVAL; | 1273 | err = -EINVAL; |
1260 | goto out_symbol_exit; | 1274 | goto out_symbol_exit; |