linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] perf test: Fix non-bash issue with stat bpf counters
@ 2021-06-17 18:42 Ian Rogers
  2021-06-17 18:42 ` [PATCH 2/4] perf test: Pass the verbose option to shell tests Ian Rogers
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Ian Rogers @ 2021-06-17 18:42 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Song Liu, linux-perf-users, linux-kernel, bpf
  Cc: Ian Rogers

$(( .. )) is a bash feature but the test's interpreter is !/bin/sh,
switch the code to use expr.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/shell/stat_bpf_counters.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/tests/shell/stat_bpf_counters.sh b/tools/perf/tests/shell/stat_bpf_counters.sh
index 22eb31e48ca7..2f9948b3d943 100755
--- a/tools/perf/tests/shell/stat_bpf_counters.sh
+++ b/tools/perf/tests/shell/stat_bpf_counters.sh
@@ -11,9 +11,9 @@ compare_number()
        second_num=$2
 
        # upper bound is first_num * 110%
-       upper=$(( $first_num + $first_num / 10 ))
+       upper=$(expr $first_num + $first_num / 10 )
        # lower bound is first_num * 90%
-       lower=$(( $first_num - $first_num / 10 ))
+       lower=$(expr $first_num - $first_num / 10 )
 
        if [ $second_num -gt $upper ] || [ $second_num -lt $lower ]; then
                echo "The difference between $first_num and $second_num are greater than 10%."
-- 
2.32.0.288.g62a8d224e6-goog


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

end of thread, other threads:[~2021-06-21 21:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 18:42 [PATCH 1/4] perf test: Fix non-bash issue with stat bpf counters Ian Rogers
2021-06-17 18:42 ` [PATCH 2/4] perf test: Pass the verbose option to shell tests Ian Rogers
2021-06-17 19:19   ` Arnaldo Carvalho de Melo
2021-06-18 16:49     ` Arnaldo Carvalho de Melo
2021-06-19  4:45       ` Ian Rogers
2021-06-19 13:03         ` Arnaldo Carvalho de Melo
2021-06-17 18:42 ` [PATCH 3/4] perf test: Add verbose skip output for bpf counters Ian Rogers
2021-06-17 19:20   ` Arnaldo Carvalho de Melo
2021-06-17 18:42 ` [PATCH 4/4] perf test: Make stat bpf counters test more robust Ian Rogers
2021-06-17 19:21   ` Arnaldo Carvalho de Melo
2021-06-17 19:18 ` [PATCH 1/4] perf test: Fix non-bash issue with stat bpf counters Arnaldo Carvalho de Melo
2021-06-20 21:55 ` Stephen Rothwell
2021-06-21 21:30   ` Ian Rogers

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