From: Ian Rogers <irogers@google.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
James Clark <james.clark@linaro.org>,
Xu Yang <xu.yang_2@nxp.com>,
Thomas Falcon <thomas.falcon@intel.com>,
Andi Kleen <ak@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
bpf@vger.kernel.org, Atish Patra <atishp@rivosinc.com>,
Beeman Strong <beeman@rivosinc.com>, Leo Yan <leo.yan@arm.com>,
Vince Weaver <vincent.weaver@maine.edu>
Subject: [PATCH v5 25/25] perf test: Switch cycles event to cpu-cycles
Date: Mon, 22 Sep 2025 21:18:44 -0700 [thread overview]
Message-ID: <20250923041844.400164-26-irogers@google.com> (raw)
In-Reply-To: <20250923041844.400164-1-irogers@google.com>
Without a PMU perf matches an event against any PMU with the
event. Unfortunately some PMU drivers advertise a "cycles" event which
is typically just a core event. As tests assume a core event, switch
to use "cpu-cycles" that avoids the overloaded "cycles" event on
troublesome PMUs and is so far not overloaded. Note, on x86 this
changes a legacy event into a sysfs one.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/tests/code-reading.c | 2 +-
tools/perf/tests/keep-tracking.c | 2 +-
tools/perf/tests/perf-time-to-tsc.c | 4 ++--
tools/perf/tests/switch-tracking.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 9c2091310191..4574a7e528ec 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -649,7 +649,7 @@ static int do_test_code_reading(bool try_kcore)
struct map *map;
bool have_vmlinux, have_kcore;
struct dso *dso;
- const char *events[] = { "cycles", "cycles:u", "cpu-clock", "cpu-clock:u", NULL };
+ const char *events[] = { "cpu-cycles", "cpu-cycles:u", "cpu-clock", "cpu-clock:u", NULL };
int evidx = 0;
struct perf_env host_env;
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index eafb49eb0b56..729cc9cc1cb7 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -90,7 +90,7 @@ static int test__keep_tracking(struct test_suite *test __maybe_unused, int subte
perf_evlist__set_maps(&evlist->core, cpus, threads);
CHECK__(parse_event(evlist, "dummy:u"));
- CHECK__(parse_event(evlist, "cycles:u"));
+ CHECK__(parse_event(evlist, "cpu-cycles:u"));
evlist__config(evlist, &opts, NULL);
diff --git a/tools/perf/tests/perf-time-to-tsc.c b/tools/perf/tests/perf-time-to-tsc.c
index d4437410c99f..cca41bd37ae3 100644
--- a/tools/perf/tests/perf-time-to-tsc.c
+++ b/tools/perf/tests/perf-time-to-tsc.c
@@ -101,11 +101,11 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su
perf_evlist__set_maps(&evlist->core, cpus, threads);
- CHECK__(parse_event(evlist, "cycles:u"));
+ CHECK__(parse_event(evlist, "cpu-cycles:u"));
evlist__config(evlist, &opts, NULL);
- /* For hybrid "cycles:u", it creates two events */
+ /* For hybrid "cpu-cycles:u", it creates two events */
evlist__for_each_entry(evlist, evsel) {
evsel->core.attr.comm = 1;
evsel->core.attr.disabled = 1;
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index 5be294014d3b..15791fcb76b2 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -332,7 +332,7 @@ static int process_events(struct evlist *evlist,
static int test__switch_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{
const char *sched_switch = "sched:sched_switch";
- const char *cycles = "cycles:u";
+ const char *cycles = "cpu-cycles:u";
struct switch_tracking switch_tracking = { .tids = NULL, };
struct record_opts opts = {
.mmap_pages = UINT_MAX,
--
2.51.0.534.gc79095c0ca-goog
prev parent reply other threads:[~2025-09-23 4:19 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 4:18 [PATCH v5 00/25] Legacy hardware/cache events as json Ian Rogers
2025-09-23 4:18 ` [PATCH v5 01/25] perf stat: Allow retry for default events Ian Rogers
2025-09-23 4:18 ` [PATCH v5 02/25] perf parse-events: Fix legacy cache events if event is duplicated in a PMU Ian Rogers
2025-09-23 4:18 ` [PATCH v5 03/25] perf perf_api_probe: Avoid scanning all PMUs, try software PMU first Ian Rogers
2025-09-23 4:18 ` [PATCH v5 04/25] perf record: Skip don't fail for events that don't open Ian Rogers
2025-09-23 4:18 ` [PATCH v5 05/25] perf jevents: Support copying the source json files to OUTPUT Ian Rogers
2025-09-23 4:18 ` [PATCH v5 06/25] perf pmu: Don't eagerly parse event terms Ian Rogers
2025-09-23 4:18 ` [PATCH v5 07/25] perf parse-events: Remove unused FILE input argument to scanner Ian Rogers
2025-09-23 4:18 ` [PATCH v5 08/25] perf pmu: Use fd rather than FILE from new_alias Ian Rogers
2025-09-23 4:18 ` [PATCH v5 09/25] perf pmu: Factor term parsing into a perf_event_attr into a helper Ian Rogers
2025-09-23 4:18 ` [PATCH v5 10/25] perf parse-events: Add terms for legacy hardware and cache config values Ian Rogers
2025-09-23 4:18 ` [PATCH v5 11/25] perf jevents: Add legacy json terms and default_core event table helper Ian Rogers
2025-09-23 4:18 ` [PATCH v5 12/25] perf pmu: Add and use legacy_terms in alias information Ian Rogers
2025-09-23 4:18 ` [PATCH v5 13/25] perf jevents: Add legacy-hardware and legacy-cache json Ian Rogers
2025-09-23 4:18 ` [PATCH v5 14/25] perf print-events: Remove print_hwcache_events Ian Rogers
2025-09-23 4:18 ` [PATCH v5 15/25] perf print-events: Remove print_symbol_events Ian Rogers
2025-09-23 4:18 ` [PATCH v5 16/25] perf parse-events: Remove hard coded legacy hardware and cache parsing Ian Rogers
2025-09-23 4:18 ` [PATCH v5 17/25] perf record: Use evlist__new_default when no events specified Ian Rogers
2025-09-23 4:18 ` [PATCH v5 18/25] perf top: " Ian Rogers
2025-09-23 4:18 ` [PATCH v5 19/25] perf evlist: Avoid scanning all PMUs for evlist__new_default Ian Rogers
2025-09-23 4:18 ` [PATCH v5 20/25] perf evsel: Improvements to __evsel__match Ian Rogers
2025-09-23 4:18 ` [PATCH v5 21/25] perf test parse-events: Use evsel__match for legacy events Ian Rogers
2025-09-23 4:18 ` [PATCH v5 22/25] perf test parse-events: Remove cpu PMU requirement Ian Rogers
2025-09-23 15:52 ` Ian Rogers
2025-09-23 4:18 ` [PATCH v5 23/25] perf test parse-events: Without a PMU use cpu-cycles rather than cycles Ian Rogers
2025-09-23 4:18 ` [PATCH v5 24/25] perf stat: Avoid wildcarding PMUs for default events Ian Rogers
2025-09-23 4:18 ` Ian Rogers [this message]
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=20250923041844.400164-26-irogers@google.com \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=atishp@rivosinc.com \
--cc=beeman@rivosinc.com \
--cc=bpf@vger.kernel.org \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=thomas.falcon@intel.com \
--cc=vincent.weaver@maine.edu \
--cc=xu.yang_2@nxp.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
all inboxes | Powered by JetHome®