xref: /linux/Documentation/tools/rtla/common_timerlat_options.txt (revision ab43bd72f958b69045320bee8dd86fbb0eb74969)
1.. |threshold|  replace:: **-a/--auto**, **-i/--irq**, or **-T/--thread**
2.. |thresharg|  replace:: -T
3.. |tracer|     replace:: timerlat
4
5.. |actionsperf| replace::
6        For time-sensitive actions, it is recommended to run **rtla timerlat** with BPF
7        support and RT priority. Note that due to implementational limitations, actions
8        might be delayed up to one second after tracing is stopped if BPF mode is not
9        available or disabled.
10
11**-a**, **--auto** *us*
12
13        Set the automatic trace mode. This mode sets some commonly used options
14        while debugging the system. It is equivalent to use **-T** *us* **-s** *us*
15        **-t**. By default, *timerlat* tracer uses FIFO:95 for *timerlat* threads,
16        thus equivalent to **-P** *f:95*.
17
18**-p**, **--period** *us*
19
20        Set the *timerlat* tracer period in microseconds.
21
22**-i**, **--irq** *us*
23
24        Stop trace if the *IRQ* latency is higher than the argument in us.
25
26        This option cannot be unset.
27
28**-T**, **--thread** *us*
29
30        Stop trace if the *Thread* latency is higher than the argument in us.
31
32        This option cannot be unset.
33
34**-s**, **--stack** *us*
35
36        Save the stack trace at the *IRQ* if a *Thread* latency is higher than the
37        argument in us.
38
39**-t**, **--trace** \[*file*]
40
41        Save the stopped trace to [*file|timerlat_trace.txt*].
42
43**--dma-latency** *us*
44        Set the /dev/cpu_dma_latency to *us*, aiming to bound exit from idle latencies.
45        *cyclictest* sets this value to *0* by default, use **--dma-latency** *0* to have
46        similar results.
47
48**--deepest-idle-state** *n*
49        Disable idle states higher than *n* for cpus that are running timerlat threads to
50        reduce exit from idle latencies. If *n* is -1, all idle states are disabled.
51        On exit from timerlat, the idle state setting is restored to its original state
52        before running timerlat.
53
54        Requires rtla to be built with libcpupower.
55
56**-k**, **--kernel-threads**
57
58        Use timerlat kernel-space threads, in contrast of **-u**.
59
60**-u**, **--user-threads**
61
62        Set timerlat to run without a workload, and then dispatches user-space workloads
63        to wait on the timerlat_fd. Once the workload is awakened, it goes to sleep again
64        adding so the measurement for the kernel-to-user and user-to-kernel to the tracer
65        output. **--user-threads** will be used unless the user specify **-k**.
66
67**-U**, **--user-load**
68
69        Set timerlat to run without workload, waiting for the user to dispatch a per-cpu
70        task that waits for a new period on the tracing/osnoise/per_cpu/cpu$ID/timerlat_fd.
71        See linux/tools/rtla/example/timerlat_load.py for an example of user-load code.
72
73**--bpf-action** *bpf-program*
74
75        Loads a BPF program from an ELF file and executes it when a latency threshold is exceeded.
76
77        The BPF program must be a valid ELF file loadable with libbpf. The program must contain
78        a function named ``action_handler``, stored in an ELF section with the ``tp_`` prefix.
79        The prefix is used by libbpf to set BPF program type to BPF_PROG_TYPE_TRACEPOINT.
80
81        The program receives a ``struct trace_event_raw_timerlat_sample`` parameter
82        containing timerlat sample data.
83
84        An example is provided in ``tools/tracing/rtla/example/timerlat_bpf_action.c``.
85        This example demonstrates how to create a BPF program that prints latency information using
86        bpf_trace_printk() when a threshold is exceeded.
87
88        **Note**: BPF actions require BPF support to be available. If BPF is not available
89        or disabled, the tool falls back to tracefs mode and BPF actions are not supported.
90
91**--stack-format** *format*
92
93        Adjust the format of the stack trace printed during auto-analysis.
94
95        The supported values for *format* are:
96
97        * **truncate**    Print the stack trace up to the first unknown address (default).
98        * **skip**        Skip unknown addresses.
99        * **full**        Print the entire stack trace, including unknown addresses.
100
101        For unknown addresses, the raw pointer is printed.
102
103**-A**, **--aligned** *us*
104
105        Align wake-up of timerlat threads to a set offset in microseconds.
106
107        The alignment will be applied when the threads wake up at the start of tracing while
108        the timer for the first cycle is armed. Each thread sets its timer to the wake-up time
109        of the previous thread plus the alignment.
110
111        This option may be used with any non-negative argument, including zero, which will
112        align threads so that they wake up all at the same time.
113