Re: [PATCH v5 10/13] perf stat: Use affinity for opening events

From: Jiri Olsa
Date: Mon Nov 11 2019 - 08:30:27 EST


On Thu, Nov 07, 2019 at 10:16:43AM -0800, Andi Kleen wrote:

SNIP

> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -1632,7 +1632,8 @@ void perf_evlist__force_leader(struct evlist *evlist)
> }
>
> struct evsel *perf_evlist__reset_weak_group(struct evlist *evsel_list,
> - struct evsel *evsel)
> + struct evsel *evsel,
> + bool close)
> {
> struct evsel *c2, *leader;
> bool is_open = true;
> @@ -1649,10 +1650,11 @@ struct evsel *perf_evlist__reset_weak_group(struct evlist *evsel_list,
> if (c2 == evsel)
> is_open = false;
> if (c2->leader == leader) {
> - if (is_open)
> + if (is_open && close)
> perf_evsel__close(&c2->core);
> c2->leader = c2;
> c2->core.nr_members = 0;
> + c2->reset_group = true;

so it's only set to true and stays.. please explain the logic
in comment.. together with errored

thanks,
jirka