Re: [PATCH v4 7/9] perf stat: Use affinity for opening events

From: Jiri Olsa
Date: Wed Nov 06 2019 - 11:34:32 EST


On Mon, Nov 04, 2019 at 04:25:20PM -0800, Andi Kleen wrote:

SNIP

> +}
> +
> void evsel__close(struct evsel *evsel)
> {
> perf_evsel__close(&evsel->core);
> @@ -1832,9 +1839,10 @@ void evsel__close(struct evsel *evsel)
> }
>
> int perf_evsel__open_per_cpu(struct evsel *evsel,
> - struct perf_cpu_map *cpus)
> + struct perf_cpu_map *cpus,
> + int cpu)
> {
> - return evsel__open(evsel, cpus, NULL);
> + return evsel__open_cpu(evsel, cpus, NULL, cpu, cpu + 1);
> }
>
> int perf_evsel__open_per_thread(struct evsel *evsel,
> diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
> index 2e3b011ed09e..d5440a928745 100644
> --- a/tools/perf/util/evsel.h
> +++ b/tools/perf/util/evsel.h
> @@ -94,6 +94,8 @@ struct evsel {
> struct evsel *metric_leader;
> bool collect_stat;
> bool weak_group;
> + bool reset_group;
> + bool errored;

would be great to move some of the changes into separate patches,
it seems all related to new code, but would ease up the review
like these 2 bools above or adding cpu to create_perf_stat_counter
and adding evsel__open_cpu funtion and related changes

thanks,
jirka