linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "perf test: Allow tolerance for leader sampling test"
@ 2025-10-23 13:24 Anubhav Shelat
  2025-10-24  8:40 ` Thomas Richter
  0 siblings, 1 reply; 15+ messages in thread
From: Anubhav Shelat @ 2025-10-23 13:24 UTC (permalink / raw)
  To: mpetlan, acme, namhyung, irogers, linux-perf-users
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa,
	adrian.hunter, kan.liang, dapeng1.mi, james.clark, Anubhav Shelat

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


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-11-12 10:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23 13:24 [PATCH] Revert "perf test: Allow tolerance for leader sampling test" Anubhav Shelat
2025-10-24  8:40 ` 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

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).