public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: sashiko@lists.linux.dev
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] perf pmu: Skip test on Arm64 when #slots is zero
Date: Fri, 10 Apr 2026 15:09:02 +0100	[thread overview]
Message-ID: <20260410140902.GZ356832@e132581.arm.com> (raw)
In-Reply-To: <20260410112824.839EBC19421@smtp.kernel.org>

On Fri, Apr 10, 2026 at 11:28:23AM +0000, sashiko-bot@kernel.org wrote:

[...]

> > +static bool is_expected_broken_metric(const struct pmu_metric *pm)
> > +{
> > +	if (!strcmp(pm->metric_name, "M1") || !strcmp(pm->metric_name, "M2") ||
> > +	    !strcmp(pm->metric_name, "M3"))
> > +		return true;
> > +
> > +#if defined(__aarch64__)
> > +	/*
> > +	 * Arm64 platforms may return "#slots == 0", which is treated as a
> > +	 * syntax error by the parser. Don't test these metrics when running
> > +	 * on such platforms.
> > +	 */
> > +	if (strstr(pm->metric_expr, "#slots") &&
> > +	    !tool_pmu__cpu_slots_per_cycle())
> 
> Does reading host capabilities via tool_pmu__cpu_slots_per_cycle() bypass
> the fake PMU abstraction used by these tests?
> 
> The fake PMU tests are intended to validate the metric parser across all
> architectures without requiring the actual referenced PMUs or hardware
> capabilities to exist on the host machine.
> 
> Because tool_pmu__cpu_slots_per_cycle() checks the host's
> /sys/bus/event_source/devices/ caps/slots, does this break the test's
> hardware-independent validation?

I agreed that the test is designed for hardware-independent, however,
the low level's parser has already invoked
tool_pmu__cpu_slots_per_cycle() for event parsing, even with the fake
PMU.

[...]

> > @@ -852,8 +873,7 @@ static int test__parsing_callback(const struct pmu_metric *pm,
> >  
> >  	err = metricgroup__parse_groups_test(evlist, table, pm->metric_name);
> >  	if (err) {
> > -		if (!strcmp(pm->metric_name, "M1") || !strcmp(pm->metric_name, "M2") ||
> > -		    !strcmp(pm->metric_name, "M3")) {
> > +		if (is_expected_broken_metric(pm)) {
> >  			(*failures)--;
> >  			pr_debug("Expected broken metric %s skipping\n", pm->metric_name);
> >  			err = 0;
> 
> Does unconditionally clearing the error here create a testing blind spot
> for genuine syntax errors?
> 
> If a metric expression contains "#slots" on an Arm64 host without slot
> support, the failure is ignored entirely. Could this silently hide other
> issues, like typos in other events or malformed operators within the same
> metric expression?

The test will run on PMUs that support #slots, so any malformed metric
expressions can be detected.  Simply say, if a metric is applicable to
a platform, it will be verified on that platform.

I don't think I need any update on this patch.

      reply	other threads:[~2026-04-10 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 11:13 [PATCH v2] perf pmu: Skip test on Arm64 when #slots is zero Leo Yan
2026-04-10 11:28 ` sashiko-bot
2026-04-10 14:09   ` Leo Yan [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=20260410140902.GZ356832@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko@lists.linux.dev \
    /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