From: Anubhav Shelat <ashelat@redhat.com>
To: mpetlan@redhat.com, acme@kernel.org, namhyung@kernel.org,
irogers@google.com, linux-perf-users@vger.kernel.org
Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
adrian.hunter@intel.com, kan.liang@linux.intel.com,
dapeng1.mi@linux.intel.com, james.clark@linaro.org,
Anubhav Shelat <ashelat@redhat.com>
Subject: [PATCH] Revert "perf test: Allow tolerance for leader sampling test"
Date: Thu, 23 Oct 2025 14:24:07 +0100 [thread overview]
Message-ID: <20251023132406.78359-2-ashelat@redhat.com> (raw)
This reverts commit 1c5721ca89a1c8ae71082d3a102b39fd1ec0a205.
The throttling bug has been fixed in 9734e25fbf5a perf: Fix the throttle
logic for a group. So this commit can be reverted.
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
---
tools/perf/tests/shell/record.sh | 33 ++++++--------------------------
1 file changed, 6 insertions(+), 27 deletions(-)
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
index 0f5841c479e7..13e0d6ef66c9 100755
--- a/tools/perf/tests/shell/record.sh
+++ b/tools/perf/tests/shell/record.sh
@@ -267,43 +267,22 @@ test_leader_sampling() {
err=1
return
fi
- perf script -i "${perfdata}" | grep brstack > $script_output
- # Check if the two instruction counts are equal in each record.
- # However, the throttling code doesn't consider event grouping. During throttling, only the
- # leader is stopped, causing the slave's counts significantly higher. To temporarily solve this,
- # let's set the tolerance rate to 80%.
- # TODO: Revert the code for tolerance once the throttling mechanism is fixed.
index=0
- valid_counts=0
- invalid_counts=0
- tolerance_rate=0.8
+ perf script -i "${perfdata}" | grep brstack > "${script_output}"
while IFS= read -r line
do
+ # Check if the two instruction counts are equal in each record
cycles=$(echo $line | awk '{for(i=1;i<=NF;i++) if($i=="cycles:") print $(i-1)}')
if [ $(($index%2)) -ne 0 ] && [ ${cycles}x != ${prev_cycles}x ]
then
- invalid_counts=$(($invalid_counts+1))
- else
- valid_counts=$(($valid_counts+1))
+ echo "Leader sampling [Failed inconsistent cycles count]"
+ err=1
+ return
fi
index=$(($index+1))
prev_cycles=$cycles
done < "${script_output}"
- total_counts=$(bc <<< "$invalid_counts+$valid_counts")
- if (( $(bc <<< "$total_counts <= 0") ))
- then
- echo "Leader sampling [No sample generated]"
- err=1
- return
- fi
- isok=$(bc <<< "scale=2; if (($invalid_counts/$total_counts) < (1-$tolerance_rate)) { 0 } else { 1 };")
- if [ $isok -eq 1 ]
- then
- echo "Leader sampling [Failed inconsistent cycles count]"
- err=1
- else
- echo "Basic leader sampling test [Success]"
- fi
+ echo "Basic leader sampling test [Success]"
}
test_topdown_leader_sampling() {
--
2.51.0
next reply other threads:[~2025-10-23 13:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 13:24 Anubhav Shelat [this message]
2025-10-24 8:40 ` [PATCH] Revert "perf test: Allow tolerance for leader sampling test" Thomas Richter
2025-10-24 17:21 ` Anubhav Shelat
2025-10-27 10:27 ` Thomas Richter
2025-10-28 11:30 ` James Clark
2025-10-28 12:55 ` Thomas Richter
2025-10-28 15:23 ` James Clark
2025-10-29 7:37 ` Thomas Richter
2025-10-29 9:25 ` James Clark
2025-11-11 11:22 ` Thomas Richter
2025-11-11 14:03 ` James Clark
2025-11-12 10:47 ` Thomas Richter
2025-10-30 13:52 ` Anubhav Shelat
2025-10-30 14:19 ` James Clark
2025-10-30 15:22 ` Anubhav Shelat
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=20251023132406.78359-2-ashelat@redhat.com \
--to=ashelat@redhat.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dapeng1.mi@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=mpetlan@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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).