Skip to content

Automate manual steps in monitor creation

Gabriele Monaco linux-trace-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8verification/dot2k: Fix template directory detectiontools/verification/dot2/dot2k.py+8 -80 replies
2/8verification/dot2k: Unify main.c templatestools/verification/dot2/dot2k.py tools/verification/dot2/dot2k_templates/main.c tools/verification/dot2/dot2k_templates/main_per_cpu.c +1 more+7 -1840 replies
3/8verification/dot2k: More robust template variablestools/verification/dot2/dot2k.py tools/verification/dot2/dot2k_templates/main.c+32 -320 replies
4/8verification/dot2k: Add support for name and description optionstools/verification/dot2/automata.py tools/verification/dot2/dot2c.py tools/verification/dot2/dot2k +2 more+12 -140 replies
5/8Simplify manual steps in monitor creationkernel/trace/rv/Kconfig kernel/trace/rv/Makefile kernel/trace/rv/monitors/wip/Kconfig +7 more+66 -450 replies
6/8verification/dot2k: Simplify manual steps in monitor creationtools/verification/dot2/dot2k tools/verification/dot2/dot2k.py tools/verification/dot2/dot2k_templates/Kconfig +2 more+110 -50 replies
7/8verification/dot2k: Auto patch current kernel sourcekernel/trace/rv/Kconfig kernel/trace/rv/Makefile kernel/trace/rv/rv_trace.h +2 more+86 -162 replies
8/8verification/dot2k: Implement event type detectiontools/verification/dot2/automata.py tools/verification/dot2/dot2k.py+41 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] rv: 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.

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

Signature · 1 line
2.47.1