Skip to content

rt-tests: centralize wrapper helpers and improve interrupt handling#425

Open
smuppand wants to merge 4 commits intoqualcomm-linux:mainfrom
smuppand:rt-kernel
Open

rt-tests: centralize wrapper helpers and improve interrupt handling#425
smuppand wants to merge 4 commits intoqualcomm-linux:mainfrom
smuppand:rt-kernel

Conversation

@smuppand
Copy link
Copy Markdown
Contributor

Summary

This PR standardizes the RT test wrappers by moving common execution, parsing, KPI aggregation, heartbeat, cleanup, and result-emission logic into Runner/utils/[lib_rt.sh](http://lib_rt.sh/).

The individual [run.sh](http://run.sh/) wrappers are updated to reuse the shared helpers while preserving the existing test behavior and command-line flow that has already been validated.

Why

The RT wrappers had repeated logic for:

  • running test binaries
  • collecting JSON/log output
  • parsing KPI lines
  • aggregating latency results
  • handling background workloads
  • emitting .res PASS/FAIL/SKIP results
  • dealing with Ctrl-C / TERM cleanup

Centralizing this makes the wrappers easier to maintain, reduces duplicated logic, and improves reliability in CI/LAVA, especially when tests are interrupted or fail mid-run.

What changed

  • Added/updated common RT helpers in Runner/utils/[lib_rt.sh](http://lib_rt.sh/)
  • Standardized JSON-based RT wrappers to use shared execution/parsing helpers
  • Hardened streaming wrappers with FIFO/heartbeat/process cleanup
  • Improved interrupt-aware handling so partial results are preserved
  • Kept PI_Stress special TERM handling because pi_stress can use TERM internally
  • Kept Hackbench log-based Time: parsing flow while using shared execution/result helpers
  • Preserved LAVA-friendly behavior where wrappers exit 0 and write final status to <TESTNAME>.res

Add shared helpers used by RT test wrappers for command execution, JSON parsing, KPI aggregation, heartbeat handling, interrupt-aware cleanup, and PASS/FAIL/SKIP result emission.

This avoids duplicating wrapper logic across individual rt-tests and provides a common path for preserving partial results during user interrupts.

The helpers are kept POSIX shell compatible so they can run on minimal Yocto/rootfs environments used in CI and LAVA.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
@smuppand smuppand requested a review from bhargav0610 April 27, 2026 01:32
@smuppand smuppand force-pushed the rt-kernel branch 2 times, most recently from 6b7e301 to cf055b8 Compare April 27, 2026 05:22
Update common JSON-producing RT test wrappers to use the shared lib_rt.sh execution, parsing, KPI aggregation, and result emission helpers.

This keeps per-test behavior unchanged while making the wrappers more consistent, easier to maintain, and safer for CI/LAVA use.

The wrappers now share interrupt-aware handling so Ctrl-C or TERM stops the active test cleanly and preserves any collected partial results.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Update streaming RT test wrappers to use the shared FIFO, heartbeat, cleanup, JSON parsing, and interrupt-aware result helpers.

These tests stream output while running, so they need stronger cleanup for child processes, pipes, heartbeat state, and background workloads.

This improves reliability when tests are interrupted or fail mid-run while preserving partial logs and KPI data for debugging.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Update Hackbench and PI_Stress wrappers while preserving their test-specific behavior.

Hackbench keeps its Time: log parsing flow but uses shared command execution, heartbeat, interrupt handling, and result emission helpers.

PI_Stress keeps its special TERM handling and uses the validated duration flow with -D seconds, while preserving inversion count aggregation, optional baseline gating, and partial result reporting on user interrupt.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant