]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtla/tests: Add runtime tests for restoring continue flag
authorTomas Glozar <tglozar@redhat.com>
Tue, 26 May 2026 10:25:23 +0000 (12:25 +0200)
committerTomas Glozar <tglozar@redhat.com>
Thu, 28 May 2026 11:02:47 +0000 (13:02 +0200)
In case an action preceding the continue action fails, not only
the continue flag should not be set, it should be unset if it was set
from a previous run of actions_perform().

Add a runtime test to both osnoise and timerlat tools that checks that
this works properly by creating a temporary file.

Link: https://lore.kernel.org/r/20260526102523.2662391-4-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
tools/tracing/rtla/tests/osnoise.t
tools/tracing/rtla/tests/timerlat.t

index 9c2f84a4187d9494f1dc01d805d1da99c572291c..a7956ab605cdfb25fbd8a88ad8a0dc1ea8c33900 100644 (file)
@@ -65,6 +65,8 @@ check "top stop at failed action" \
        "osnoise top -S 2 --on-threshold shell,command='echo -n abc; false' --on-threshold shell,command='echo -n defgh'" 2 "^abc" "defgh"
 check_top_q_hist "with continue" \
        "osnoise TOOL -S 2 -d 5s --on-threshold shell,command='echo TestOutput' --on-threshold continue" 0 "^TestOutput$"
+check_top_q_hist "with conditional continue" \
+       "osnoise TOOL -S 2 --on-threshold shell,command='if [ -f a ]; then echo 2; exit 1; else echo -n 1; touch a; fi' --on-threshold continue" 2 "^12$" "^2$"
 check_top_hist "with trace output at end" \
        "osnoise TOOL -d 1s --on-end trace" 0 "^  Saving trace to osnoise_trace.txt$"
 
index f3e5f99e862bca5a7e0b29448afabe55a30778f1..19fd5af26ebb8e38d0f1a7debedbaaad1999be5d 100644 (file)
@@ -94,6 +94,8 @@ check "top stop at failed action" \
        "timerlat top -T 2 --on-threshold shell,command='echo -n abc; false' --on-threshold shell,command='echo -n defgh'" 2 "^abc" "defgh"
 check_top_q_hist "with continue" \
        "timerlat TOOL -T 2 -d 5s --on-threshold shell,command='echo TestOutput' --on-threshold continue" 0 "^TestOutput$"
+check_top_q_hist "with conditional continue" \
+       "timerlat TOOL -T 2 --on-threshold shell,command='if [ -f a ]; then echo 2; exit 1; else echo -n 1; touch a; fi' --on-threshold continue" 2 "^12$" "^2$"
 check_top_hist "with trace output at end" \
        "timerlat TOOL -d 1s --on-end trace" 0 "^  Saving trace to timerlat_trace.txt$"