Skip to content

rtla: Add tests for option parsing with attached arguments

John Kacur linux-trace-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rtla/timerlat: Add tests for option parsing with attached argumentstools/tracing/rtla/tests/timerlat.t+10 -00 replies
2/2rtla: Add tests for option parsing with attached argumentstools/tracing/rtla/tests/hwnoise.t tools/tracing/rtla/tests/osnoise.t tools/tracing/rtla/tests/timerlat.t+36 -00 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/2] rtla: Add tests for option parsing with attached arguments

This patch series adds comprehensive tests to verify that short options with attached numeric arguments (e.g., -p100) work correctly across all rtla commands.

These tests complement Tomas Glozar's fix "rtla: Fix parsing of multi-character short options" which resolves the issue where options like -p100 were incorrectly parsed as multiple separate options due to getopt_long() being called twice.

The tests verify four option formats for each command:

  -p 100        (short with space)
  -p100         (short attached - previously broken)
  --period=100  (long with equals)
  --period 100  (long with space)

Commands tested:
- timerlat hist and top
- osnoise hist and top
- hwnoise

All 20 tests pass with Tomas's fix applied, confirming the issue is resolved and preventing future regressions. These tests will continue to work when rtla transitions to libsubcmd in the future, ensuring this functionality remains correct across parsing implementations.

Note: Patch 1/2 is a resend of the timerlat hist tests sent previously. Patch 2/2 adds tests for the remaining rtla commands.

John Kacur (2):
rtla/timerlat: Add tests for option parsing with attached arguments
rtla: Add tests for option parsing with attached arguments

 tools/tracing/rtla/tests/hwnoise.t  | 10 ++++++++++
 tools/tracing/rtla/tests/osnoise.t  | 18 ++++++++++++++++++
 tools/tracing/rtla/tests/timerlat.t | 18 ++++++++++++++++++
 3 files changed, 46 insertions(+)
Signature · 1 line
2.54.0