From: Namhyung Kim <namhyung@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Jiri Olsa <jolsa@redhat.com>, Ian Rogers <irogers@google.com>,
Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>,
Leo Yan <leo.yan@linaro.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC 18/21] libperf evlist: Allow mixing per-thread and per-cpu mmaps
Date: Tue, 3 May 2022 13:29:20 -0700 [thread overview]
Message-ID: <CAM9d7chPX314n6c_V+3c0HF1OKNSL3zS-s3L78oH39Ds7cSpEg@mail.gmail.com> (raw)
In-Reply-To: <20220422162402.147958-19-adrian.hunter@intel.com>
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;
> }
next prev parent reply other threads:[~2022-05-03 20:30 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 16:23 [PATCH RFC 00/21] perf intel-pt: Better support for perf record --cpu Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 01/21] libperf evsel: Factor out perf_evsel__ioctl() Adrian Hunter
2022-04-22 19:05 ` Arnaldo Carvalho de Melo
2022-04-22 16:23 ` [PATCH RFC 02/21] libperf evsel: Add perf_evsel__enable_thread() Adrian Hunter
2022-04-27 21:48 ` Namhyung Kim
2022-04-28 4:15 ` Adrian Hunter
2022-04-28 23:50 ` Namhyung Kim
2022-05-03 16:45 ` Ian Rogers
2022-04-22 16:23 ` [PATCH RFC 03/21] perf evlist: Use libperf functions in evlist__enable_event_idx() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 04/21] perf auxtrace: Move evlist__enable_event_idx() to auxtrace.c Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 05/21] perf auxtrace: Do not mix up mmap idx Adrian Hunter
2022-04-27 21:54 ` Namhyung Kim
2022-04-28 4:29 ` Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 06/21] libperf evlist: Remove ->idx() per_cpu parameter Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 07/21] libperf evlist: Move ->idx() into mmap_per_evsel() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 08/21] libperf evlist: Add evsel as a parameter to ->idx() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 09/21] perf auxtrace: Record whether an auxtrace mmap is needed Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 10/21] perf auxctrace: Add mmap_needed to auxtrace_mmap_params Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 11/21] perf auxtrace: Remove auxtrace_mmap_params__set_idx() per_cpu parameter Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 12/21] perf evlist: Factor out evlist__dummy_event() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 13/21] perf evlist: Add evlist__add_system_wide_dummy() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 14/21] perf record: Use evlist__add_system_wide_dummy() in record__config_text_poke() Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 15/21] perf intel-pt: Use evlist__add_system_wide_dummy() for switch tracking Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 16/21] perf intel-pt: Track sideband system-wide when needed Adrian Hunter
2022-04-22 16:23 ` [PATCH RFC 17/21] perf tools: Allow all_cpus to be a superset of user_requested_cpus Adrian Hunter
2022-05-03 17:41 ` Ian Rogers
2022-04-22 16:23 ` [PATCH RFC 18/21] libperf evlist: Allow mixing per-thread and per-cpu mmaps Adrian Hunter
2022-05-03 20:29 ` Namhyung Kim [this message]
2022-05-04 9:56 ` Adrian Hunter
2022-04-22 16:24 ` [PATCH RFC 19/21] perf stat: Add requires_cpu flag for uncore Adrian Hunter
2022-04-29 22:57 ` Namhyung Kim
2022-04-30 1:10 ` Ian Rogers
2022-04-22 16:24 ` [PATCH RFC 20/21] perf tools: Allow system-wide events to keep their own CPUs Adrian Hunter
2022-04-22 16:24 ` [PATCH RFC 21/21] perf tools: Allow system-wide events to keep their own threads Adrian Hunter
2022-05-03 18:09 ` [PATCH RFC 00/21] perf intel-pt: Better support for perf record --cpu Ian Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAM9d7chPX314n6c_V+3c0HF1OKNSL3zS-s3L78oH39Ds7cSpEg@mail.gmail.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexey.v.bayduraev@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).