[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191121151338.GC811@krava>
Date: Thu, 21 Nov 2019 16:13:38 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Andi Kleen <ak@...ux.intel.com>
Cc: Andi Kleen <andi@...stfloor.org>, acme@...nel.org,
jolsa@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 09/12] perf stat: Use affinity for opening events
On Wed, Nov 20, 2019 at 02:31:01PM -0800, Andi Kleen wrote:
> > > + 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
>
> We only want to close events which errored or need a weak entry.
> The others can stay open. perf_evsel__close_cpu closes all unconditionally.
but the first loops checks fir !counter->errored, same as the second
one, so you could scratch the first loop and move perf_evsel__close_cpu
in the second one
jirka
Powered by blists - more mailing lists