[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c6bf8be1-1416-499b-7695-6b46e41b788c@intel.com>
Date: Wed, 4 May 2022 12:56:31 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>, Ian Rogers <irogers@...gle.com>,
Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>,
Leo Yan <leo.yan@...aro.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC 18/21] libperf evlist: Allow mixing per-thread and
per-cpu mmaps
On 3/05/22 23:29, Namhyung Kim wrote:
> On Fri, Apr 22, 2022 at 9:25 AM Adrian Hunter <adrian.hunter@...el.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@...el.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 for noticing that. It ends up being too high which doesn't fail
immediately. I need to add a check that nr_mmaps matches the number
of mmaps actually made.
>
> Thanks,
> Namhyung
>
>>
>> return nr_mmaps;
>> }
Powered by blists - more mailing lists