Skip to content

Commit 005682b

Browse files
lenticularis39rostedt
authored andcommitted
rtla/timerlat: Test BPF mode
Using the RTLA_NO_BPF environmental variable, execute rtla-timerlat tests both with and without BPF support to cover both paths. If rtla is built without BPF or the osnoise:timerlat_sample trace event is not available, test only the non-BPF path. Cc: John Kacur <[email protected]> Cc: Luis Goncalves <[email protected]> Cc: Gabriele Monaco <[email protected]> Cc: Clark Williams <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Tomas Glozar <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 9a82a3f commit 005682b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tools/tracing/rtla/tests/timerlat.t

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@ source tests/engine.sh
44
test_begin
55

66
set_timeout 2m
7+
timerlat_sample_event='/sys/kernel/tracing/events/osnoise/timerlat_sample'
78

9+
if ldd $RTLA | grep libbpf >/dev/null && [ -d "$timerlat_sample_event" ]
10+
then
11+
# rtla build with BPF and system supports BPF mode
12+
no_bpf_options='0 1'
13+
else
14+
no_bpf_options='1'
15+
fi
16+
17+
# Do every test with and without BPF
18+
for option in $no_bpf_options
19+
do
20+
export RTLA_NO_BPF=$option
821
check "verify help page" \
922
"timerlat --help"
1023
check "verify -s/--stack" \
@@ -23,5 +36,6 @@ check "verify -c/--cpus" \
2336
"timerlat hist -c 0 -d 30s"
2437
check "hist test in nanoseconds" \
2538
"timerlat hist -i 2 -c 0 -n -d 30s"
39+
done
2640

2741
test_end

0 commit comments

Comments
 (0)