From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753375AbbIPVim (ORCPT ); Wed, 16 Sep 2015 17:38:42 -0400 Received: from mga11.intel.com ([192.55.52.93]:25302 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753075AbbIPViG (ORCPT ); Wed, 16 Sep 2015 17:38:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,541,1437462000"; d="scan'208";a="770539370" From: kan.liang@intel.com To: acme@kernel.org, jolsa@kernel.org Cc: a.p.zijlstra@chello.nl, luto@kernel.org, mingo@redhat.com, eranian@google.com, ak@linux.intel.com, mark.rutland@arm.com, adrian.hunter@intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, Kan Liang Subject: [PATCH V10 6/8] perf,tools: only show leader's value in hpp__fmt Date: Wed, 16 Sep 2015 10:21:54 -0400 Message-Id: <1442413316-33518-7-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1442413316-33518-1-git-send-email-kan.liang@intel.com> References: <1442413316-33518-1-git-send-email-kan.liang@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang If group option is set, perf report shows the values from each events in the same group one by one. However, sometimes only leader's value is enough. For example, we only caculate and store the freq value for leader. Signed-off-by: Kan Liang --- tools/perf/ui/hist.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 25d6083..c37aa6f 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -17,7 +17,7 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, hpp_field_fn get_field, const char *fmt, int len, - hpp_snprint_fn print_fn, bool fmt_percent) + hpp_snprint_fn print_fn, bool fmt_percent, bool leader_only) { int ret; struct hists *hists = he->hists; @@ -36,7 +36,7 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, } else ret = hpp__call_print_fn(hpp, print_fn, fmt, len, get_field(he)); - if (perf_evsel__is_group_event(evsel)) { + if (perf_evsel__is_group_event(evsel) && !leader_only) { int prev_idx, idx_delta; struct hist_entry *pair; int nr_members = evsel->nr_members; @@ -109,10 +109,11 @@ int hpp__fmt(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, const char *fmtstr, hpp_snprint_fn print_fn, bool fmt_percent) { int len = fmt->user_len ?: fmt->len; + bool leader_only = false; if (symbol_conf.field_sep) { return __hpp__fmt(hpp, he, get_field, fmtstr, 1, - print_fn, fmt_percent); + print_fn, fmt_percent, leader_only); } if (fmt_percent) @@ -120,7 +121,7 @@ int hpp__fmt(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, else len -= 1; - return __hpp__fmt(hpp, he, get_field, fmtstr, len, print_fn, fmt_percent); + return __hpp__fmt(hpp, he, get_field, fmtstr, len, print_fn, fmt_percent, leader_only); } int hpp__fmt_acc(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, -- 1.8.3.1