From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756236AbbI2Iwm (ORCPT ); Tue, 29 Sep 2015 04:52:42 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37717 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933035AbbI2ImB (ORCPT ); Tue, 29 Sep 2015 04:42:01 -0400 Date: Tue, 29 Sep 2015 01:41:50 -0700 From: tip-bot for Adrian Hunter Message-ID: Cc: hpa@zytor.com, adrian.hunter@intel.com, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, jolsa@redhat.com, mingo@kernel.org Reply-To: adrian.hunter@intel.com, hpa@zytor.com, acme@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, jolsa@redhat.com In-Reply-To: <1443186956-18718-3-git-send-email-adrian.hunter@intel.com> References: <1443186956-18718-3-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf report: Fix sample type validation for synthesized callchains Git-Commit-ID: d062ac16f53d1a24047bcc9eded5514a71c363b8 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d062ac16f53d1a24047bcc9eded5514a71c363b8 Gitweb: http://git.kernel.org/tip/d062ac16f53d1a24047bcc9eded5514a71c363b8 Author: Adrian Hunter AuthorDate: Fri, 25 Sep 2015 16:15:33 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Sep 2015 16:42:38 -0300 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 Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1443186956-18718-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-report.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index e4e3f14..0d53b48 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) u64 sample_type = perf_evlist__combined_sample_type(session->evlist); bool is_pipe = perf_data_file__is_pipe(session->file); + if (session->itrace_synth_opts->callchain || + (!is_pipe && + perf_header__has_feat(&session->header, HEADER_AUXTRACE) && + !session->itrace_synth_opts->set)) + sample_type |= PERF_SAMPLE_CALLCHAIN; + if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) { if (sort__has_parent) { ui__error("Selected --sort parent, but no "