From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965112AbcJQL1I (ORCPT ); Mon, 17 Oct 2016 07:27:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37260 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935117AbcJQL04 (ORCPT ); Mon, 17 Oct 2016 07:26:56 -0400 Date: Mon, 17 Oct 2016 13:26:53 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, sukadev@linux.vnet.ibm.com, eranian@google.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 07/10] perf, tools: Collapse identically named events in perf stat Message-ID: <20161017112653.GB24552@krava> References: <1476393332-20732-1-git-send-email-andi@firstfloor.org> <1476393332-20732-8-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476393332-20732-8-git-send-email-andi@firstfloor.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 17 Oct 2016 11:26:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 13, 2016 at 02:15:29PM -0700, Andi Kleen wrote: SNIP > -------- > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > index 688dea7cb08f..76304f27c090 100644 > --- a/tools/perf/builtin-stat.c > +++ b/tools/perf/builtin-stat.c > @@ -140,6 +140,7 @@ static unsigned int unit_width = 4; /* strlen("unit") */ > static bool forever = false; > static bool metric_only = false; > static bool force_metric_only = false; > +static bool no_merge = false; > static struct timespec ref_time; > static struct cpu_map *aggr_map; > static aggr_get_id_t aggr_get_id; > @@ -1178,11 +1179,59 @@ static void aggr_update_shadow(void) > } > } > > +static void collect_aliases(struct perf_evsel *counter, > + void (*cb)(struct perf_evsel *counter, void *data, > + bool first), > + void *data) merges_stats might be better name > +{ > + struct perf_evsel *alias; > + > + alias = list_prepare_entry(counter, &(evsel_list->entries), node); > + cb(counter, data, true); > + if (no_merge) > + return; please put this decision (no_merge) outside this function, so the normal path is straight this leads to my next question: why this merging should be default? it seems to make sense just for uncore events thanks, jirka