Skip to content

rtla: handle SIGTERM and test abnormal exits

Chaosheng Qu linux-trace-kernel lkml 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 0 repliesNew
  2. v32 patches 0 repliesSuperseded

Changes in v4 from the cover letter

- wait for the SIGTERM handler instead of a fixed sleep in the test
- no change to patch 1

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rtla: handle SIGTERM during a runtools/tracing/rtla/src/common.c+2 -00 replies
2/2rtla/tests: cover cleanup on abnormal exitstools/tracing/rtla/tests/cleanup.t tools/tracing/rtla/tests/scripts/check-cleanup.sh+289 -00 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH v4 0/2] rtla: handle SIGTERM and test abnormal exits

v3 split the test changes into their own patch and fixed the commit messages, but the test still signalled as soon as the instance directory appeared plus one second. On a slow guest that can beat set_signals(), which is the startup race sashiko described. v4 waits until /proc/<pid>/status reports SIGTERM in SigCgt before signalling.

Patch 1 is unchanged: it adds the SIGTERM handler that was missing. SIGINT, the -d/--duration timer and a failing --on-threshold action already reach the cleanup path; SIGTERM terminated the process and left its tracefs instance behind.

Patch 2 is the test, now with the readiness check. With it, cleanup.t passes all five cases on a 7.3-rc7 guest, including SIGTERM; without the handler, SIGTERM leaves the instance behind and the test fails.

v3: https://lore.kernel.org/linux-trace-kernel/[email protected]/
v2: https://lore.kernel.org/linux-trace-kernel/[email protected]/
v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/

This replaces the v1 submission, the v2 series and v3.

Changes since v3:
- wait for the SIGTERM handler instead of a fixed sleep in the test
- no change to patch 1

Testing: cleanup.t on 7.3-rc7, 4 vCPU QEMU guest -- SIGINT, SIGTERM, -d timer, action failure and repeated interrupts all pass. With the handler removed, the SIGTERM case fails as expected.

Chaosheng Qu (2):
rtla: handle SIGTERM during a run
rtla/tests: cover cleanup on abnormal exits

 tools/tracing/rtla/src/common.c               |   2 +
 tools/tracing/rtla/tests/cleanup.t            |  70 ++++++
 .../rtla/tests/scripts/check-cleanup.sh       | 219 ++++++++++++++++++
 3 files changed, 291 insertions(+)
 create mode 100644 tools/tracing/rtla/tests/cleanup.t
 create mode 100755 tools/tracing/rtla/tests/scripts/check-cleanup.sh
Signature · 1 line
2.43.0