[PATCH v2 0/2] verification/rvgen: validate the monitor type

Chaosheng Qu posted 2 patches 4 days, 5 hours ago
tools/verification/rvgen/__main__.py           | 1 +
tools/verification/rvgen/tests/rvgen_monitor.t | 4 ++++
2 files changed, 5 insertions(+)
[PATCH v2 0/2] verification/rvgen: validate the monitor type
Posted by Chaosheng Qu 4 days, 5 hours ago
rvgen takes the monitor type on the command line and pastes it into the
generated monitor as RV_MON_<TYPE>.  Nothing validates it, so a typo
produces a monitor that cannot build while the tool still exits 0.
Monitor.monitor_types already holds the accepted set; pass it to
argparse as choices.  Patch 2 covers the rejection next to the other
error tests.

v2:
- Thread the series; 2/2 replies to this cover letter.
- Tag both patches verification/rvgen: and capitalise the subject.
- Patch content unchanged.

Link: https://lore.kernel.org/linux-trace-kernel/179447882046.254241.15114935256138596418@gmail.com/
Link: https://lore.kernel.org/linux-trace-kernel/179447882047.254241.3226415982233977960@gmail.com/

Testing: make check in tools/verification/rvgen -- 31/31 pass.

Chaosheng Qu (2):
  verification/rvgen: Validate the monitor type
  verification/rvgen: Cover an invalid monitor type

 tools/verification/rvgen/__main__.py           | 1 +
 tools/verification/rvgen/tests/rvgen_monitor.t | 4 ++++
 2 files changed, 5 insertions(+)

-- 
2.43.0