From: Tomas Glozar Date: Thu, 23 Apr 2026 13:05:55 +0000 (+0200) Subject: rtla/tests: Cover all hist options in runtime tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=287ff55afe0d9c3186083945f46613597bdac992;p=thirdparty%2Fkernel%2Flinux.git rtla/tests: Cover all hist options in runtime tests 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 Link: https://lore.kernel.org/r/20260423130558.882022-7-tglozar@redhat.com Signed-off-by: Tomas Glozar --- diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/osnoise.t index 5edffb23981b2..773a46e2dc5f8 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -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. diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests/timerlat.t index 28c01d8b299d4..a14d9ec32edee 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -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$"