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, 20 Nov 2019 16:07:32 +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 v7 09/12] perf stat: Use affinity for opening events

On Fri, Nov 15, 2019 at 09:52:26PM -0800, Andi Kleen wrote:

SNIP

> +	if (second_pass) {
> +		/*
> +		 * Now redo all the weak group after closing them,
> +		 * and also close errored counters.
> +		 */
> +
> +		evlist__for_each_cpu (evsel_list, i, cpu) {
> +			affinity__set(&affinity, cpu);
> +			/* First close errored or weak retry */
> +			evlist__for_each_entry(evsel_list, counter) {
> +				if (!counter->reset_group && !counter->errored)
> +					continue;
> +				if (evsel__cpu_iter_skip_no_inc(counter, cpu))
> +					continue;
> +				perf_evsel__close_cpu(&counter->core, counter->cpu_iter);
> +			}
> +			/* Now reopen weak */
> +			evlist__for_each_entry(evsel_list, counter) {
> +				if (!counter->reset_group && !counter->errored)
> +					continue;
> +				if (evsel__cpu_iter_skip(counter, cpu))
> +					continue;

why staring at this I wonder why can't we call perf_evsel__close_cpu in
here and remove the above loop? together with evsel__cpu_iter_skip_no_inc
function

jirka


> +				if (!counter->reset_group)
> +					continue;
> +try_again_reset:
> +				pr_debug2("reopening weak %s\n", perf_evsel__name(counter));
> +				if (create_perf_stat_counter(counter, &stat_config, &target,
> +							     counter->cpu_iter - 1) < 0) {
> +
> +					switch (stat_handle_error(counter)) {
> +					case COUNTER_FATAL:
> +						return -1;
> +					case COUNTER_RETRY:
> +						goto try_again_reset;
> +					case COUNTER_SKIP:
> +						continue;
> +					default:
> +						break;
> +					}
> +				}
> +				counter->supported = true;
>  			}
>  		}
> -		counter->supported = true;
> +	}

SNIP

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ