diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2015-09-25 09:15:33 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-09-28 15:42:38 -0400 |
commit | d062ac16f53d1a24047bcc9eded5514a71c363b8 (patch) | |
tree | 19ed51828458a03cc7f22d422e0718dfd15b349f /tools/perf/builtin-report.c | |
parent | e1791347b5d57d13326cf0114df1a3f3b1c4ca24 (diff) |
perf report: Fix sample type validation for synthesized callchains
Processing instruction tracing data (e.g. Intel PT) can synthesize
callchains e.g.
$ perf record -e intel_pt//u uname
$ perf report --stdio --itrace=ige
However perf report's callgraph option gets extra validation, so:
$ perf report --stdio --itrace=ige -gflat
Error:
Selected -g or --branch-history but no callchain data. Did
you call 'perf record' without -g?
# To display the perf.data header info,
# please use --header/--header-only options.
#
Fix the validation to know about instruction tracing options so
above command works.
A side-effect of the change is that the default option to
accumulate the callchain of child functions comes into force.
To get the previous behaviour the --no-children option can be
used e.g.
$ perf report --stdio --itrace=ige -gflat --no-children
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1443186956-18718-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index e4e3f1432622..0d53b485a87b 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -214,6 +214,12 @@ static int report__setup_sample_type(struct report *rep) | |||
214 | u64 sample_type = perf_evlist__combined_sample_type(session->evlist); | 214 | u64 sample_type = perf_evlist__combined_sample_type(session->evlist); |
215 | bool is_pipe = perf_data_file__is_pipe(session->file); | 215 | bool is_pipe = perf_data_file__is_pipe(session->file); |
216 | 216 | ||
217 | if (session->itrace_synth_opts->callchain || | ||
218 | (!is_pipe && | ||
219 | perf_header__has_feat(&session->header, HEADER_AUXTRACE) && | ||
220 | !session->itrace_synth_opts->set)) | ||
221 | sample_type |= PERF_SAMPLE_CALLCHAIN; | ||
222 | |||
217 | if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) { | 223 | if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) { |
218 | if (sort__has_parent) { | 224 | if (sort__has_parent) { |
219 | ui__error("Selected --sort parent, but no " | 225 | ui__error("Selected --sort parent, but no " |