mbox series

[0/3] rtla/timerlat: Set OSNOISE_WORKLOAD for kernel threads

Message ID 20250107144823.239782-1-tglozar@redhat.com (mailing list archive)
Headers show
Series rtla/timerlat: Set OSNOISE_WORKLOAD for kernel threads | expand

Message

Tomas Glozar Jan. 7, 2025, 2:48 p.m. UTC
The patchset makes both rtla-timerlat-hist and rtla-timerlat-top set
OSNOISE_WORKLOAD to the proper value ("on" when running with -k, "off"
when running with -u) every time the option is available instead of setting it
only when running with -u.

This prevents rtla timerlat -k from giving no results when
NO_OSNOISE_WORKLOAD is set, either manually or by an abnormally exited earlier
run of rtla timerlat -u.

osnoise_set_workload is made to distinguish between the option missing
altogether and it failing to be set. In the first case, rtla-timerlat will
ignore setting the option to preserve compatibility of kernel-thread mode
on older kernels without the OSNOISE_WORKLOAD option.

Tomas Glozar (3):
  rtla/osnoise: Distinguish missing workload option
  rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
  rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads

 tools/tracing/rtla/src/osnoise.c       |  2 +-
 tools/tracing/rtla/src/timerlat_hist.c | 15 +++++++++------
 tools/tracing/rtla/src/timerlat_top.c  | 15 +++++++++------
 3 files changed, 19 insertions(+), 13 deletions(-)

Comments

Steven Rostedt Jan. 7, 2025, 9:44 p.m. UTC | #1
On Tue,  7 Jan 2025 15:48:20 +0100
Tomas Glozar <tglozar@redhat.com> wrote:

> The patchset makes both rtla-timerlat-hist and rtla-timerlat-top set
> OSNOISE_WORKLOAD to the proper value ("on" when running with -k, "off"
> when running with -u) every time the option is available instead of setting it
> only when running with -u.
> 
> This prevents rtla timerlat -k from giving no results when
> NO_OSNOISE_WORKLOAD is set, either manually or by an abnormally exited earlier
> run of rtla timerlat -u.
> 
> osnoise_set_workload is made to distinguish between the option missing
> altogether and it failing to be set. In the first case, rtla-timerlat will
> ignore setting the option to preserve compatibility of kernel-thread mode
> on older kernels without the OSNOISE_WORKLOAD option.
> 
> Tomas Glozar (3):
>   rtla/osnoise: Distinguish missing workload option
>   rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
>   rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
> 
>  tools/tracing/rtla/src/osnoise.c       |  2 +-
>  tools/tracing/rtla/src/timerlat_hist.c | 15 +++++++++------
>  tools/tracing/rtla/src/timerlat_top.c  | 15 +++++++++------
>  3 files changed, 19 insertions(+), 13 deletions(-)
> 

BTW, are you going to be implementing any selftests for rtla so that it is
easy to test these changes and check for regressions?

-- Steve
Tomas Glozar Jan. 9, 2025, 9:50 a.m. UTC | #2
Ășt 7. 1. 2025 v 22:43 odesĂ­latel Steven Rostedt <rostedt@goodmis.org> napsal:
>
> BTW, are you going to be implementing any selftests for rtla so that it is
> easy to test these changes and check for regressions?

Ah right, I promised that some time ago. I have a simple test suite
adapted from CKI tests [1] that is close to being ready, I was having
some doubts about the implementation, but I will send it after adding
a few comments into the code so it can be discussed.

I have discovered already through the tests that this OSNOISE_WORKLOAD
issue also affects rtla-osnoise, not only rtla-timerlat, so it is
definitely at least somehow useful.

[1] - https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/blob/main/rt-tests/us/rtla/

> -- Steve
>

Tomas