Skip to content

Commit 70165c7

Browse files
lenticularis39rostedt
authored andcommitted
Documentation/rtla: Add actions feature
Document both --on-threshold and --on-end, with examples. Cc: John Kacur <[email protected]> Cc: Luis Goncalves <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Chang Yin <[email protected]> Cc: Costa Shulyupin <[email protected]> Cc: Crystal Wood <[email protected]> Cc: Gabriele Monaco <[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 04f8371 commit 70165c7

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

Documentation/tools/rtla/common_timerlat_options.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,67 @@
5555
Set timerlat to run without workload, waiting for the user to dispatch a per-cpu
5656
task that waits for a new period on the tracing/osnoise/per_cpu/cpu$ID/timerlat_fd.
5757
See linux/tools/rtla/sample/timerlat_load.py for an example of user-load code.
58+
59+
**--on-threshold** *action*
60+
61+
Defines an action to be executed when tracing is stopped on a latency threshold
62+
specified by **-i/--irq** or **-T/--thread**.
63+
64+
Multiple --on-threshold actions may be specified, and they will be executed in
65+
the order they are provided. If any action fails, subsequent actions in the list
66+
will not be executed.
67+
68+
Supported actions are:
69+
70+
- *trace[,file=<filename>]*
71+
72+
Saves trace output, optionally taking a filename. Alternative to -t/--trace.
73+
Note that nlike -t/--trace, specifying this multiple times will result in
74+
the trace being saved multiple times.
75+
76+
- *signal,num=<sig>,pid=<pid>*
77+
78+
Sends signal to process. "parent" might be specified in place of pid to target
79+
the parent process of rtla.
80+
81+
- *shell,command=<command>*
82+
83+
Execute shell command.
84+
85+
- *continue*
86+
87+
Continue tracing after actions are executed instead of stopping.
88+
89+
Example:
90+
91+
$ rtla timerlat -T 20 --on-threshold trace
92+
--on-threshold shell,command="grep ipi_send timerlat_trace.txt"
93+
--on-threshold signal,num=2,pid=parent
94+
95+
This will save a trace with the default filename "timerlat_trace.txt", print its
96+
lines that contain the text "ipi_send" on standard output, and send signal 2
97+
(SIGINT) to the parent process.
98+
99+
Performance Considerations:
100+
101+
For time-sensitive actions, it is recommended to run **rtla timerlat** with BPF
102+
support and RT priority. Note that due to implementational limitations, actions
103+
might be delayed up to one second after tracing is stopped if BPF mode is not
104+
available or disabled.
105+
106+
**--on-end** *action*
107+
108+
Defines an action to be executed at the end of **rtla timerlat** tracing.
109+
110+
Multiple --on-end actions can be specified, and they will be executed in the order
111+
they are provided. If any action fails, subsequent actions in the list will not be
112+
executed.
113+
114+
See the documentation for **--on-threshold** for the list of supported actions, with
115+
the exception that *continue* has no effect.
116+
117+
Example:
118+
119+
$ rtla timerlat -d 5s --on-end trace
120+
121+
This runs rtla timerlat with default options and save trace output at the end.

0 commit comments

Comments
 (0)