lkml.org 
[lkml]   [2022]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH RFC 18/21] libperf evlist: Allow mixing per-thread and per-cpu mmaps
On Fri, Apr 22, 2022 at 9:25 AM Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> mmap_per_evsel() will skip events that do not match the CPU, so all CPUs
> can be iterated in any case.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
[...]
> @@ -561,9 +538,12 @@ static int perf_evlist__nr_mmaps(struct perf_evlist *evlist)
> {
> int nr_mmaps;
>
> + /* One for each CPU */
> nr_mmaps = perf_cpu_map__nr(evlist->all_cpus);
> - if (perf_cpu_map__empty(evlist->all_cpus))
> - nr_mmaps = perf_thread_map__nr(evlist->threads);
> + /* One for each thread */
> + nr_mmaps += perf_thread_map__nr(evlist->threads);
> + /* Minus the dummy CPU or dummy thread */
> + nr_mmaps -= 1;

I'm not sure it'd work for per-task events with default-per-cpu mode.

Thanks,
Namhyung

>
> return nr_mmaps;
> }

\
 
 \ /
  Last update: 2022-05-03 22:30    [W:0.246 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site