mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/8] rv: Automate manual steps in monitor creation
@ 2024-12-27 14:47 Gabriele Monaco
  2024-12-27 14:47 ` [PATCH 1/8] verification/dot2k: Fix template directory detection Gabriele Monaco
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Gabriele Monaco @ 2024-12-27 14:47 UTC (permalink / raw)
  To: Steven Rostedt, linux-trace-kernel, linux-kernel
  Cc: Juri Lelli, Thomas Gleixner, John Kacur, Gabriele Monaco

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.

This patchset tries to automate as much as possible among those steps to
make creating a new RV monitor much quicker. It is still required to
select proper tracepoints, this step is harder to automate in a general
way and, in several cases, would still need user intervention.

The first 3 patches are preparatory work around the templates.

Patch 1 fixes the template directory used if dot2k is not installed but
is run from the kernel tree (tools/verification/).

Patch 2 unifies the templates for the 3 monitor types to change them
easier.

Patch 3 makes the format used for variables replaced by the dot2k script
a bit more robust.

Patch 4 implements the already present -n and -D flags to set the
monitor name and description, respectively.

Patch 5 moves most of the monitor-specific code to the monitor directory
(tracepoints, Kconfig). The user still needs to manually fill some
content but the copy-paste-change is reduced.

Patch 6 adapts dot2k to produce monitors as defined in patch 5, adding
the necessary templates. Additionally, while printing the checklist,
dot2k also suggests what lines to add and where.

Patch 7 adds the possibility to further automate what is done in patch 5
and 6. If dot2k finds a valid kernel source and the -a flag is passed,
it automatically changes the files accordingly (RV Makefile, tracepoints
and Kconfig) and moves the new monitor folder in the final position.

Patch 8 allows to automatically select events that start the monitor, to
achieve this, the automata parser can now understand if there are events
that always lead to the initial state or are only valid in the initial
state. dot2k uses da_handle_start_event with the former and, as a
fallback, da_handle_start_run_event for the latter.

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

 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/verification/dot2/automata.py           |  36 ++-
 tools/verification/dot2/dot2c.py              |   4 +-
 tools/verification/dot2/dot2k                 |  17 +-
 tools/verification/dot2/dot2k.py              | 226 +++++++++++++++---
 .../verification/dot2/dot2k_templates/Kconfig |   6 +
 .../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 -------
 .../verification/dot2/dot2k_templates/trace.h |  13 +
 20 files changed, 419 insertions(+), 363 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/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


base-commit: aef25be35d23ec768eed08bfcf7ca3cf9685bc28
-- 
2.47.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-12-28  7:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-27 14:47 [PATCH 0/8] rv: Automate manual steps in monitor creation Gabriele Monaco
2024-12-27 14:47 ` [PATCH 1/8] verification/dot2k: Fix template directory detection Gabriele Monaco
2024-12-27 14:47 ` [PATCH 2/8] verification/dot2k: Unify main.c templates Gabriele Monaco
2024-12-27 14:47 ` [PATCH 3/8] verification/dot2k: More robust template variables Gabriele Monaco
2024-12-27 14:47 ` [PATCH 4/8] verification/dot2k: Add support for name and description options Gabriele Monaco
2024-12-27 14:47 ` [PATCH 5/8] rv: Simplify manual steps in monitor creation Gabriele Monaco
2024-12-27 14:47 ` [PATCH 6/8] verification/dot2k: " Gabriele Monaco
2024-12-27 14:47 ` [PATCH 7/8] verification/dot2k: Auto patch current kernel source Gabriele Monaco
2024-12-27 19:44   ` Steven Rostedt
2024-12-28  7:25     ` Gabriele Monaco
2024-12-27 14:47 ` [PATCH 8/8] verification/dot2k: Implement event type detection Gabriele Monaco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®