lkml.org 
[lkml]   [2022]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 04/48] perf stat: Switch aggregation to use for_each loop
On Mon, Jan 10, 2022 at 10:51 AM John Garry <john.garry@huawei.com> wrote:
>
> On 05/01/2022 06:13, Ian Rogers wrote:
> > + cpus = evsel__cpus(evsel);
> > + perf_cpu_map__for_each_cpu(cpu, idx, cpus) {
>
> It seems a common pattern to evaluate cpus and use in
> perf_cpu_map__for_each_cpu() - is it possible to make a macro to accept
> evsel and create cpus, like perf_evsel__for_each_cpu()?

It's possible, I'm not sure it is saving much and it is common to also
want to iterate the cpumap of the evlist.

Thanks,
Ian

> > + if (cpu_map__compare_aggr_cpu_id(config->aggr_get_id(config, cpus, idx),
> > + id))
> > + return cpu;
> > }
> > return 0;
>

\
 
 \ /
  Last update: 2022-01-10 23:23    [W:1.478 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site