linux-yocto/tools/tracing/rtla/tests/osnoise.t
Tomas Glozar a86150f310 rtla/tests: Test setting default options
Add function to test engine to test with pre-set osnoise options, and
use it to test whether osnoise period (as an example) is set correctly.

The test works by pre-setting a high period of 10 minutes and stop on
threshold. Thus, it is easy to check whether rtla is properly resetting
the period to default: if it is, the test will complete on time, since
the first sample will overflow the threshold. If not, it will time out.

Cc: Luis Goncalves <lgoncalv@redhat.com>
Link: https://lore.kernel.org/20250320092500.101385-7-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Reviewed-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2025-03-26 10:36:39 -04:00

26 lines
708 B
Bash

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
source tests/engine.sh
test_begin
set_timeout 2m
check "verify help page" \
"osnoise --help"
check "verify the --priority/-P param" \
"osnoise top -P F:1 -c 0 -r 900000 -d 1M -q"
check "verify the --stop/-s param" \
"osnoise top -s 30 -T 1 -t"
check "verify the --trace param" \
"osnoise hist -s 30 -T 1 -t"
check "verify the --entries/-E param" \
"osnoise hist -P F:1 -c 0 -r 900000 -d 1M -b 10 -E 25"
# Test setting default period by putting an absurdly high period
# and stopping on threshold.
# If default period is not set, this will time out.
check_with_osnoise_options "apply default period" \
"osnoise hist -s 1" period_us=600000000
test_end