Re: [PATCH v6 10/12] perf stat: Use affinity for reading

From: Jiri Olsa
Date: Fri Nov 15 2019 - 09:55:45 EST


On Mon, Nov 11, 2019 at 04:59:39PM -0800, Andi Kleen wrote:

SNIP

>
> evlist__for_each_entry(evsel_list, counter) {
> - ret = read_counter(counter, rs);
> - if (ret)
> + if (counter->err)
> pr_debug("failed to read counter %s\n", counter->name);
> -
> - if (ret == 0 && perf_stat_process_counter(&stat_config, counter))
> + if (counter->err == 0 && perf_stat_process_counter(&stat_config, counter))
> pr_warning("failed to process counter %s\n", counter->name);
> + counter->err = 0;
> }
> }
>
> diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
> index ca82a93960cd..c8af4bc23f8f 100644
> --- a/tools/perf/util/evsel.h
> +++ b/tools/perf/util/evsel.h
> @@ -86,6 +86,7 @@ struct evsel {
> struct list_head config_terms;
> struct bpf_object *bpf_obj;
> int bpf_fd;
> + int err;

I was wondering what would be the best place for this,
and all the previous variables u added and this one
are stat specific, so I think this all belongs to

(struct perf_stat_evsel*) evsel->stat

jirka