From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754851AbdCGKDg (ORCPT ); Tue, 7 Mar 2017 05:03:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21132 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752324AbdCGKD0 (ORCPT ); Tue, 7 Mar 2017 05:03:26 -0500 Date: Tue, 7 Mar 2017 11:02:52 +0100 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 02/10] perf, tools, stat: Collapse identically named events Message-ID: <20170307100252.GA12093@krava> References: <20170301064924.32172-1-andi@firstfloor.org> <20170301064924.32172-3-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170301064924.32172-3-andi@firstfloor.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 07 Mar 2017 10:02:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 28, 2017 at 10:49:16PM -0800, Andi Kleen wrote: SNIP > } > } > > +static void collect_all_aliases(struct perf_evsel *counter, > + void (*cb)(struct perf_evsel *counter, void *data, > + bool first), > + void *data) > +{ > + struct perf_evsel *alias; > + > + alias = list_prepare_entry(counter, &(evsel_list->entries), node); > + list_for_each_entry_continue (alias, &evsel_list->entries, node) { > + if (strcmp(perf_evsel__name(alias), perf_evsel__name(counter)) || > + alias->scale != counter->scale || > + alias->cgrp != counter->cgrp || > + strcmp(alias->unit, counter->unit) || > + nsec_counter(alias) != nsec_counter(counter)) > + break; > + alias->merged_stat = true; > + cb(alias, data, false); > + } > +} > + > static void collect_data(struct perf_evsel *counter, > void (*cb)(struct perf_evsel *counter, void *data, > bool first), > void *data) > { could we place the merged_stat condition in here and have collect_data return value to process or not the current counter.. looks like we could get rid of 2 merged_stat conditions in print_counter_aggr and print_aggr jirka