lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Feb 2017 12:31:21 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andi Kleen <andi@...stfloor.org>
Cc:     acme@...nel.org, jolsa@...nel.org, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ