Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1576476

Re: [PATCH 06/10] perf, tools: Collapse identically named events in perf stat

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 06/10] perf, tools: Collapse identically named events in perf stat
Date 2017-02-08 12:40 +0100
Message-ID <t8yLn-8bT-7@gated-at.bofh.it> (permalink)
References <t4qCK-3Iy-5@gated-at.bofh.it> <t4qCK-3Iy-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jan 27, 2017 at 06:03:41PM -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_aliases(struct perf_evsel *counter,
> +			    void (*cb)(struct perf_evsel *counter, void *data,
> +				       bool first),
> +			    void *data)
> +{
> +	cb(counter, data, true);
> +	if (!no_merge)
> +		collect_all_aliases(counter, cb, data);
> +}

could you please split this into 2 changes:
  - adding adding collect_aliases function with no functional change
    just changing all the print callers to use it
  - adding collect_all_aliases change that actualy change the behaviour
    and merges the stats

also please change the collect_aliases name to something
generic like collect data

thanks,
jirka

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 06/10] perf, tools: Collapse identically named events in  perf stat Jiri Olsa <jolsa@redhat.com> - 2017-02-08 12:40 +0100

csiph-web