Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dapeng Mi" <dapeng1.mi@linux.intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [Patch v4] perf tests: Add auto counter reload (ACR) sampling test
Date: Wed, 24 Jun 2026 09:47:23 +0000	[thread overview]
Message-ID: <20260624094723.C78D71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260624093316.1439582-1-dapeng1.mi@linux.intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Test `test_acr_sampling` is flaky because it structurally relies on the `thloop` workload sustaining an IPC > 2.0.
--

commit 8d4447d6783576282b44d2b951b516b17d5c46b1
Author: Dapeng Mi <dapeng1.mi@linux.intel.com>

perf tests: Add auto counter reload (ACR) sampling test

This commit adds a new sampling test to verify that the intended event records
can be captured and that self-reloaded events do not generate any records.

> diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
> index 7cb81cf3444a7..5819f11ad3a90 100755
> --- a/tools/perf/tests/shell/record.sh
> +++ b/tools/perf/tests/shell/record.sh

[ ... ]

> @@ -402,6 +402,48 @@ test_callgraph() {
>    echo "Callgraph test [Success]"
>  }
>  
> +test_acr_sampling() {
> +  events="{instructions/period=40000,acr_mask=0x2/u,cycles/period=20000,acr_mask=0x3/u}"
> +  pebs_events="{instructions/period=40000,acr_mask=0x2/pu,cycles/period=20000,acr_mask=0x3/u}"

[Severity: Medium]
Does this test configuration require the workload to sustain an IPC greater
than 2.0 to pass?

With acr_mask=0x3 on the cycles event, if cycles reaches 20000 before
instructions reaches 40000, both counters will automatically reload and no
samples will be generated.

> +  echo "Auto counter reload (ACR) sampling test"
> +  if ! perf record -o "${perfdata}" -e "${events}" ${testprog} 2> /dev/null
> +  then
> +    echo "Auto counter reload sampling [Skipped not supported]"
> +    return
> +  fi
> +  if ! perf script -i "${perfdata}" -F event | grep -q "instructions"

If the actual IPC drops to 2.0 or lower (which might happen due to SMT
contention, execution on E-cores, or cache effects), the cycles event will
repeatedly overflow first.  This means zero samples will be recorded, and
the grep check here will fail.

Should the event periods be adjusted to tolerate lower IPC values?

> +  then
> +    echo "Auto counter reload sampling [Failed missing instructions event]"
> +    err=1
> +    return
> +  fi

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260624093316.1439582-1-dapeng1.mi@linux.intel.com?part=1

      reply	other threads:[~2026-06-24  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24  9:33 [Patch v4] perf tests: Add auto counter reload (ACR) sampling test Dapeng Mi
2026-06-24  9:47 ` sashiko-bot [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=20260624094723.C78D71F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@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