From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934130AbbI2IqJ (ORCPT ); Tue, 29 Sep 2015 04:46:09 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37836 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933519AbbI2IpF (ORCPT ); Tue, 29 Sep 2015 04:45:05 -0400 Date: Tue, 29 Sep 2015 01:44:54 -0700 From: tip-bot for Adrian Hunter Message-ID: Cc: adrian.hunter@intel.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, jolsa@redhat.com Reply-To: adrian.hunter@intel.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, jolsa@redhat.com, linux-kernel@vger.kernel.org, acme@redhat.com In-Reply-To: <1443186956-18718-12-git-send-email-adrian.hunter@intel.com> References: <1443186956-18718-12-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf report: Skip events with null branch stacks Git-Commit-ID: f86225db3aa0e394915af45eea1c3cca6f3e2dba 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: f86225db3aa0e394915af45eea1c3cca6f3e2dba Gitweb: http://git.kernel.org/tip/f86225db3aa0e394915af45eea1c3cca6f3e2dba Author: Adrian Hunter AuthorDate: Fri, 25 Sep 2015 16:15:42 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Sep 2015 16:57:01 -0300 perf report: Skip events with null branch stacks A non-synthesized event might not have a branch stack if branch stacks have been synthesized (using itrace options). An example of that is when Intel PT records sched_switch events for decoding purposes. Those sched_switch events do not have branch stacks even though the Intel PT decoder may be synthesizing other events that do due to the itrace options. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1443186956-18718-12-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-report.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 92f7c5a..e94e5c7 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -163,14 +163,21 @@ static int process_sample_event(struct perf_tool *tool, if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap)) goto out_put; - if (sort__mode == SORT_MODE__BRANCH) + if (sort__mode == SORT_MODE__BRANCH) { + /* + * A non-synthesized event might not have a branch stack if + * branch stacks have been synthesized (using itrace options). + */ + if (!sample->branch_stack) + goto out_put; iter.ops = &hist_iter_branch; - else if (rep->mem_mode) + } else if (rep->mem_mode) { iter.ops = &hist_iter_mem; - else if (symbol_conf.cumulate_callchain) + } else if (symbol_conf.cumulate_callchain) { iter.ops = &hist_iter_cumulative; - else + } else { iter.ops = &hist_iter_normal; + } if (al.map != NULL) al.map->dso->hit = 1;