Skip to contentSkip to conversation

RTLA changes for 7.3

GIT PULL Tomas Glozar 2 participants 5 messages Aug 5 – Aug 14 Tracing

lore
Share & tools
lore
#0 lore raw

Steven,

The following changes since commit 075b74841bd0065a3bda3440873c747938e69b68:

Linux 7.2-rc6 (2026-08-02 16:24:24 -0700)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/tglozar/linux.git tags/rtla-v7.3

for you to fetch changes up to 0ad45018ace734e3a21c8b15280df65b429135d1:

rtla/cli: Unify and improve handling of invalid option arguments (2026-08-05 10:14:40 +0200)

----------------------------------------------------------------
RTLA patches for 7.3

- Extend support for unsetting CLI options

libsubcmd auto-generates "--no-<option>" to unset options, provided the option callback supports it. Implement this for RTLA CLI beyond boolean options, and document the few exceptions that are left out.

- Test all tracer options in runtime tests

Verify that RTLA sets osnoise/timerlat options correctly by reading them from tracefs during runtime tests.

- Improve range validation for option arguments

Make CLI range validation consistent with the kernel limits and unify implementation and error messages between options.

- Improve invalid option argument parsing

Consistently reject invalid values for numeric option arguments with a unified error message for all options.

----------------------------------------------------------------
Tomas Glozar (7):
rtla: Allow unsetting non-list custom-callback CLI options
rtla: Add unit tests for unset in opt callbacks
rtla: Add unit tests for CLI with unset Documentation/rtla: Document unsetting options rtla/tests: Test all tracer options in runtime tests rtla/cli: Unify and improve range validation logic rtla/cli: Unify and improve handling of invalid option arguments

 Documentation/tools/rtla/common_appendix.txt       |  17 +
 Documentation/tools/rtla/common_options.txt        |  13 +-
 .../tools/rtla/common_osnoise_options.txt          |   4 +
 .../tools/rtla/common_timerlat_options.txt         |   4 +
 tools/tracing/rtla/src/cli.c                       |  42 +-
 tools/tracing/rtla/src/cli_p.h                     | 497 ++++++++++++-------
 tools/tracing/rtla/tests/engine.sh                 |  41 +-
 tools/tracing/rtla/tests/hwnoise.t                 |   3 +
 tools/tracing/rtla/tests/osnoise.t                 |  39 +-
 .../rtla/tests/scripts/check-osnoise-option.sh     |  16 +
 .../rtla/tests/scripts/check-tracefs-value.sh      |  11 +
 tools/tracing/rtla/tests/timerlat.t                |  40 +-
 tools/tracing/rtla/tests/unit/cli_opt_callback.c   | 534 ++++++++++++++-------
 tools/tracing/rtla/tests/unit/osnoise_hist_cli.c   |  18 +
 tools/tracing/rtla/tests/unit/osnoise_top_cli.c    |  18 +
 tools/tracing/rtla/tests/unit/timerlat_hist_cli.c  |  18 +
 tools/tracing/rtla/tests/unit/timerlat_top_cli.c   |  18 +
 17 files changed, 949 insertions(+), 384 deletions(-)
 create mode 100755 tools/tracing/rtla/tests/scripts/check-osnoise-option.sh
 create mode 100755 tools/tracing/rtla/tests/scripts/check-tracefs-value.sh
maintainer
#1 lore raw
Quoted 6 lines · On Wed, 5 Aug 2026 17:10:55 +0200 Tomas Glozar <[email protected]> wrote:

Steven,

The following changes since commit 075b74841bd0065a3bda3440873c747938e69b68:

Linux 7.2-rc6 (2026-08-02 16:24:24 -0700)

Quoted 7 lines

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/tglozar/linux.git tags/rtla-v7.3

for you to fetch changes up to 0ad45018ace734e3a21c8b15280df65b429135d1:

rtla/cli: Unify and improve handling of invalid option arguments (2026-08-05 10:14:40 +0200)

I just tested this on my VM and have the following results from "make check":

Auto-detecting system features:

...                           libtraceevent: [ on  ]
...                              libtracefs: [ on  ]
...                             libcpupower: [ on  ]

... libcheck: [ OFF ]
... libbpf: [ OFF ]
... clang-bpf-co-re: [ on ]
... bpftool-skeletons: [ on ]

libcheck is missing, building without unit tests support. Please install check-devel/check
libbpf is missing, building without BPF skeleton support. Please install libbpf-dev/libbpf-devel
[..]
tests/timerlat.t ..
1..75
[..]
not ok 20 - top verify -c/--cpus
# Output match failed: "^Affinity of threads: 0$" # Affinity of threads:
# Timer Latency

# 0 00:00:04   |	  IRQ Timer Latency (us)	|	  Thread Timer Latency (us)	 |    Ret user Timer Latency (us)
# CPU COUNT      |      cur	min	  avg	    max |      cur	 min	   avg	     max |	cur	  min	    avg	      max
# 0 #2	       |       72	 70	   71	     72 |      128	 128	   128	     129 |	154	  154	    154	      154
# ---------------|----------------------------------------|----------------------------------------|---------------------------------------
# ALL #2	    e0 |		 70	   71	     72 |		 128	   128	     129 |		  154	    154	      154
# timerlat hit stop tracing
# ## CPU 0 hit stop tracing, analyzing it ##
# IRQ handler delay:		      (exit from idle)	    58.28 us (45.18 %)
# IRQ latency:						    72.60 us
# Timerlat IRQ duration:				    32.63 us (25.29 %)
# Blocking thread:					    22.43 us (17.39 %)
# swapper/0:0			    22.43 us
# ------------------------------------------------------------------------
# Thread latency:					   129.00 us (100%)
# 
# Max timerlat IRQ latency from idle: 72.60 us in cpu 0
#
# exit code 2
not ok 21 - hist verify -c/--cpus
# Output match failed: "^Affinity of threads: 0$"
# Affinity of threads:
# # RTLA timerlat histogram
# # Time unit is microseconds (us)
# # Duration:   0 00:00:03
# Index	IRQ-000	  Thr-000   Usr-000
# 80	      1		0	  0
# 81	      1		0	  0
# 139	      0		2	  0
# 165	      0		0	  1
# over:	      0		0	  0
# count:	      2		2	  1
# min:	     80	      139	165
# avg:	     80	      139	165
# max:	     81	      139	165
# ALL:	    IRQ	      Thr	Usr
# count:	      2		2	  1
# min:	     80	      139	165
# avg:	     80	      139	165
# max:	     81	      139	165
# timerlat hit stop tracing
# ## CPU 0 hit stop tracing, analyzing it ##
# IRQ handler delay:		      (exit from idle)	    67.05 us (48.08 %)
# IRQ latency:						    81.97 us
# Timerlat IRQ duration:				    33.38 us (23.94 %)
# Blocking thread:					    22.95 us (16.46 %)
# swapper/0:0			    22.95 us
# ------------------------------------------------------------------------
# Thread latency:					   139.45 us (100%)
# 
# Max timerlat IRQ latency from idle: 81.97 us in cpu 0
#
# exit code 2
ok 22 - top verify -H/--house-keeping
ok 23 - hist verify -H/--house-keeping
ok 24 - top verify -k/--kernel-threads
ok 25 - hist verify -k/--kernel-threads
not ok 26 - top verify -u/--user-threads
# Output match failed: "0 kernel threads, 1 user threads"
# 0 kernel threads, 0 user threads
# Timer Latency
# 0 00:00:04   |	  IRQ Timer Latency (us)	|	  Thread Timer Latency (us)	 |    Ret user Timer Latency (us)
# CPU COUNT      |      cur	min	  avg	    max |      cur	 min	   avg	     max |	cur	  min	    avg	      max
# 0 #2	       |       90	 78	   84	     90 |      147	 136	   141	     147 |	163	  163	    163	      163
# ---------------|----------------------------------------|----------------------------------------|---------------------------------------
# ALL #2	    e0 |		 78	   84	     90 |		 136	   141	     147 |		  163	    163	      163
# timerlat hit stop tracing
# ## CPU 0 hit stop tracing, analyzing it ##
# IRQ handler delay:		      (exit from idle)	    75.58 us (51.26 %)
# IRQ latency:						    90.24 us
# Timerlat IRQ duration:				    33.32 us (22.60 %)
# Blocking thread:					    23.06 us (15.64 %)
# swapper/0:0			    23.06 us
# ------------------------------------------------------------------------
# Thread latency:					   147.46 us (100%)
# 
# Max timerlat IRQ latency from idle: 90.24 us in cpu 0
#
# exit code 2
not ok 27 - hist verify -u/--user-threads
# Output match failed: "0 kernel threads, 1 user threads"
# 0 kernel threads, 0 user threads
# # RTLA timerlat histogram
# # Time unit is microseconds (us)
# # Duration:   0 00:00:05
# Index	IRQ-000	  Thr-000   Usr-000
# 75	      1		0	  0
# 83	      1		0	  0
# 133	      0		1	  0
# 140	      0		1	  0
# 160	      0		0	  1
# over:	      0		0	  0
# count:	      2		2	  1
# min:	     75	      133	160
# avg:	     79	      136	160
# max:	     83	      140	160
# ALL:	    IRQ	      Thr	Usr
# count:	      2		2	  1
# min:	     75	      133	160
# avg:	     79	      136	160
# max:	     83	      140	160
# timerlat hit stop tracing
# ## CPU 0 hit stop tracing, analyzing it ##
# IRQ handler delay:		      (exit from idle)	    68.78 us (48.91 %)
# IRQ latency:						    83.35 us
# Timerlat IRQ duration:				    33.13 us (23.56 %)
# Blocking thread:					    22.89 us (16.28 %)
# swapper/0:0			    22.89 us
# ------------------------------------------------------------------------
# Thread latency:					   140.62 us (100%)
# 
# Max timerlat IRQ latency from idle: 83.35 us in cpu 0
#
# exit code 2
[..]

-- Steve

#2 lore raw

út 11. 8. 2026 v 3:04 odesílatel Steven Rostedt <[email protected]> napsal:

Quoted 21 lines

I just tested this on my VM and have the following results from "make check":

[...]
not ok 20 - top verify -c/--cpus
# Output match failed: "^Affinity of threads: 0$" # Affinity of threads:
[...]
not ok 21 - hist verify -c/--cpus
# Output match failed: "^Affinity of threads: 0$" # Affinity of threads:
[...]
not ok 26 - top verify -u/--user-threads
# Output match failed: "0 kernel threads, 1 user threads" # 0 kernel threads, 0 user threads
[...]
not ok 27 - hist verify -u/--user-threads
# Output match failed: "0 kernel threads, 1 user threads" # 0 kernel threads, 0 user threads
[..]

Quoted 2 lines

-- Steve

tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh is for some reason not finding the user threads (as the tests for -H and -k succeeded) on your system. The threads themselves had to be running, as timerlat is reporting samples from them. The script and the related tests cases were added in 7.2 already, this pull request does not touch them so it's most likely a pre-existing issue.

Either way, I will look into that, thank you for testing. It might be environment-dependent, as the test relies on the test script (executed as an --on-threshold action) being a direct child of the main rtla process - which only holds when the system() shell executes the script directly, not as a subprocess.

Tomas

maintainer
#3 lore raw
Quoted 7 lines · On Tue, 11 Aug 2026 09:22:54 +0200 Tomas Glozar <[email protected]> wrote:

tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh is for some reason not finding the user threads (as the tests for -H and -k succeeded) on your system. The threads themselves had to be running, as timerlat is reporting samples from them. The script and the related tests cases were added in 7.2 already, this pull request does not touch them so it's most likely a pre-existing issue.

Quoted 5 lines

Either way, I will look into that, thank you for testing. It might be environment-dependent, as the test relies on the test script (executed as an --on-threshold action) being a direct child of the main rtla process - which only holds when the system() shell executes the script directly, not as a subprocess.

I just pushed this to the for-next branch. I'll let you figure out if there needs to be any more updates.

-- Steve

#4 lore raw

pá 14. 8. 2026 v 16:19 odesílatel Steven Rostedt <[email protected]> napsal:

Quoted 17 lines
Quoted 7 lines · On Tue, 11 Aug 2026 09:22:54 +0200 Tomas Glozar <[email protected]> wrote:

tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh is for some reason not finding the user threads (as the tests for -H and -k succeeded) on your system. The threads themselves had to be running, as timerlat is reporting samples from them. The script and the related tests cases were added in 7.2 already, this pull request does not touch them so it's most likely a pre-existing issue.

Quoted 5 lines

Either way, I will look into that, thank you for testing. It might be environment-dependent, as the test relies on the test script (executed as an --on-threshold action) being a direct child of the main rtla process - which only holds when the system() shell executes the script directly, not as a subprocess.

Quoted 5 lines

I just pushed this to the for-next branch. I'll let you figure out if there needs to be any more updates.

-- Steve

Thanks. As this is now a known bug in the test (and is already in 7.2 rather than a 7.3 regression in the pull request), I was not rushing to fix that and rather continued to focus on my patchset.

Of course, I'm trying to keep tests passing, now that the majority of high-frequency intermittent failures are fixed, so that people running tests are not desensitized to failures.

Tomas