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

\
 
 \ /
  Last update: 2017-03-07 11:04    [W:0.093 / U:1.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site