mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 10:07:52 +00:00
rtla/tests: Add tests for actions
Add a bunch of tests covering most of both --on-threshold and --on-end. Parts sensitive to implementation of hist/top are tested for both. Cc: John Kacur <[email protected]> Cc: Luis Goncalves <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Chang Yin <[email protected]> Cc: Costa Shulyupin <[email protected]> Cc: Crystal Wood <[email protected]> Cc: Gabriele Monaco <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Tomas Glozar <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
This commit is contained in:
committed by
Steven Rostedt (Google)
parent
916a9c5b03
commit
4e26f84abf
@@ -18,6 +18,8 @@ fi
|
||||
for option in $no_bpf_options
|
||||
do
|
||||
export RTLA_NO_BPF=$option
|
||||
|
||||
# Basic tests
|
||||
check "verify help page" \
|
||||
"timerlat --help"
|
||||
check "verify -s/--stack" \
|
||||
@@ -36,6 +38,32 @@ check "verify -c/--cpus" \
|
||||
"timerlat hist -c 0 -d 30s"
|
||||
check "hist test in nanoseconds" \
|
||||
"timerlat hist -i 2 -c 0 -n -d 30s" 2
|
||||
|
||||
# Actions tests
|
||||
check "trace output through -t" \
|
||||
"timerlat hist -T 2 -t" 2 "^ Saving trace to timerlat_trace.txt$"
|
||||
check "trace output through -t with custom filename" \
|
||||
"timerlat hist -T 2 -t custom_filename.txt" 2 "^ Saving trace to custom_filename.txt$"
|
||||
check "trace output through -A trace" \
|
||||
"timerlat hist -T 2 --on-threshold trace" 2 "^ Saving trace to timerlat_trace.txt$"
|
||||
check "trace output through -A trace with custom filename" \
|
||||
"timerlat hist -T 2 --on-threshold trace,file=custom_filename.txt" 2 "^ Saving trace to custom_filename.txt$"
|
||||
check "exec command" \
|
||||
"timerlat hist -T 2 --on-threshold shell,command='echo TestOutput'" 2 "^TestOutput$"
|
||||
check "multiple actions" \
|
||||
"timerlat hist -T 2 --on-threshold shell,command='echo -n 1' --on-threshold shell,command='echo 2'" 2 "^12$"
|
||||
check "hist stop at failed action" \
|
||||
"timerlat hist -T 2 --on-threshold shell,command='echo -n 1; false' --on-threshold shell,command='echo -n 2'" 2 "^1# RTLA timerlat histogram$"
|
||||
check "top stop at failed action" \
|
||||
"timerlat top -T 2 --on-threshold shell,command='echo -n 1; false' --on-threshold shell,command='echo -n 2'" 2 "^1ALL"
|
||||
check "hist with continue" \
|
||||
"timerlat hist -T 2 -d 1s --on-threshold shell,command='echo TestOutput' --on-threshold continue" 0 "^TestOutput$"
|
||||
check "top with continue" \
|
||||
"timerlat top -q -T 2 -d 1s --on-threshold shell,command='echo TestOutput' --on-threshold continue" 0 "^TestOutput$"
|
||||
check "hist with trace output at end" \
|
||||
"timerlat hist -d 1s --on-end trace" 0 "^ Saving trace to timerlat_trace.txt$"
|
||||
check "top with trace output at end" \
|
||||
"timerlat top -d 1s --on-end trace" 0 "^ Saving trace to timerlat_trace.txt$"
|
||||
done
|
||||
|
||||
test_end
|
||||
|
||||
Reference in New Issue
Block a user