[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250125113154.5caec693@gandalf.local.home>
Date: Sat, 25 Jan 2025 11:31:54 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Costa Shulyupin <costa.shul@...hat.com>, Gabriele Monaco
<gmonaco@...hat.com>, Tomas Glozar <tglozar@...hat.com>, John Kacur
<jkacur@...hat.com>
Subject: [GIT PULL] rv: tools/rtla: Updates for 6.14
Linus,
rv: tools/rtla: Updates for 6.14
- Add a test suite to test the tool
Add a small test suite that can be used to test rtla's basic features to
at least have something to test when applying changes.
- Automate manual steps in monitor creation
While creating a new monitor in RV, besides generating code from dot2k,
there are a few manual steps which can be tedious and error prone, like
adding the tracepoints, makefile lines and kconfig, or selecting events
that start the monitor in the initial state.
Updates were made to try and automate as much as possible among those steps to
make creating a new RV monitor much quicker. It is still requires to
select proper tracepoints, this step is harder to automate in a general
way and, in several cases, would still need user intervention.
- Have rtla timerlat hist and top set OSNOISE_WORKLOAD flag
Have 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.
- Stop rtla timerlat on signal properly when overloaded
There is an issue where if rtla is run on machines with a high number of
CPUs (100+), timerlat can generate more samples than rtla is able to process
via tracefs_iterate_raw_events. This is especially common when the interval
is set to 100us (rteval and cyclictest default) as opposed to the rtla
default of 1000us, but also happens with the rtla default.
Currently, this leads to rtla hanging and having to be terminated with
SIGTERM. SIGINT setting stop_tracing is not enough, since more and more
events are coming and tracefs_iterate_raw_events never exits.
To fix this: Stop the timerlat tracer on SIGINT/SIGALRM to ensure no more
events are generated when rtla is supposed to exit.
Also on receiving SIGINT/SIGALRM twice, abort iteration immediately with
tracefs_iterate_stop, making rtla exit right away instead of waiting for all
events to be processed.
- Account for missed events
Due to tracefs buffer overflow, it can happen that rtla misses events,
making the tracing results inaccurate.
Count both the number of missed events and the total number of processed
events, and display missed events as well as their percentage. The numbers
are displayed for both osnoise and timerlat, even though for the earlier,
missed events are generally not expected.
For hist, the number is displayed at the end of the run; for top, it is
displayed on each printing of the top table.
- Changes to make osnoise more robust
There was a dependency in the code that the first field of the
osnoise_tool structure was the trace field. If that that ever changed,
then the code work break. Change the code to encapsulate this dependency
where the code that uses the structure does not have this dependency.
Please pull the latest trace-tools-v6.14 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-tools-v6.14
Tag SHA1: a24dfa90dd5bd124328d33375a42e064e514a002
Head SHA1: cf186201118c953c3a0256312a186b3d24ffdb9f
Costa Shulyupin (1):
tools/rtla: Add osnoise_trace_is_off()
Gabriele Monaco (8):
verification/dot2k: Fix template directory detection
verification/dot2k: Unify main.c templates
verification/dot2k: More robust template variables
verification/dot2k: Add support for name and description options
rv: Simplify manual steps in monitor creation
verification/dot2k: Simplify manual steps in monitor creation
verification/dot2k: Auto patch current kernel source
verification/dot2k: Implement event type detection
Tomas Glozar (13):
tools/rtla: Add basic test suite
rtla: Add trace_instance_stop
rtla/timerlat_hist: Stop timerlat tracer on signal
rtla/timerlat_top: Stop timerlat tracer on signal
rtla/timerlat_hist: Abort event processing on second signal
rtla/timerlat_top: Abort event processing on second signal
rtla/osnoise: Distinguish missing workload option
rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
rtla: Count missed trace events
rtla: Count all processed events
rtla: Add function to report missed events
rtla: Report missed event count
----
kernel/trace/rv/Kconfig | 27 +--
kernel/trace/rv/Makefile | 3 +
kernel/trace/rv/monitors/wip/Kconfig | 12 ++
kernel/trace/rv/monitors/wip/wip.c | 2 +-
kernel/trace/rv/monitors/wip/wip_trace.h | 15 ++
kernel/trace/rv/monitors/wwnr/Kconfig | 11 +
kernel/trace/rv/monitors/wwnr/wwnr.c | 2 +-
kernel/trace/rv/monitors/wwnr/wwnr_trace.h | 16 ++
kernel/trace/rv/rv.c | 2 +-
.../events/rv.h => kernel/trace/rv/rv_trace.h | 26 +--
tools/tracing/rtla/Makefile | 4 +-
tools/tracing/rtla/src/osnoise.c | 38 +++-
tools/tracing/rtla/src/osnoise.h | 2 +
tools/tracing/rtla/src/osnoise_hist.c | 5 +-
tools/tracing/rtla/src/osnoise_top.c | 5 +-
tools/tracing/rtla/src/timerlat_hist.c | 37 +++-
tools/tracing/rtla/src/timerlat_top.c | 40 +++-
tools/tracing/rtla/src/trace.c | 65 ++++--
tools/tracing/rtla/src/trace.h | 4 +-
tools/tracing/rtla/tests/engine.sh | 48 +++++
tools/tracing/rtla/tests/hwnoise.t | 21 ++
tools/tracing/rtla/tests/osnoise.t | 19 ++
tools/tracing/rtla/tests/timerlat.t | 27 +++
tools/verification/dot2/automata.py | 36 +++-
tools/verification/dot2/dot2c.py | 4 +-
tools/verification/dot2/dot2k | 17 +-
tools/verification/dot2/dot2k.py | 226 ++++++++++++++++++---
tools/verification/dot2/dot2k_templates/Kconfig | 6 +
tools/verification/dot2/dot2k_templates/main.c | 91 +++++++++
.../dot2/dot2k_templates/main_global.c | 91 ---------
.../dot2/dot2k_templates/main_per_cpu.c | 91 ---------
.../dot2/dot2k_templates/main_per_task.c | 91 ---------
tools/verification/dot2/dot2k_templates/trace.h | 13 ++
33 files changed, 691 insertions(+), 406 deletions(-)
create mode 100644 kernel/trace/rv/monitors/wip/Kconfig
create mode 100644 kernel/trace/rv/monitors/wip/wip_trace.h
create mode 100644 kernel/trace/rv/monitors/wwnr/Kconfig
create mode 100644 kernel/trace/rv/monitors/wwnr/wwnr_trace.h
rename include/trace/events/rv.h => kernel/trace/rv/rv_trace.h (79%)
create mode 100644 tools/tracing/rtla/tests/engine.sh
create mode 100644 tools/tracing/rtla/tests/hwnoise.t
create mode 100644 tools/tracing/rtla/tests/osnoise.t
create mode 100644 tools/tracing/rtla/tests/timerlat.t
create mode 100644 tools/verification/dot2/dot2k_templates/Kconfig
create mode 100644 tools/verification/dot2/dot2k_templates/main.c
delete mode 100644 tools/verification/dot2/dot2k_templates/main_global.c
delete mode 100644 tools/verification/dot2/dot2k_templates/main_per_cpu.c
delete mode 100644 tools/verification/dot2/dot2k_templates/main_per_task.c
create mode 100644 tools/verification/dot2/dot2k_templates/trace.h
---------------------------
Powered by blists - more mailing lists