1818for option in $no_bpf_options
1919do
2020export RTLA_NO_BPF=$option
21+
22+ # Basic tests
2123check " verify help page" \
2224 " timerlat --help"
2325check " verify -s/--stack" \
@@ -36,6 +38,32 @@ check "verify -c/--cpus" \
3638 " timerlat hist -c 0 -d 30s"
3739check " hist test in nanoseconds" \
3840 " timerlat hist -i 2 -c 0 -n -d 30s" 2
41+
42+ # Actions tests
43+ check " trace output through -t" \
44+ " timerlat hist -T 2 -t" 2 " ^ Saving trace to timerlat_trace.txt$"
45+ check " trace output through -t with custom filename" \
46+ " timerlat hist -T 2 -t custom_filename.txt" 2 " ^ Saving trace to custom_filename.txt$"
47+ check " trace output through -A trace" \
48+ " timerlat hist -T 2 --on-threshold trace" 2 " ^ Saving trace to timerlat_trace.txt$"
49+ check " trace output through -A trace with custom filename" \
50+ " timerlat hist -T 2 --on-threshold trace,file=custom_filename.txt" 2 " ^ Saving trace to custom_filename.txt$"
51+ check " exec command" \
52+ " timerlat hist -T 2 --on-threshold shell,command='echo TestOutput'" 2 " ^TestOutput$"
53+ check " multiple actions" \
54+ " timerlat hist -T 2 --on-threshold shell,command='echo -n 1' --on-threshold shell,command='echo 2'" 2 " ^12$"
55+ check " hist stop at failed action" \
56+ " timerlat hist -T 2 --on-threshold shell,command='echo -n 1; false' --on-threshold shell,command='echo -n 2'" 2 " ^1# RTLA timerlat histogram$"
57+ check " top stop at failed action" \
58+ " timerlat top -T 2 --on-threshold shell,command='echo -n 1; false' --on-threshold shell,command='echo -n 2'" 2 " ^1ALL"
59+ check " hist with continue" \
60+ " timerlat hist -T 2 -d 1s --on-threshold shell,command='echo TestOutput' --on-threshold continue" 0 " ^TestOutput$"
61+ check " top with continue" \
62+ " timerlat top -q -T 2 -d 1s --on-threshold shell,command='echo TestOutput' --on-threshold continue" 0 " ^TestOutput$"
63+ check " hist with trace output at end" \
64+ " timerlat hist -d 1s --on-end trace" 0 " ^ Saving trace to timerlat_trace.txt$"
65+ check " top with trace output at end" \
66+ " timerlat top -d 1s --on-end trace" 0 " ^ Saving trace to timerlat_trace.txt$"
3967done
4068
4169test_end
0 commit comments