]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtla/tests: Cover all hist options in runtime tests
authorTomas Glozar <tglozar@redhat.com>
Thu, 23 Apr 2026 13:05:55 +0000 (15:05 +0200)
committerTomas Glozar <tglozar@redhat.com>
Mon, 18 May 2026 09:00:52 +0000 (11:00 +0200)
Cover all options regarding histogram formatting for both
rtla-osnoise-hist and rtla-timerlat-hist tools. All options also have
output checking using positive or negative match, except for
-b/--bucket-size and -E/--entries, which cannot be tested in isolated
due to the output depending on the actual data collected.

Old -E/--entries test for rtla-osnoise was replaced with a new one
equivalent to the timerlat one.

Reviewed-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260423130558.882022-7-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
tools/tracing/rtla/tests/osnoise.t
tools/tracing/rtla/tests/timerlat.t

index 5edffb23981b28140d5fcae012b223c56d5b3074..773a46e2dc5f811c4b034dd5420bc66670388923 100644 (file)
@@ -16,11 +16,25 @@ check_top_q_hist "verify the --stop/-s param" \
        "osnoise TOOL -s 30 -T 1" 2 "osnoise hit stop tracing"
 check_top_q_hist "verify the --trace param" \
        "osnoise TOOL -s 30 -T 1 -t" 2 "Saving trace to osnoise_trace.txt"
-check "verify the --entries/-E param" \
-       "osnoise hist -P F:1 -c 0 -r 900000 -d 10s -b 10 -E 25"
 check_top_q_hist "verify the -c/--cpus param" \
        "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,command=tests/scripts/check-cpus.sh" 2 "^Affinity of threads: 0$"
 
+# Histogram tests
+check "hist with -b/--bucket-size" \
+       "osnoise hist -b 1 -d 1s"
+check "hist with -E/--entries" \
+       "osnoise hist -E 10 -d 1s"
+check "hist with -E/--entries out of range" \
+       "osnoise hist -E 1 -d 1s" 1 "^Entries must be > 10 and < 9999999$"
+check "hist with --no-header" \
+       "osnoise hist --no-header -d 1s" 0 "" "RTLA osnoise histogram"
+check "hist with --with-zeros" \
+       "osnoise hist --with-zeros -b 100000 -E 21 -d 1s" 0 '^2000000\s+0\s+'
+check "hist with --no-index" \
+       "osnoise hist --no-index --with-zeros -d 1s" 0 "" "^count:"
+check "hist with --no-summary" \
+       "osnoise hist --no-summary -d 1s" 0 "" "^count:"
+
 # Test setting default period by putting an absurdly high period
 # and stopping on threshold.
 # If default period is not set, this will time out.
index 28c01d8b299d4328c17e121999dc2f14ad9a1209..a14d9ec32edee20b364e28ac0106b64cac8c08ff 100644 (file)
@@ -44,6 +44,26 @@ check_top_hist "disable auto-analysis" \
 check_top_q_hist "verify -c/--cpus" \
        "timerlat TOOL -c 0 -d 10s -T 1 --on-threshold shell,command=tests/scripts/check-cpus.sh" 2 "^Affinity of threads: 0$"
 
+# Histogram tests
+check "hist with -b/--bucket-size" \
+       "timerlat hist -b 1 -d 1s"
+check "hist with -E/--entries" \
+       "timerlat hist -E 10 -d 1s"
+check "hist with -E/--entries out of range" \
+       "timerlat hist -E 1 -d 1s" 1 "^Entries must be > 10 and < 9999999$"
+check "hist with --no-header" \
+       "timerlat hist --no-header -d 1s" 0 "" "RTLA timerlat histogram"
+check "hist with --with-zeros" \
+       "timerlat hist --with-zeros -b 100000 -E 21 -d 1s" 0 '^2000000\s+0\s+'
+check "hist with --no-index" \
+       "timerlat hist --no-index --with-zeros -d 1s" 0 "" "^count:"
+check "hist with --no-summary" \
+       "timerlat hist --no-summary -d 1s" 0 "" "^ALL:"
+check "hist with --no-irq" \
+       "timerlat hist --no-irq -d 1s" 0 "" "IRQ-"
+check "hist with --no-thread" \
+       "timerlat hist --no-thread -d 1s" 0 "" "Thr-"
+
 # Actions tests
 check_top_q_hist "trace output through -t" \
        "timerlat TOOL -T 2 -t" 2 "^  Saving trace to timerlat_trace.txt$"