Skip to content

Commit 6a1700b

Browse files
rtla/tests: Add runtime tests for restoring continue flag
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>
1 parent ad5b50a commit 6a1700b

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

tools/tracing/rtla/tests/osnoise.t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ check "top stop at failed action" \
6565
"osnoise top -S 2 --on-threshold shell,command='echo -n abc; false' --on-threshold shell,command='echo -n defgh'" 2 "^abc" "defgh"
6666
check_top_q_hist "with continue" \
6767
"osnoise TOOL -S 2 -d 5s --on-threshold shell,command='echo TestOutput' --on-threshold continue" 0 "^TestOutput$"
68+
check_top_q_hist "with conditional continue" \
69+
"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$"
6870
check_top_hist "with trace output at end" \
6971
"osnoise TOOL -d 1s --on-end trace" 0 "^ Saving trace to osnoise_trace.txt$"
7072

tools/tracing/rtla/tests/timerlat.t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ check "top stop at failed action" \
9494
"timerlat top -T 2 --on-threshold shell,command='echo -n abc; false' --on-threshold shell,command='echo -n defgh'" 2 "^abc" "defgh"
9595
check_top_q_hist "with continue" \
9696
"timerlat TOOL -T 2 -d 5s --on-threshold shell,command='echo TestOutput' --on-threshold continue" 0 "^TestOutput$"
97+
check_top_q_hist "with conditional continue" \
98+
"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$"
9799
check_top_hist "with trace output at end" \
98100
"timerlat TOOL -d 1s --on-end trace" 0 "^ Saving trace to timerlat_trace.txt$"
99101

0 commit comments

Comments
 (0)