xref: /linux/Documentation/tools/rtla/common_timerlat_options.rst (revision 746680ec6696585e30db3e18c93a63df9cbec39c)
1**-a**, **--auto** *us*
2
3        Set the automatic trace mode. This mode sets some commonly used options
4        while debugging the system. It is equivalent to use **-T** *us* **-s** *us*
5        **-t**. By default, *timerlat* tracer uses FIFO:95 for *timerlat* threads,
6        thus equilavent to **-P** *f:95*.
7
8**-p**, **--period** *us*
9
10        Set the *timerlat* tracer period in microseconds.
11
12**-i**, **--irq** *us*
13
14        Stop trace if the *IRQ* latency is higher than the argument in us.
15
16**-T**, **--thread** *us*
17
18        Stop trace if the *Thread* latency is higher than the argument in us.
19
20**-s**, **--stack** *us*
21
22        Save the stack trace at the *IRQ* if a *Thread* latency is higher than the
23        argument in us.
24
25**-t**, **--trace** \[*file*]
26
27        Save the stopped trace to [*file|timerlat_trace.txt*].
28
29**--dma-latency** *us*
30        Set the /dev/cpu_dma_latency to *us*, aiming to bound exit from idle latencies.
31        *cyclictest* sets this value to *0* by default, use **--dma-latency** *0* to have
32        similar results.
33
34**--deepest-idle-state** *n*
35        Disable idle states higher than *n* for cpus that are running timerlat threads to
36        reduce exit from idle latencies. If *n* is -1, all idle states are disabled.
37        On exit from timerlat, the idle state setting is restored to its original state
38        before running timerlat.
39
40        Requires rtla to be built with libcpupower.
41
42**-k**, **--kernel-threads**
43
44        Use timerlat kernel-space threads, in contrast of **-u**.
45
46**-u**, **--user-threads**
47
48        Set timerlat to run without a workload, and then dispatches user-space workloads
49        to wait on the timerlat_fd. Once the workload is awakes, it goes to sleep again
50        adding so the measurement for the kernel-to-user and user-to-kernel to the tracer
51        output. **--user-threads** will be used unless the user specify **-k**.
52
53**-U**, **--user-load**
54
55        Set timerlat to run without workload, waiting for the user to dispatch a per-cpu
56        task that waits for a new period on the tracing/osnoise/per_cpu/cpu$ID/timerlat_fd.
57        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.
122