From: Andi Kleen <ak@linux.intel.com>
To: Artem Savkov <asavkov@redhat.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/2] perf script: Fix perf script -F +metric
Date: Mon, 1 Jul 2024 09:54:21 -0700 [thread overview]
Message-ID: <ZoLfPV5-H1HQxgCj@tassilo> (raw)
In-Reply-To: <20240701070438.GA12242@alecto.usersys.redhat.com>
On Mon, Jul 01, 2024 at 09:04:38AM +0200, Artem Savkov wrote:
> On Fri, Jun 28, 2024 at 12:19:59PM -0700, Andi Kleen wrote:
> > > This works, however there seems to be yet another issue on
> > > perf-tools-next branch that breaks script metrics.
> > >
> > > 617824a7f0f73 (perf parse-events: Prefer sysfs/JSON hardware
> > > events over legacy, 2024-04-15) changes event priority so on
> > > my host "instructions" have type PERF_TYPE_RAW instead of
> > > PERF_TYPE_HARDWARE.
> >
> > FWIW I don't see this on my build on Intel, even with that commit.
> >
> > > This results in evsel__stat_type no longer recognizing these as
> > > STAT_INSTRUCTIONS.
> >
> > I guess we could just fix evsel__stat_type to handle that case
> >
> > Does this patch work?
>
> It does for this specific example, but there are other events as well.
> From arch/x86/events/intel/core.c:
>
> static u64 intel_perfmon_event_map[PERF_COUNT_HW_MAX] __read_mostly =
> {
> [PERF_COUNT_HW_CPU_CYCLES] = 0x003c,
> [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
> [PERF_COUNT_HW_CACHE_REFERENCES] = 0x4f2e,
> [PERF_COUNT_HW_CACHE_MISSES] = 0x412e,
> [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
> [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
> [PERF_COUNT_HW_BUS_CYCLES] = 0x013c,
> [PERF_COUNT_HW_REF_CPU_CYCLES] = 0x0300, /* pseudo-encoding */
> };
>
> The list is probably different on other arches.
Most of them only use the fallback "xxx per second" metric, which
should work even for raw I think. But yes some would be needed
(like cache and branches)
Probably it needs a more generic solution then, it was somewhat
of a hack anyways.
My proposal would be to revert the original patch. Clearly
it was a bad idea.
-Andi
next prev parent reply other threads:[~2024-07-01 16:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 0:42 [PATCH 1/2] perf script: Fix perf script -F +metric Andi Kleen
2024-06-25 0:42 ` [PATCH 2/2] Add a test case for " Andi Kleen
2024-06-27 22:54 ` Namhyung Kim
2024-06-26 9:09 ` [PATCH 1/2] perf script: Fix " Artem Savkov
2024-06-27 22:50 ` Namhyung Kim
2024-06-28 19:19 ` Andi Kleen
2024-07-01 7:04 ` Artem Savkov
2024-07-01 16:54 ` Andi Kleen [this message]
2024-06-27 22: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=ZoLfPV5-H1HQxgCj@tassilo \
--to=ak@linux.intel.com \
--cc=asavkov@redhat.com \
--cc=linux-perf-users@vger.kernel.org \
/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).