From: "Falcon, Thomas" <thomas.falcon@intel.com>
To: "ben.gainey@arm.com" <ben.gainey@arm.com>,
"alexander.shishkin@linux.intel.com"
<alexander.shishkin@linux.intel.com>,
"blakejones@google.com" <blakejones@google.com>,
"tmricht@linux.ibm.com" <tmricht@linux.ibm.com>,
"song@kernel.org" <song@kernel.org>,
"howardchu95@gmail.com" <howardchu95@gmail.com>,
"Hunter, Adrian" <adrian.hunter@intel.com>,
"jean-philippe.romain@foss.st.com"
<jean-philippe.romain@foss.st.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"irogers@google.com" <irogers@google.com>,
"ashelat@redhat.com" <ashelat@redhat.com>,
"linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
"james.clark@linaro.org" <james.clark@linaro.org>,
"kan.liang@linux.intel.com" <kan.liang@linux.intel.com>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"linux@treblig.org" <linux@treblig.org>,
"yeoreum.yun@arm.com" <yeoreum.yun@arm.com>,
"Wang, Weilin" <weilin.wang@intel.com>,
"acme@kernel.org" <acme@kernel.org>,
"yangyicong@hisilicon.com" <yangyicong@hisilicon.com>,
"jolsa@kernel.org" <jolsa@kernel.org>,
"namhyung@kernel.org" <namhyung@kernel.org>,
"quic_zhonhan@quicinc.com" <quic_zhonhan@quicinc.com>
Subject: Re: [PATCH v1 00/12] CPU mask improvements/fixes particularly for hybrid
Date: Wed, 16 Jul 2025 20:03:50 +0000 [thread overview]
Message-ID: <9c9d0fc0e37425961f539f8aac6ff09a8da8b503.camel@intel.com> (raw)
In-Reply-To: <CAP-5=fUu6_gOD8=5pNc2XbWc6ueHR_FpM6XF51=mdf9L0V0X2w@mail.gmail.com>
On Tue, 2025-07-15 at 12:55 -0700, Ian Rogers wrote:
> On Fri, Jun 27, 2025 at 12:24 PM Ian Rogers <irogers@google.com> wrote:
> >
> > On hybrid systems some PMUs apply to all core types, particularly for
> > metrics the msr PMU and the tsc event. The metrics often only want the
> > values of the counter for their specific core type. These patches
> > allow the cpu term in an event to give a PMU name to take the cpumask
> > from. For example:
> >
> > $ perf stat -e msr/tsc,cpu=cpu_atom/ ...
> >
> > will aggregate the msr/tsc/ value but only for atom cores. In doing
> > this problems were identified in how cpumasks are handled by parsing
> > and event setup when cpumasks are specified along with a task to
> > profile. The event parsing, cpumask evlist propagation code and perf
> > stat code are updated accordingly.
> >
> > The final result of the patch series is to be able to run:
> > ```
> > $ perf stat --no-scale -e 'msr/tsc/,msr/tsc,cpu=cpu_core/,msr/tsc,cpu=cpu_atom/' perf test -F 10
> > 10.1: Basic parsing test : Ok
> > 10.2: Parsing without PMU name : Ok
> > 10.3: Parsing with PMU name : Ok
> >
> > Performance counter stats for 'perf test -F 10':
> >
> > 63,704,975 msr/tsc/
> > 47,060,704 msr/tsc,cpu=cpu_core/ (4.62%)
> > 16,640,591 msr/tsc,cpu=cpu_atom/ (2.18%)
> > ```
> >
> > This has (further) identified a kernel bug for task events around the
> > enabled time being too large leading to invalid scaling (hence the
> > --no-scale in the command line above).
> >
> > Ian Rogers (12):
> > perf parse-events: Warn if a cpu term is unsupported by a CPU
> > perf stat: Avoid buffer overflow to the aggregation map
> > perf stat: Don't size aggregation ids from user_requested_cpus
> > perf parse-events: Allow the cpu term to be a PMU
> > perf tool_pmu: Allow num_cpus(_online) to be specific to a cpumask
> > libperf evsel: Rename own_cpus to pmu_cpus
> > libperf evsel: Factor perf_evsel__exit out of perf_evsel__delete
> > perf evsel: Use libperf perf_evsel__exit
> > perf pmus: Factor perf_pmus__find_by_attr out of evsel__find_pmu
> > perf parse-events: Minor __add_event refactoring
> > perf evsel: Add evsel__open_per_cpu_and_thread
> > perf parse-events: Support user CPUs mixed with threads/processes
>
> Ping.
Hi Ian,
Looks good to me.
Reviewed-by: Thomas Falcon <thomas.falcon@intel.com>
Thanks,
Tom
>
> Thanks,
> Ian
>
> > tools/lib/perf/evlist.c | 118 ++++++++++++++++--------
> > tools/lib/perf/evsel.c | 9 +-
> > tools/lib/perf/include/internal/evsel.h | 3 +-
> > tools/perf/builtin-stat.c | 9 +-
> > tools/perf/tests/event_update.c | 4 +-
> > tools/perf/util/evlist.c | 15 +--
> > tools/perf/util/evsel.c | 55 +++++++++--
> > tools/perf/util/evsel.h | 5 +
> > tools/perf/util/expr.c | 2 +-
> > tools/perf/util/header.c | 4 +-
> > tools/perf/util/parse-events.c | 102 ++++++++++++++------
> > tools/perf/util/pmus.c | 29 +++---
> > tools/perf/util/pmus.h | 2 +
> > tools/perf/util/stat.c | 6 +-
> > tools/perf/util/synthetic-events.c | 4 +-
> > tools/perf/util/tool_pmu.c | 56 +++++++++--
> > tools/perf/util/tool_pmu.h | 2 +-
> > 17 files changed, 297 insertions(+), 128 deletions(-)
> >
> > --
> > 2.50.0.727.gbf7dc18ff4-goog
> >
next prev parent reply other threads:[~2025-07-16 20:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 19:24 [PATCH v1 00/12] CPU mask improvements/fixes particularly for hybrid Ian Rogers
2025-06-27 19:24 ` [PATCH v1 01/12] perf parse-events: Warn if a cpu term is unsupported by a CPU Ian Rogers
2025-06-27 19:24 ` [PATCH v1 02/12] perf stat: Avoid buffer overflow to the aggregation map Ian Rogers
2025-06-27 19:24 ` [PATCH v1 03/12] perf stat: Don't size aggregation ids from user_requested_cpus Ian Rogers
2025-06-27 19:24 ` [PATCH v1 04/12] perf parse-events: Allow the cpu term to be a PMU Ian Rogers
2025-07-16 20:09 ` Namhyung Kim
2025-07-16 20:25 ` Ian Rogers
2025-07-18 17:56 ` Namhyung Kim
2025-06-27 19:24 ` [PATCH v1 05/12] perf tool_pmu: Allow num_cpus(_online) to be specific to a cpumask Ian Rogers
2025-06-27 19:24 ` [PATCH v1 06/12] libperf evsel: Rename own_cpus to pmu_cpus Ian Rogers
2025-06-27 19:24 ` [PATCH v1 07/12] libperf evsel: Factor perf_evsel__exit out of perf_evsel__delete Ian Rogers
2025-06-27 19:24 ` [PATCH v1 08/12] perf evsel: Use libperf perf_evsel__exit Ian Rogers
2025-06-27 19:24 ` [PATCH v1 09/12] perf pmus: Factor perf_pmus__find_by_attr out of evsel__find_pmu Ian Rogers
2025-06-27 19:24 ` [PATCH v1 10/12] perf parse-events: Minor __add_event refactoring Ian Rogers
2025-06-27 19:24 ` [PATCH v1 11/12] perf evsel: Add evsel__open_per_cpu_and_thread Ian Rogers
2025-06-27 19:24 ` [PATCH v1 12/12] perf parse-events: Support user CPUs mixed with threads/processes Ian Rogers
2025-07-16 20:28 ` Namhyung Kim
2025-07-17 0:04 ` Ian Rogers
2025-07-15 19:55 ` [PATCH v1 00/12] CPU mask improvements/fixes particularly for hybrid Ian Rogers
2025-07-16 20:03 ` Falcon, Thomas [this message]
2025-07-21 16:13 ` James Clark
2025-07-21 17:44 ` 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=9c9d0fc0e37425961f539f8aac6ff09a8da8b503.camel@intel.com \
--to=thomas.falcon@intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ashelat@redhat.com \
--cc=ben.gainey@arm.com \
--cc=blakejones@google.com \
--cc=howardchu95@gmail.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jean-philippe.romain@foss.st.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux@treblig.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=quic_zhonhan@quicinc.com \
--cc=song@kernel.org \
--cc=tmricht@linux.ibm.com \
--cc=weilin.wang@intel.com \
--cc=yangyicong@hisilicon.com \
--cc=yeoreum.yun@arm.com \
/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).