mirror of
https://github.com/torvalds/linux.git
synced 2026-05-02 21:42:42 -04:00
Add a series of tests to validate the RV tracefs API and basic
functionality.
* available monitors:
Check that all monitors (from the monitors folder) appear as
available and have a description. Works with nested monitors.
* enable/disable:
Enable and disable all monitors and validate both the enabled file
and the enabled_monitors. Check that enabling container monitors
enables all nested monitors.
* reactors:
Set all reactors and validate the setting, also for nested monitors.
* wwnr with printk:
wwnr is broken on purpose, run it with a load and check that the
printk reactor works. Also validate disabling reacting_on or
monitoring_on prevents reactions.
These tests use the ftracetest suite.
Acked-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20251017115203.140080-3-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
31 lines
710 B
Bash
31 lines
710 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# description: Test wwnr monitor with printk reactor
|
|
# requires: available_reactors wwnr:monitor printk:reactor stress-ng:program
|
|
|
|
load() { # returns true if there was a reaction
|
|
local lines_before num
|
|
num=$((($(nproc) + 1) / 2))
|
|
lines_before=$(dmesg | wc -l)
|
|
stress-ng --cpu-sched "$num" --timer "$num" -t 5 -q
|
|
dmesg | tail -n $((lines_before + 1)) | grep -q "rv: monitor wwnr does not allow event"
|
|
}
|
|
|
|
echo 1 > monitors/wwnr/enable
|
|
echo printk > monitors/wwnr/reactors
|
|
|
|
load
|
|
|
|
echo 0 > monitoring_on
|
|
! load
|
|
echo 1 > monitoring_on
|
|
|
|
load
|
|
|
|
echo 0 > reacting_on
|
|
! load
|
|
echo 1 > reacting_on
|
|
|
|
echo nop > monitors/wwnr/reactors
|
|
echo 0 > monitors/wwnr/enable
|