From: "Mi, Dapeng" <dapeng1.mi@linux.intel.com>
To: sashiko@lists.linux.dev
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf tests: Add auto counter reload (ACR) sampling test
Date: Tue, 14 Apr 2026 11:15:10 +0800 [thread overview]
Message-ID: <9f634c87-ca72-4b31-8001-3d0fad4e884b@linux.intel.com> (raw)
In-Reply-To: <20260413012636.EE18BC19424@smtp.kernel.org>
On 4/13/2026 9:26 AM, sashiko-bot@kernel.org wrote:
> Sashiko AI review found 1 potential issue(s):
> - [Medium] The test fails to genuinely verify that self-reloaded events do not generate records because the chosen sample periods and workload ensure the self-reloaded event never actually overflows.
> --
>
> commit 5e7a7e069f4c078327e3d8166d7f74d9084ec8a4
> Author: Dapeng Mi <dapeng1.mi@linux.intel.com>
>
> perf tests: Add auto counter reload (ACR) sampling test
>
> This commit adds an auto counter reload sampling test to verify that the
> intended event records can be captured and 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..1068843282f51 100755
>> --- a/tools/perf/tests/shell/record.sh
>> +++ b/tools/perf/tests/shell/record.sh
> [ ... ]
>> @@ -402,6 +402,47 @@ test_callgraph() {
>> echo "Callgraph test [Success]"
>> }
>>
>> +test_acr_sampling() {
>> + events="{instructions/period=20000,acr_mask=0x2/u,cycles/period=40000,acr_mask=0x3/u}"
>> + pebs_events="{instructions/period=20000,acr_mask=0x2/pu,cycles/period=40000,acr_mask=0x3/u}"
> Does this test configuration actually verify that self-reloaded events do not
> generate records?
>
> The test runs the thloop workload, which is a tight CPU loop with an inherently
> high IPC (typically > 0.5). With periods of 20000 for instructions and 40000
> for cycles, the instructions event will always overflow first.
Hmm, makes sense. I would check the IPC of the thloop workload. Suppose
setting periods of both instructions and cycles to 20000 (IPC=1) could be a
better choice.
Thanks.
>
> When the instructions event overflows, its acr_mask=0x2 triggers an auto-reload
> of the cycles counter, resetting its progress toward overflow.
>
> Because it is continually reset by the instructions event before reaching
> 40000, the cycles counter never overflows.
>
> The test asserts that no records are generated for cycles and passes, but is
> this simply because the event never fired rather than due to self-reloaded PMI
> suppression working correctly?
>
> If the hardware PMI suppression for self-reloaded events was broken, wouldn't
> this test still pass?
>
> Additionally, if the test ran on a system with IPC < 0.5, wouldn't the cycles
> event overflow first, resetting both itself and instructions (acr_mask=0x3)?
> This would prevent instructions from generating a record, causing the test
> to fail.
>
next prev parent reply other threads:[~2026-04-14 3:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 1:09 [PATCH] perf tests: Add auto counter reload (ACR) sampling test Dapeng Mi
2026-04-13 1:26 ` sashiko-bot
2026-04-14 3:15 ` Mi, Dapeng [this message]
2026-04-13 1:30 ` Ian Rogers
2026-04-13 1:35 ` Mi, Dapeng
2026-04-15 9:19 ` Mi, Dapeng
2026-04-15 17:13 ` Ian Rogers
2026-04-16 3:06 ` Mi, Dapeng
2026-04-16 3:17 ` Ian Rogers
2026-04-16 3:25 ` Mi, Dapeng
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=9f634c87-ca72-4b31-8001-3d0fad4e884b@linux.intel.com \
--to=dapeng1.mi@linux.intel.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