lkml.org 
[lkml]   [2022]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] perf test: Skip for paranoid 3
From
Add skip tests for paranoid level being 3.
Rather than skipping lines starting "Failed", skip lines containing
"failed" - making the behavior consistent with the previous python
version.

Fixes: ec906102e5b7 ("perf test: Fix "perf stat CSV output linter" test on s390")
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/tests/shell/stat+csv_output.sh | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/tools/perf/tests/shell/stat+csv_output.sh b/tools/perf/tests/shell/stat+csv_output.sh
index 38c26f3ef4c1..b165c81fccb4 100755
--- a/tools/perf/tests/shell/stat+csv_output.sh
+++ b/tools/perf/tests/shell/stat+csv_output.sh
@@ -26,9 +26,8 @@ function commachecker()

while read line
do
- # Check for lines beginning with Failed
- x=${line:0:6}
- [ "$x" = "Failed" ] && continue
+ # Skip lines containing failed.
+ (echo "$line" | grep -q "failed") && continue

# Count the number of commas
x=$(echo $line | tr -d -c ',')
@@ -51,6 +50,11 @@ function ParanoidAndNotRoot()
check_no_args()
{
echo -n "Checking CSV output: no args "
+ if ParanoidAndNotRoot 2
+ then
+ echo "[Skip] paranoid and not root"
+ return
+ fi
perf stat -x, true 2>&1 | commachecker --no-args
echo "[Success]"
}
@@ -83,6 +87,11 @@ check_system_wide_no_aggr()
check_interval()
{
echo -n "Checking CSV output: interval "
+ if ParanoidAndNotRoot 2
+ then
+ echo "[Skip] paranoid and not root"
+ return
+ fi
perf stat -x, -I 1000 true 2>&1 | commachecker --interval
echo "[Success]"
}
@@ -91,6 +100,11 @@ check_interval()
check_event()
{
echo -n "Checking CSV output: event "
+ if ParanoidAndNotRoot 2
+ then
+ echo "[Skip] paranoid and not root"
+ return
+ fi
perf stat -x, -e cpu-clock true 2>&1 | commachecker --event
echo "[Success]"
}
--
2.37.0.rc0.161.g10f37bed90-goog
\
 
 \ /
  Last update: 2022-06-29 05:42    [W:0.080 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site