From: James Clark <james.clark@linaro.org>
To: Ian Rogers <irogers@google.com>
Cc: 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>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
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: Re: [PATCH v3 00/15] Legacy hardware/cache events as json
Date: Thu, 11 Sep 2025 14:00:29 +0100 [thread overview]
Message-ID: <055e677e-2a2f-4c56-abe0-9a437dc14d69@linaro.org> (raw)
In-Reply-To: <CAP-5=fVbtL=eL5bCFzz06g86Sk3nBsxUmgwZ3c5UY7z5hwmoLA@mail.gmail.com>
On 10/09/2025 4:00 pm, Ian Rogers wrote:
> On Wed, Sep 10, 2025 at 4:14 AM James Clark <james.clark@linaro.org> wrote:
>>
>> On 28/08/2025 9:59 pm, Ian Rogers wrote:
>>> Mirroring similar work for software events in commit 6e9fa4131abb
>>> ("perf parse-events: Remove non-json software events"). These changes
>>> migrate the legacy hardware and cache events to json. With no hard
>>> coded legacy hardware or cache events the wild card, case
>>> insensitivity, etc. is consistent for events. This does, however, mean
>>> events like cycles will wild card against all PMUs. A change doing the
>>> same was originally posted and merged from:
>>> https://lore.kernel.org/r/20240416061533.921723-10-irogers@google.com
>>> and reverted by Linus in commit 4f1b067359ac ("Revert "perf
>>> parse-events: Prefer sysfs/JSON hardware events over legacy"") due to
>>> his dislike for the cycles behavior on ARM with perf record. Earlier
>>> patches in this series make perf record event opening failures
>>> non-fatal and hide the cycles event's failure to open on ARM in perf
>>> record, so it is expected the behavior will now be transparent in perf
>>> record on ARM. perf stat with a cycles event will wildcard open the
>>> event on all PMUs.
>>
>> Hi Ian,
>>
>> Briefly testing perf record and perf stat seem to work now. i.e "perf
>> record -e cycles" doesn't fail and just skips the uncore cycles event.
>> And "perf stat" now includes the uncore cycles event which I think is
>> harmless.
>
> Thanks for confirming this.
>
>> But there are a few perf test failures. For example "test event parsing":
>>
>> evlist after sorting/fixing: 'arm_cmn_0/cycles/,{cycles,cache-
>> misses,branch-misses}'
>> FAILED tests/parse-events.c:1589 wrong number of entries
>> Event test failure: test 57 '{cycles,cache-misses,branch-
>> misses}:e'running test 58 'cycles/name=name/'
>
> I suspect the easiest fix for this is to change "cycles" to the
> "cpu-cycles" legacy hardware event for this test. The test has always
> had issues on ARM due to hardcoded expectations of the core PMU being
> "cpu".
>
>> The tests "Perf time to TSC" and "Use a dummy software event to keep
>> tracking" are using libperf to open the cycles event as a sampling event
>> which now fails. It seems like we've fixed Perf record to ignore this
>> failure, but we didn't think about libperf until now.
>
> I'm not clear on the connection here. libperf doesn't do event parsing
> and so there are no changes in tools/lib/perf. If a test has an
> expectation that "cycles" is a core event, again we can change it to
> "cpu-cycles" as a workaround for ARM. As "cycles" will wildcard now,
> we don't want that behavior in say API probing as we'll end up never
> lazily processing the PMUs. That code has been altered in these
> changes to specify the core PMU. For tests it is less of an issue and
> so the changes are more limited.
>
> Thanks,
> Ian
Sure makes sense if there's an easy fix for the tests, we can do that. I
suppose the main reason I mentioned it was that the tests might be
highlighting that other genuine non-Perf and non-test users would see
the same breakage though.
next prev parent reply other threads:[~2025-09-11 13:00 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 20:59 [PATCH v3 00/15] Legacy hardware/cache events as json Ian Rogers
2025-08-28 20:59 ` [PATCH v3 01/15] perf parse-events: Fix legacy cache events if event is duplicated in a PMU Ian Rogers
2025-08-28 20:59 ` [PATCH v3 02/15] perf perf_api_probe: Avoid scanning all PMUs, try software PMU first Ian Rogers
2025-08-28 20:59 ` [PATCH v3 03/15] perf record: Skip don't fail for events that don't open Ian Rogers
2025-08-28 20:59 ` [PATCH v3 04/15] perf jevents: Support copying the source json files to OUTPUT Ian Rogers
2025-08-28 20:59 ` [PATCH v3 05/15] perf pmu: Don't eagerly parse event terms Ian Rogers
2025-08-28 20:59 ` [PATCH v3 06/15] perf parse-events: Remove unused FILE input argument to scanner Ian Rogers
2025-08-28 20:59 ` [PATCH v3 07/15] perf pmu: Use fd rather than FILE from new_alias Ian Rogers
2025-08-28 20:59 ` [PATCH v3 08/15] perf pmu: Factor term parsing into a perf_event_attr into a helper Ian Rogers
2025-08-28 20:59 ` [PATCH v3 09/15] perf parse-events: Add terms for legacy hardware and cache config values Ian Rogers
2025-08-28 20:59 ` [PATCH v3 10/15] perf jevents: Add legacy json terms and default_core event table helper Ian Rogers
2025-08-28 20:59 ` [PATCH v3 11/15] perf pmu: Add and use legacy_terms in alias information Ian Rogers
2025-08-28 20:59 ` [PATCH v3 12/15] perf jevents: Add legacy-hardware and legacy-cache json Ian Rogers
2025-08-28 20:59 ` [PATCH v3 13/15] perf print-events: Remove print_hwcache_events Ian Rogers
2025-08-28 20:59 ` [PATCH v3 14/15] perf print-events: Remove print_symbol_events Ian Rogers
2025-08-28 20:59 ` [PATCH v3 15/15] perf parse-events: Remove hard coded legacy hardware and cache parsing Ian Rogers
2025-09-03 8:06 ` [PATCH v3 00/15] Legacy hardware/cache events as json Thomas Richter
2025-09-10 11:14 ` James Clark
2025-09-10 15:00 ` Ian Rogers
2025-09-11 13:00 ` James Clark [this message]
2025-09-11 17:15 ` Ian Rogers
2025-09-10 20:10 ` Namhyung Kim
2025-09-10 21:58 ` Ian Rogers
2025-09-11 21:50 ` Namhyung Kim
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=055e677e-2a2f-4c56-abe0-9a437dc14d69@linaro.org \
--to=james.clark@linaro.org \
--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=irogers@google.com \
--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