From: Namhyung Kim <namhyung@kernel.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>,
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>,
James Clark <james.clark@linaro.org>,
Ze Gao <zegao2021@gmail.com>, Weilin Wang <weilin.wang@intel.com>,
Dominique Martinet <asmadeus@codewreck.org>,
Jean-Philippe Romain <jean-philippe.romain@foss.st.com>,
Junhao He <hejunhao3@huawei.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, Aditya Bodkhe <Aditya.Bodkhe1@ibm.com>,
Atish Patra <atishp@rivosinc.com>, Leo Yan <leo.yan@arm.com>,
Beeman Strong <beeman@rivosinc.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH v5 4/4] perf parse-events: Reapply "Prefer sysfs/JSON hardware events over legacy"
Date: Wed, 29 Jan 2025 21:16:18 -0800 [thread overview]
Message-ID: <Z5sLIiU7D6GwpWY1@google.com> (raw)
In-Reply-To: <CAP-5=fV4Q-J+Coybk5Uw=Xpx9sm5MG=2b-fvRLX14K+ZJcmz5Q@mail.gmail.com>
On Wed, Jan 29, 2025 at 05:16:58PM -0800, Ian Rogers wrote:
> On Wed, Jan 29, 2025 at 1:55 PM Namhyung Kim <namhyung@kernel.org> wrote:
> > On Wed, Jan 15, 2025 at 01:20:32PM -0800, Ian Rogers wrote:
> > > On Wed, Jan 15, 2025 at 9:59 AM Namhyung Kim <namhyung@kernel.org> wrote:
> > > > I think the behavior should be:
> > > >
> > > > cycles -> PERF_COUNT_HW_CPU_CYCLES
> > > > cpu-cycles -> PERF_COUNT_HW_CPU_CYCLES
> > > > cpu_cycles -> no legacy -> sysfs or json
> > > > cpu/cycles/ -> sysfs or json
> > > > cpu/cpu-cycles/ -> sysfs or json
> > >
> > > So I disagree as if you add a PMU to an event name the encoding
> > > shouldn't change:
> > > 1) This historically was perf's behavior.
> >
> > Well.. I'm not sure about the history. I believe the logic I said above
> > is the historic and (I think) right behavior.
>
> You're wrong as you are describing the behavior post:
> https://lore.kernel.org/r/20231123042922.834425-1-irogers@google.com
> commit a24d9d9dc096fc0d0bd85302c9a4fe4fe3b1107b from Nov 2022, but
> somehow without legacy event fall backs which Intel added with a PMU
> for hybrid.
>
> The behavior in this patch series is best for RISC-V, presumably ARM
> (particularly for Apple M? CPUs), carries ARM and Intel's tags,
> implements the behavior Arnaldo asked for, and solves the
> inconsistency that I think is fundamentally wrong in the tool that PMU
> names shouldn't matter on an event name (an inconsistency my past
> fixes introduced). It is also part of solving other problems:
> https://lore.kernel.org/linux-perf-users/20250127-counter_delegation-v3-0-64894d7e16d5@rivosinc.com/
So you think the below behavior is preferred, right?
cycles -> cpu/cycles/ (or whatever PMU name) -> sysfs or json
And there's no way to use legacy event encodings anymore?
>
> You've not pointed at anything wrong in the scheme that these patches
> introduce, and are supported by vendors, except that it is a behavior
> change. I can, and have, pointed at many issues with your proposal
> above and the current behavior. The behavior change came about to work
> around PMU bugs over 2 years ago but only partially did so. It makes
> sense to remedy this and for the clean, consistent behavior this
> series achieves. It is unfortunate that it is a behavior change, but
> the first step for that was made 2 years ago. I think it also makes
> sense that something self described as legacy is a lower priority and
> of the past (wrt event naming moving forward).
I want to clarify the event parsing behavior and to find the right way
to deal with various cases. I haven't followed the activities in this
area closely so I missed some changes in the past. Maybe the problem
is that the behavior is complex and not clarified. Hopefully we can
write it down in a doc.
Thanks,
Namhyung
next prev parent reply other threads:[~2025-01-30 5:16 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 22:21 [PATCH v5 0/4] Prefer sysfs/JSON events also when no PMU is provided Ian Rogers
2025-01-09 22:21 ` [PATCH v5 1/4] perf evsel: Add pmu_name helper Ian Rogers
2025-01-09 22:21 ` [PATCH v5 2/4] perf stat: Fix find_stat for mixed legacy/non-legacy events Ian Rogers
2025-01-09 22:21 ` [PATCH v5 3/4] perf record: Skip don't fail for events that don't open Ian Rogers
2025-01-10 1:25 ` Namhyung Kim
2025-01-10 4:44 ` Ian Rogers
2025-01-10 18:55 ` Namhyung Kim
2025-01-10 19:18 ` Ian Rogers
2025-01-14 19:29 ` Namhyung Kim
2025-01-14 23:55 ` Ian Rogers
2025-01-15 22:14 ` Namhyung Kim
2025-01-15 22:40 ` Ian Rogers
2025-01-10 14:18 ` Arnaldo Carvalho de Melo
2025-01-10 16:42 ` Ian Rogers
2025-01-10 19:26 ` Namhyung Kim
2025-01-10 21:33 ` Ian Rogers
2025-01-13 20:51 ` Namhyung Kim
2025-01-13 23:04 ` Ian Rogers
2025-01-15 17:31 ` Namhyung Kim
2025-01-15 17:56 ` Ian Rogers
2025-01-29 21:24 ` Namhyung Kim
2025-01-09 22:21 ` [PATCH v5 4/4] perf parse-events: Reapply "Prefer sysfs/JSON hardware events over legacy" Ian Rogers
2025-01-10 19:40 ` Namhyung Kim
2025-01-10 19:52 ` Atish Kumar Patra
2025-01-13 20:56 ` Namhyung Kim
2025-01-10 22:15 ` Ian Rogers
2025-01-13 22:01 ` Namhyung Kim
2025-01-13 22:51 ` Ian Rogers
2025-01-14 2:31 ` Ian Rogers
2025-01-15 17:59 ` Namhyung Kim
2025-01-15 21:20 ` Ian Rogers
2025-01-29 21:55 ` Namhyung Kim
2025-01-30 1:16 ` Ian Rogers
2025-01-30 5:16 ` Namhyung Kim [this message]
2025-01-30 6:03 ` Ian Rogers
2025-01-31 22:28 ` Namhyung Kim
2025-01-30 6:12 ` Atish Kumar Patra
2025-01-31 22:42 ` Namhyung Kim
2025-02-01 8:45 ` Ian Rogers
2025-02-04 0:15 ` Namhyung Kim
2025-02-04 0:41 ` Ian Rogers
2025-02-05 1:57 ` Namhyung Kim
2025-02-05 4:48 ` Ian Rogers
2025-02-06 5:09 ` Namhyung Kim
2025-02-06 7:44 ` Ian Rogers
2025-02-07 4:44 ` Namhyung Kim
2025-02-07 6:15 ` Ian Rogers
2025-02-07 17:18 ` Atish Kumar Patra
2025-02-19 23:22 ` Namhyung Kim
2025-02-19 23:32 ` Ian Rogers
2025-02-03 5:47 ` Atish Kumar Patra
2025-01-29 22:05 ` [PATCH v5 0/4] Prefer sysfs/JSON events also when no PMU is provided Namhyung Kim
2025-01-30 17:46 ` 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=Z5sLIiU7D6GwpWY1@google.com \
--to=namhyung@kernel.org \
--cc=Aditya.Bodkhe1@ibm.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=asmadeus@codewreck.org \
--cc=atishp@rivosinc.com \
--cc=beeman@rivosinc.com \
--cc=bpf@vger.kernel.org \
--cc=hejunhao3@huawei.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=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=peterz@infradead.org \
--cc=weilin.wang@intel.com \
--cc=zegao2021@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.