Add support for cpu event term
From: | Ian Rogers <irogers-AT-google.com> | |
To: | Peter Zijlstra <peterz-AT-infradead.org>, Ingo Molnar <mingo-AT-redhat.com>, Arnaldo Carvalho de Melo <acme-AT-kernel.org>, Namhyung Kim <namhyung-AT-kernel.org>, Mark Rutland <mark.rutland-AT-arm.com>, Alexander Shishkin <alexander.shishkin-AT-linux.intel.com>, Jiri Olsa <jolsa-AT-kernel.org>, Ian Rogers <irogers-AT-google.com>, Adrian Hunter <adrian.hunter-AT-intel.com>, Kan Liang <kan.liang-AT-linux.intel.com>, Leo Yan <leo.yan-AT-arm.com>, James Clark <james.clark-AT-linaro.org>, Greg Kroah-Hartman <gregkh-AT-linuxfoundation.org>, Weilin Wang <weilin.wang-AT-intel.com>, Andi Kleen <ak-AT-linux.intel.com>, Dominique Martinet <asmadeus-AT-codewreck.org>, Yicong Yang <yangyicong-AT-hisilicon.com>, linux-perf-users-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org | |
Subject: | [PATCH v6 0/4] Add support for cpu event term | |
Date: | Thu, 03 Apr 2025 12:43:33 -0700 | |
Message-ID: | <20250403194337.40202-1-irogers@google.com> | |
Archive-link: | Article |
Being able to set the cpu mask per event was discussed in the context of a sysfs event.cpus file is discussed here: https://lore.kernel.org/lkml/CAP-5=fXXuWchzUK0n5KTH8kamr=... Ultimately Kan preferred to have multiple PMUs with a cpumask each rather than an event.cpus file per event. It is still useful to have the cpu event term and so the sysfs part of the original patch series is dropped. v6: Purely a rebase. v5: Purely a rebase. v4: Add the stat-display output change for zero counters Namhyung requested as part of the series: https://lore.kernel.org/lkml/Zvx9VbJWtmkcuSBs@google.com/ This skips zero values for CPUs not in the evsel's cpumask rather than the evsel's PMU's cpumask. v3: Drop sysfs event.cpus file support patch from series. Reference to using cpu to modify uncore events is dropped from the commit message. Reference counting issues on the cpumap are addressed. v2: Add support for multiple cpu terms on an event that are merged. For example, an event of "l1d-misses/cpu=4,cpu=5/" will now be opened on both CPU 4 and 5 rather than just CPU 4. Ian Rogers (4): libperf cpumap: Add ability to create CPU from a single CPU number perf stat: Use counter cpumask to skip zero values perf parse-events: Set is_pmu_core for legacy hardware events perf parse-events: Add "cpu" term to set the CPU an event is recorded on tools/lib/perf/cpumap.c | 10 +++ tools/lib/perf/include/perf/cpumap.h | 2 + tools/perf/Documentation/perf-list.txt | 9 ++ tools/perf/util/evsel_config.h | 1 + tools/perf/util/parse-events.c | 113 ++++++++++++++++++------- tools/perf/util/parse-events.h | 3 +- tools/perf/util/parse-events.l | 1 + tools/perf/util/pmu.c | 3 +- tools/perf/util/stat-display.c | 21 +++-- 9 files changed, 124 insertions(+), 39 deletions(-) -- 2.49.0.504.g3bcea36a83-goog