xref: /linux/tools/tracing/rtla/tests/timerlat.t (revision 18682166f61494072d589692c57b7a32b89fc9dc)
1ab16714fSTomas Glozar#!/bin/bash
2ab16714fSTomas Glozar# SPDX-License-Identifier: GPL-2.0
3ab16714fSTomas Glozarsource tests/engine.sh
4ab16714fSTomas Glozartest_begin
5ab16714fSTomas Glozar
6ab16714fSTomas Glozarset_timeout 2m
7005682b4STomas Glozartimerlat_sample_event='/sys/kernel/tracing/events/osnoise/timerlat_sample'
8ab16714fSTomas Glozar
9005682b4STomas Glozarif ldd $RTLA | grep libbpf >/dev/null && [ -d "$timerlat_sample_event" ]
10005682b4STomas Glozarthen
11005682b4STomas Glozar	# rtla build with BPF and system supports BPF mode
12005682b4STomas Glozar	no_bpf_options='0 1'
13005682b4STomas Glozarelse
14005682b4STomas Glozar	no_bpf_options='1'
15005682b4STomas Glozarfi
16005682b4STomas Glozar
17005682b4STomas Glozar# Do every test with and without BPF
18005682b4STomas Glozarfor option in $no_bpf_options
19005682b4STomas Glozardo
20005682b4STomas Glozarexport RTLA_NO_BPF=$option
21ab16714fSTomas Glozarcheck "verify help page" \
22ab16714fSTomas Glozar	"timerlat --help"
23ab16714fSTomas Glozarcheck "verify -s/--stack" \
24*18682166SCosta Shulyupin	"timerlat top -s 3 -T 10 -t" 2
25ab16714fSTomas Glozarcheck "verify -P/--priority" \
26ab16714fSTomas Glozar	"timerlat top -P F:1 -c 0 -d 1M -q"
27ab16714fSTomas Glozarcheck "test in nanoseconds" \
28*18682166SCosta Shulyupin	"timerlat top -i 2 -c 0 -n -d 30s" 2
29ab16714fSTomas Glozarcheck "set the automatic trace mode" \
30*18682166SCosta Shulyupin	"timerlat top -a 5 --dump-tasks" 2
31ab16714fSTomas Glozarcheck "print the auto-analysis if hits the stop tracing condition" \
32*18682166SCosta Shulyupin	"timerlat top --aa-only 5" 2
33ab16714fSTomas Glozarcheck "disable auto-analysis" \
34*18682166SCosta Shulyupin	"timerlat top -s 3 -T 10 -t --no-aa" 2
35ab16714fSTomas Glozarcheck "verify -c/--cpus" \
36ab16714fSTomas Glozar	"timerlat hist -c 0 -d 30s"
37ab16714fSTomas Glozarcheck "hist test in nanoseconds" \
38*18682166SCosta Shulyupin	"timerlat hist -i 2 -c 0 -n -d 30s" 2
39005682b4STomas Glozardone
40ab16714fSTomas Glozar
41ab16714fSTomas Glozartest_end
42