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]
Message-ID: <YIBvJLAvL0rWGhhP@krava>
Date:   Wed, 21 Apr 2021 20:29:56 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Jin Yao <yao.jin@...ux.intel.com>
Cc:     acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
        mingo@...hat.com, alexander.shishkin@...ux.intel.com,
        Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
        kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v4 15/25] perf stat: Filter out unmatched aggregation for
 hybrid event

On Fri, Apr 16, 2021 at 10:05:07PM +0800, Jin Yao wrote:

SNIP

> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index 5255d78b1c30..15eafd249e46 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -643,6 +643,20 @@ static void aggr_cb(struct perf_stat_config *config,
>  	}
>  }
>  
> +static bool aggr_id_hybrid_matched(struct perf_stat_config *config,
> +				   struct evsel *counter, struct aggr_cpu_id id)
> +{
> +	struct aggr_cpu_id s;
> +
> +	for (int i = 0; i < evsel__nr_cpus(counter); i++) {
> +		s = config->aggr_get_id(config, evsel__cpus(counter), i);
> +		if (cpu_map__compare_aggr_cpu_id(s, id))
> +			return true;
> +	}
> +
> +	return false;
> +}
> +
>  static void print_counter_aggrdata(struct perf_stat_config *config,
>  				   struct evsel *counter, int s,
>  				   char *prefix, bool metric_only,
> @@ -656,6 +670,12 @@ static void print_counter_aggrdata(struct perf_stat_config *config,
>  	double uval;
>  
>  	ad.id = id = config->aggr_map->map[s];
> +
> +	if (perf_pmu__has_hybrid() &&
> +	    !aggr_id_hybrid_matched(config, counter, id)) {
> +		return;
> +	}
> +
>  	ad.val = ad.ena = ad.run = 0;
>  	ad.nr = 0;
>  	if (!collect_data(config, counter, aggr_cb, &ad))

there's same check in aggr_cb, so it seems like we could just make check in here:

	if (perf_pmu__has_hybrid() && ad.ena == 0)
		return;

without another extra loop

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ