]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf tests stat: Add "--null" coverage
authorIan Rogers <irogers@google.com>
Wed, 3 Dec 2025 21:47:03 +0000 (13:47 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 4 Dec 2025 08:36:14 +0000 (00:36 -0800)
Ensure "--null" does a minimal run.

Reported-by: Ingo Molnar <mingo@kernel.org>
Closes: https://lore.kernel.org/linux-perf-users/aSwt7yzFjVJCEmVp@gmail.com/
Tested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/tests/shell/stat.sh

index 985adc02749e2ce997e509b9bba5e03c999a2abf..7885e875caf4b7b3f86dfd13a0e43a59547e1a5d 100755 (executable)
@@ -16,6 +16,17 @@ test_default_stat() {
   echo "Basic stat command test [Success]"
 }
 
+test_null_stat() {
+  echo "Null stat command test"
+  if ! perf stat --null true 2>&1 | grep -E -q "Performance counter stats for 'true':"
+  then
+    echo "Null stat command test [Failed]"
+    err=1
+    return
+  fi
+  echo "Null stat command test [Success]"
+}
+
 test_stat_record_report() {
   echo "stat record and report test"
   if ! perf stat record -e task-clock -o - true | perf stat report -i - 2>&1 | \
@@ -212,6 +223,7 @@ test_hybrid() {
 }
 
 test_default_stat
+test_null_stat
 test_stat_record_report
 test_stat_record_script
 test_stat_repeat_weak_groups