lkml.org 
[lkml]   [2017]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/10] perf, tools: Collapse identically named events in perf stat
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

\
 
 \ /
  Last update: 2017-02-08 12:31    [W:0.165 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site