From: Adrian Hunter Date: Fri, 25 Sep 2015 13:15:40 +0000 (+0300) Subject: perf report: Adjust sample type validation for synthesized branch stacks X-Git-Tag: v4.4-rc1~155^2~21^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7eced63f2f67bd06ceb2269062416db9d81d29d;p=platform%2Fkernel%2Flinux-exynos.git perf report: Adjust sample type validation for synthesized branch stacks perf report looks at event sample types to determine if branch stacks have been sampled. Adjust the validation to know about instruction tracing options. This change allows the use of the -b option which otherwise would complain with an error like: Error: Selected -b but no branch data. Did you call perf record without -b? # To display the perf.data header info, # please use --header/--header-only options. # Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1443186956-18718-10-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0d53b48..7af35af 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -220,6 +220,9 @@ static int report__setup_sample_type(struct report *rep) !session->itrace_synth_opts->set)) sample_type |= PERF_SAMPLE_CALLCHAIN; + if (session->itrace_synth_opts->last_branch) + sample_type |= PERF_SAMPLE_BRANCH_STACK; + if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) { if (sort__has_parent) { ui__error("Selected --sort parent, but no "