linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PING PATCH] perf test: raise limit to 20 percent for perf_stat_--bpf-counters_test
@ 2024-01-08  8:40 Thomas Richter
  2024-01-22 20:35 ` Namhyung Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Richter @ 2024-01-08  8:40 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, namhyung, acme
  Cc: svens, gor, sumanthk, hca, Thomas Richter

This test case often fails on s390 (about 2 out of 10) because the
10% percent limit on the difference between --bpf-counters event counting
and s390 hardware counting is more than 10% in all failure cases.
Raise the limit to 20% on s390 and the test case succeeds.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/shell/stat_bpf_counters.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/shell/stat_bpf_counters.sh b/tools/perf/tests/shell/stat_bpf_counters.sh
index a87bb2814b4c..2d9209874774 100755
--- a/tools/perf/tests/shell/stat_bpf_counters.sh
+++ b/tools/perf/tests/shell/stat_bpf_counters.sh
@@ -4,19 +4,19 @@
 
 set -e
 
-# check whether $2 is within +/- 10% of $1
+# check whether $2 is within +/- 20% of $1
 compare_number()
 {
        first_num=$1
        second_num=$2
 
-       # upper bound is first_num * 110%
-       upper=$(expr $first_num + $first_num / 10 )
-       # lower bound is first_num * 90%
-       lower=$(expr $first_num - $first_num / 10 )
+       # upper bound is first_num * 120%
+       upper=$(expr $first_num + $first_num / 5 )
+       # lower bound is first_num * 80%
+       lower=$(expr $first_num - $first_num / 5 )
 
        if [ $second_num -gt $upper ] || [ $second_num -lt $lower ]; then
-               echo "The difference between $first_num and $second_num are greater than 10%."
+               echo "The difference between $first_num and $second_num are greater than 20%."
                exit 1
        fi
 }
-- 
2.43.0


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

* Re: [PING PATCH] perf test: raise limit to 20 percent for perf_stat_--bpf-counters_test
  2024-01-08  8:40 [PING PATCH] perf test: raise limit to 20 percent for perf_stat_--bpf-counters_test Thomas Richter
@ 2024-01-22 20:35 ` Namhyung Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2024-01-22 20:35 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, Thomas Richter, acme, acme
  Cc: hca, svens, gor, sumanthk

On Mon, 8 Jan 2024 09:40:09 +0100, Thomas Richter wrote:
> This test case often fails on s390 (about 2 out of 10) because the
> 10% percent limit on the difference between --bpf-counters event counting
> and s390 hardware counting is more than 10% in all failure cases.
> Raise the limit to 20% on s390 and the test case succeeds.
> 
> 

Applied to perf-tools-next, thanks!

Thanks,
Namhyung

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

end of thread, other threads:[~2024-01-22 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-08  8:40 [PING PATCH] perf test: raise limit to 20 percent for perf_stat_--bpf-counters_test Thomas Richter
2024-01-22 20:35 ` Namhyung Kim

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