From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934037AbbI2Ioe (ORCPT ); Tue, 29 Sep 2015 04:44:34 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37798 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933473AbbI2IoX (ORCPT ); Tue, 29 Sep 2015 04:44:23 -0400 Date: Tue, 29 Sep 2015 01:44:12 -0700 From: tip-bot for Adrian Hunter Message-ID: Cc: mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, adrian.hunter@intel.com, hpa@zytor.com, jolsa@redhat.com, acme@redhat.com Reply-To: acme@redhat.com, hpa@zytor.com, jolsa@redhat.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org In-Reply-To: <1443186956-18718-10-git-send-email-adrian.hunter@intel.com> References: <1443186956-18718-10-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf report: Adjust sample type validation for synthesized branch stacks Git-Commit-ID: c7eced63f2f67bd06ceb2269062416db9d81d29d 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: c7eced63f2f67bd06ceb2269062416db9d81d29d Gitweb: http://git.kernel.org/tip/c7eced63f2f67bd06ceb2269062416db9d81d29d Author: Adrian Hunter AuthorDate: Fri, 25 Sep 2015 16:15:40 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Sep 2015 16:54:21 -0300 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 --- tools/perf/builtin-report.c | 3 +++ 1 file changed, 3 insertions(+) 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 "