diff options
author | Daniel Bristot de Oliveira <bristot@kernel.org> | 2024-02-06 15:32:06 +0100 |
---|---|---|
committer | Daniel Bristot de Oliveira <bristot@kernel.org> | 2024-03-20 05:39:06 +0100 |
commit | a23c05fd76cf4ad27e0c74f7a93e7b089e94a55c (patch) | |
tree | 11000b9beacba3dcd194907f64b8beabc01b3e4e /Documentation/tools | |
parent | 012e4e77df736263f235640e0b0b45ac919e54bf (diff) | |
download | linux-a23c05fd76cf4ad27e0c74f7a93e7b089e94a55c.tar.gz linux-a23c05fd76cf4ad27e0c74f7a93e7b089e94a55c.tar.bz2 linux-a23c05fd76cf4ad27e0c74f7a93e7b089e94a55c.zip |
tools/rtla: Add -U/--user-load option to timerlat
The timerlat tracer provides an interface for any application to wait
for the timerlat's periodic wakeup. Currently, rtla timerlat uses it
to dispatch its user-space workload (-u option).
But as the tracer interface is generic, rtla timerlat can also be used
to monitor any workload that uses it. For example, a user might
place their own workload to wait on the tracer interface, and
monitor the results with rtla timerlat.
Add the -U option to rtla timerlat top and hist. With this option, rtla
timerlat will not dispatch its workload but only setting up the
system, waiting for a user to dispatch its workload.
The sample code in this patch is an example of python application
that loops in the timerlat tracer fd.
To use it, dispatch:
# rtla timerlat -U
In a terminal, then run the python program on another terminal,
specifying the CPU to run it. For example, setting on CPU 1:
#./timerlat_load.py 1
Then rtla timerlat will start printing the statistics of the
./timerlat_load.py app.
An interesting point is that the "Ret user Timer Latency" value
is the overall response time of the load. The sample load does
a memory copy to exemplify that.
The stop tracing options on rtla timerlat works in this setup
as well, including auto analysis.
Link: https://lkml.kernel.org/r/36e6bcf18fe15c7601048fd4c65aeb193c502cc8.1707229706.git.bristot@kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Diffstat (limited to 'Documentation/tools')
-rw-r--r-- | Documentation/tools/rtla/common_timerlat_options.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/tools/rtla/common_timerlat_options.rst b/Documentation/tools/rtla/common_timerlat_options.rst index 88506b397c2d..d3255ed70195 100644 --- a/Documentation/tools/rtla/common_timerlat_options.rst +++ b/Documentation/tools/rtla/common_timerlat_options.rst @@ -33,3 +33,9 @@ to wait on the timerlat_fd. Once the workload is awakes, it goes to sleep again adding so the measurement for the kernel-to-user and user-to-kernel to the tracer output. + +**-U**, **--user-load** + + Set timerlat to run without workload, waiting for the user to dispatch a per-cpu + task that waits for a new period on the tracing/osnoise/per_cpu/cpu$ID/timerlat_fd. + See linux/tools/rtla/sample/timerlat_load.py for an example of user-load code. |