* [PATCH v3 0/2] rtla: handle SIGTERM and test abnormal exits @ 2026-11-21 11:31 Chaosheng Qu 2026-11-21 11:31 ` [PATCH v3 2/2] rtla/tests: cover cleanup on " Chaosheng Qu 2026-11-21 11:31 ` [PATCH v3 1/2] rtla: handle SIGTERM during a run Chaosheng Qu 0 siblings, 2 replies; 4+ messages in thread From: Chaosheng Qu @ 2026-11-21 11:31 UTC (permalink / raw) To: linux-trace-kernel; +Cc: Steven Rostedt, Tomas Glozar, linux-kernel v2 mixed the SIGTERM fix with fixes to the test harness and repeated the commit summary at the top of the commit body. v3 splits the test changes into their own patch and writes both messages so that git am does not duplicate the summary. Patch 1 adds the handler that was missing. SIGINT, the -d/--duration timer and a failing --on-threshold action already reach the cleanup path; SIGTERM terminates the process and leaves its tracefs instance behind. Patch 2 adds the test for those paths. Its content is unchanged from v2, which was run against 7.3-rc7 in a guest for the SIGINT, SIGTERM, timer, action-failure and repeated-interrupt cases. Sashiko also pointed out that a signal delivered between instance creation and set_signals() can still escape cleanup. That window is real and pre-existing; moving the handlers earlier changes the cleanup ordering and is left out of this fix. v2: https://lore.kernel.org/linux-trace-kernel/1794300001.11111.1234567890@gmail.com/ v1: https://lore.kernel.org/linux-trace-kernel/20261017122359.402696-1-chaosheng.qu.linux@gmail.com/ This replaces the v1 submission and the v2 series. Changes since v2: - split the test changes into a separate commit - drop the repeated subject from the commit body; the harness changelog is gone from the commit message and the previous-version links are here - no functional change to either patch Testing: v2 was built and run in a 7.3-rc7 guest. v3 only splits and rewrites the commits, so the code under test is identical. 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 | 211 ++++++++++++++++++ 3 files changed, 283 insertions(+) create mode 100644 tools/tracing/rtla/tests/cleanup.t create mode 100755 tools/tracing/rtla/tests/scripts/check-cleanup.sh -- 2.43.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] rtla/tests: cover cleanup on abnormal exits 2026-11-21 11:31 [PATCH v3 0/2] rtla: handle SIGTERM and test abnormal exits Chaosheng Qu @ 2026-11-21 11:31 ` Chaosheng Qu 2026-11-21 11:47 ` sashiko-bot 2026-11-21 11:31 ` [PATCH v3 1/2] rtla: handle SIGTERM during a run Chaosheng Qu 1 sibling, 1 reply; 4+ messages in thread From: Chaosheng Qu @ 2026-11-21 11:31 UTC (permalink / raw) To: linux-trace-kernel; +Cc: Steven Rostedt, Tomas Glozar, linux-kernel rtla creates a tracefs instance for each run and removes it on the way out. Nothing verifies that, and a leaked instance only shows up as a confusing failure of the next run. Add a test for the paths users actually hit: SIGINT, SIGTERM, rtla's own -d timer, a failing --on-threshold action, and several interrupted runs followed by a normal one. These need rtla running in the background while the test signals it, which engine.sh's check() cannot express, so cleanup.t drives a helper script and emits TAP itself. The test needs root, tracefs and CONFIG_OSNOISE_TRACER, and skips when tracefs is not writable. Signed-off-by: Chaosheng Qu <chaosheng.qu.linux@gmail.com> --- tools/tracing/rtla/tests/cleanup.t | 70 ++++++ .../rtla/tests/scripts/check-cleanup.sh | 211 ++++++++++++++++++ 2 files changed, 281 insertions(+) create mode 100644 tools/tracing/rtla/tests/cleanup.t create mode 100755 tools/tracing/rtla/tests/scripts/check-cleanup.sh diff --git a/tools/tracing/rtla/tests/cleanup.t b/tools/tracing/rtla/tests/cleanup.t new file mode 100644 index 000000000..176b1a96f --- /dev/null +++ b/tools/tracing/rtla/tests/cleanup.t @@ -0,0 +1,70 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Verify that rtla removes the tracefs instance it created on the abnormal +# exit paths users actually hit: +# +# - SIGINT during a run (interactive Ctrl-C) +# - SIGTERM during a run +# - rtla's own -d/--duration timer +# - a failing --on-threshold shell action +# - several interrupted runs in a row, followed by a normal run +# +# A leaked instance pollutes the next invocation. +source tests/engine.sh +test_begin + +set_timeout 2m + +# +# These cases need to run rtla in the background and signal it, which +# engine.sh's check() (one foreground command) cannot express. +# +run_cleanup_cases() { + local helper="$testdir/scripts/check-cleanup.sh" + local out rc timeout_cmd skip + + ctr=$((ctr + 1)) + [ -z "$TEST_COUNT" ] && return + + if [ ! -x "$helper" ]; then + echo "not ok $ctr - cleanup helper is not executable" + return + fi + + # check() normally does this before every test. Do the same here, both to + # leave a clean tracer state and to make a hung helper terminate. + reset_osnoise || { + echo "ok $ctr - instances cleaned up on SIGINT, timeout and action failure # SKIP tracefs is not writable" + return + } + timeout_cmd=${TIMEOUT:-timeout -v -k 15s 2m} + + out=$($timeout_cmd "$helper" "$RTLA" 2>&1) + rc=$? + if [ $rc -eq 0 ]; then + # "SKIP:" is what the helper prints when it could not run at all + # (no writable tracefs, or the binary is unusable); a per-case skip + # says "note:" instead. So the first SKIP: line means nothing ran. + skip=$(printf '%s\n' "$out" | sed -n 's/^SKIP: //p' | head -n 1) + if [ -n "$skip" ]; then + echo "ok $ctr - instances cleaned up on SIGINT, timeout and action failure # SKIP $skip" + return + fi + printf '%s\n' "$out" | sed -n 's/^note: /# note: /p' + echo "ok $ctr - instances cleaned up on SIGINT, timeout and action failure" + elif [ $rc -eq 124 ] || [ $rc -eq 137 ]; then + echo "not ok $ctr - instances cleaned up on SIGINT, timeout and action failure" + echo "# helper timed out after 2m" + else + echo "not ok $ctr - instances cleaned up on SIGINT, timeout and action failure" + echo "# helper exited $rc" + printf '%s\n' "$out" | while read -r line; do + echo "# $line" + done + fi +} + +run_cleanup_cases + +test_end diff --git a/tools/tracing/rtla/tests/scripts/check-cleanup.sh b/tools/tracing/rtla/tests/scripts/check-cleanup.sh new file mode 100755 index 000000000..c27db96cd --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-cleanup.sh @@ -0,0 +1,211 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Verify that rtla removes the tracefs instances it created, even when it is +# interrupted (SIGINT/SIGTERM), killed by its own timeout, or when a shell +# action fails. +# +# This is a *test* for tools/tracing/rtla; it does not change rtla behaviour. +# +# Requires: root, tracefs mounted at /sys/kernel/tracing, CONFIG_OSNOISE_TRACER. +# Usage: rtla_cleanup_test.sh /path/to/rtla + +RTLA=${1:-rtla} +TRACEFS=${TRACEFS:-/sys/kernel/tracing} +INSTANCES=$TRACEFS/instances +FAIL=0 +PASS=0 + +log() { printf '%s\n' "$*"; } +pass() { PASS=$((PASS+1)); log "PASS: $*"; } +fail() { FAIL=$((FAIL+1)); log "FAIL: $*"; } +cleanup_all() { + for i in osnoise_top osnoise_hist timerlat_top timerlat_hist hwnoise_top; do + [ -d "$INSTANCES/$i" ] && rmdir "$INSTANCES/$i" 2>/dev/null + done +} + +# Wait up to $2 ms for $1 to disappear. +wait_gone() { + _path=$1 + _ms=${2:-5000} + _i=0 + while [ -d "$_path" ] && [ $_i -lt $_ms ]; do + sleep 0.05 + _i=$((_i+50)) + done + [ ! -d "$_path" ] +} + +# Wait until $1 exists (up to $2 ms). +wait_present() { + _path=$1 + _ms=${2:-10000} + _i=0 + while [ ! -d "$_path" ] && [ $_i -lt $_ms ]; do + sleep 0.05 + _i=$((_i+50)) + done + [ -d "$_path" ] +} + +if [ ! -d "$INSTANCES" ] || [ ! -w "$INSTANCES" ] || + [ ! -d "$TRACEFS/osnoise" ]; then + log "SKIP: tracefs, writable instances or CONFIG_OSNOISE_TRACER unavailable" + exit 0 +fi + +# Leave nothing behind from the test before it starts, and make sure the +# command under test is actually usable. +# +# rtla has no --version: main() only knows -h/--help and -usage, and anything +# else falls through to rtla_usage(), which exits 129 after printing the +# version banner. Probing --version therefore always failed and the whole test +# suite silently reported SKIP. Accept 129 as "this binary works". +cleanup_all +if [ ! -x "$RTLA" ]; then + log "SKIP: $RTLA is not executable" + exit 0 +fi +help_out=$("$RTLA" --help 2>&1) +rtla_rc=$? +if [ "$rtla_rc" -ne 129 ] || + ! printf '%s\n' "$help_out" | grep -q 'rtla version'; then + log "SKIP: $RTLA is not usable (--help exited $rtla_rc, no version banner)" + exit 0 +fi + +# Kill a background rtla if a case fails before reaping it. +stop_pid() { + [ -n "$1" ] || return + kill -KILL "$1" 2>/dev/null + wait "$1" 2>/dev/null +} + +# Wait for an rtla instance and its signal handler. The instance appears +# before set_signals() runs, so wait for rtla to start its workload (or at +# least for it to survive a short grace period) before sending SIGINT. +wait_running() { + _path=$1 + _pid=$2 + wait_present "$_path" 10000 || return 1 + sleep 1 + kill -0 "$_pid" 2>/dev/null +} + +# --------------------------------------------------------------------------- +# 1. SIGINT during a long run +# --------------------------------------------------------------------------- +cleanup_all +$RTLA osnoise top -q -d 30s -P F:1 >/dev/null 2>&1 & +pid=$! +if ! wait_running "$INSTANCES/osnoise_top" "$pid"; then + fail "SIGINT: instance was never created (rtla did not start?)" + stop_pid "$pid" +else + kill -INT "$pid" 2>/dev/null + wait "$pid" 2>/dev/null + if wait_gone "$INSTANCES/osnoise_top"; then + pass "SIGINT: instance removed after interrupt" + else + fail "SIGINT: instance still present after interrupt" + fi +fi + +# --------------------------------------------------------------------------- +# 2. SIGTERM during a long run +# --------------------------------------------------------------------------- +cleanup_all +$RTLA osnoise top -q -d 30s -P F:1 >/dev/null 2>&1 & +pid=$! +if ! wait_running "$INSTANCES/osnoise_top" "$pid"; then + fail "SIGTERM: instance was never created (rtla did not start)" + stop_pid "$pid" +else + kill -TERM "$pid" 2>/dev/null + wait "$pid" 2>/dev/null + if wait_gone "$INSTANCES/osnoise_top"; then + pass "SIGTERM: instance removed after terminate" + else + fail "SIGTERM: instance still present after terminate" + fi +fi + +# --------------------------------------------------------------------------- +# 3. rtla's own -d timeout path +# --------------------------------------------------------------------------- +cleanup_all +$RTLA osnoise top -q -d 2s -P F:1 >/dev/null 2>&1 +rc=$? +if [ "$rc" -ne 0 ]; then + fail "self-timeout: rtla failed to start or run (exit=$rc)" +elif wait_gone "$INSTANCES/osnoise_top"; then + pass "self-timeout: instance removed (exit=$rc)" +else + fail "self-timeout: instance still present (exit=$rc)" +fi + +# --------------------------------------------------------------------------- +# 4. shell action failure (-a / --on-threshold shell,command=...) +# --------------------------------------------------------------------------- +# -S is the stop-total threshold and yields exit 2 when the action fails. +# A shell action only runs if that threshold is crossed; an idle machine may +# never do so. Do not call the no-threshold case a pass. +cleanup_all +action_rc=0 +for n in 1 2 3; do + $RTLA osnoise top -q -d 5s -P F:1 -r 900000 -S 1 \ + --on-threshold 'shell,command="/bin/false"' >/dev/null 2>&1 + rc=$? + action_rc=$rc + [ "$rc" -eq 2 ] && break +done +if [ "$action_rc" -eq 0 ]; then + # Not a group-level skip: the other cases still ran. Prefix it so the + # TAP wrapper does not report the whole test as skipped. + log "note: action-failure: stop-total threshold was not crossed" +elif [ "$action_rc" -ne 2 ]; then + fail "action-failure: unexpected exit=$action_rc (wanted 2)" +elif wait_gone "$INSTANCES/osnoise_top"; then + pass "action-failure: instance removed (exit=$action_rc)" +else + fail "action-failure: instance still present (exit=$action_rc)" +fi + +# --------------------------------------------------------------------------- +# 5. repeated interrupted runs must not poison the next run +# --------------------------------------------------------------------------- +cleanup_all +for n in 1 2 3; do + $RTLA osnoise top -q -d 20s -P F:1 >/dev/null 2>&1 & + pid=$! + if ! wait_running "$INSTANCES/osnoise_top" "$pid"; then + fail "repeated interrupts: run $n never created an instance" + stop_pid "$pid" + continue + fi + kill -INT "$pid" 2>/dev/null + wait "$pid" 2>/dev/null + if ! wait_gone "$INSTANCES/osnoise_top"; then + fail "repeated interrupts: run $n left an instance behind" + cleanup_all + fi +done + +$RTLA osnoise top -q -d 2s -P F:1 >/dev/null 2>&1 +rc=$? +if [ "$rc" -eq 0 ]; then + pass "repeated interrupts: following run still succeeds" +else + fail "repeated interrupts: following run failed (exit=$rc)" +fi +if wait_gone "$INSTANCES/osnoise_top"; then + pass "repeated interrupts: no leftover instance" +else + fail "repeated interrupts: leftover instance" +fi + +cleanup_all +log "" +log "SUMMARY: $PASS passed, $FAIL failed" +[ "$FAIL" -eq 0 ] -- 2.43.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 2/2] rtla/tests: cover cleanup on abnormal exits 2026-11-21 11:31 ` [PATCH v3 2/2] rtla/tests: cover cleanup on " Chaosheng Qu @ 2026-11-21 11:47 ` sashiko-bot 0 siblings, 0 replies; 4+ messages in thread From: sashiko-bot @ 2026-11-21 11:47 UTC (permalink / raw) To: Chaosheng Qu, linux-trace-kernel Thank you for your contribution! Sashiko AI review found 5 potential issues to consider: - [Medium] rtla/tests: CPU starvation from -P F:1 on all CPUs at 100% runtime - [Medium] rtla/tests: signal startup race in wait_running() and unbounded wait - [Medium] rtla/tests: false skip on broken binary and unchecked wait status - [Low] rtla/tests: broken tracefs writability check via reset_osnoise() - [Low] rtla/tests: wrong instance list in cleanup_all() and stale comments -- commit 110e2919f0e6845113d98a17c558268bc9141671 Author: Chaosheng Qu <chaosheng.qu.linux@gmail.com> rtla/tests: cover cleanup on abnormal exits This commit adds a TAP test and helper script verifying that rtla removes its tracefs instance on SIGINT, SIGTERM, duration timeout, and threshold action failure. > diff --git a/tools/tracing/rtla/tests/cleanup.t b/tools/tracing/rtla/tests/cleanup.t > new file mode 100644 > index 0000000000000..176b1a96f87d5 > --- /dev/null > +++ b/tools/tracing/rtla/tests/cleanup.t [ ... ] > + # check() normally does this before every test. Do the same here, both to > + # leave a clean tracer state and to make a hung helper terminate. > + reset_osnoise || { > + echo "ok $ctr - instances cleaned up on SIGINT, timeout and action failure # SKIP tracefs is not writable" > + return > + } [Severity: Low] Does reset_osnoise() ever return non-zero when tracefs is searchable (mode 0755) but not writable, or when CONFIG_OSNOISE_TRACER is disabled? In tools/tracing/rtla/tests/engine.sh, reset_osnoise() only returns 1 if "pushd /sys/kernel/tracing" fails; it ignores write and cd errors and returns the exit status of the final popd (0). When run as non-root or without /sys/kernel/tracing/osnoise, reset_osnoise() emits uncaptured stderr errors (and tries to create files like cpus and period_us inside /sys/kernel/tracing/instances after "cd ../osnoise" fails) instead of skipping cleanly. Also, run_cleanup_cases() does not call reset_osnoise() after check-cleanup.sh fails or times out to restore the tracer state. [ ... ] > diff --git a/tools/tracing/rtla/tests/scripts/check-cleanup.sh b/tools/tracing/rtla/tests/scripts/check-cleanup.sh > new file mode 100755 > index 0000000000000..c27db96cd556a > --- /dev/null > +++ b/tools/tracing/rtla/tests/scripts/check-cleanup.sh > @@ -0,0 +1,211 @@ [ ... ] > +# Requires: root, tracefs mounted at /sys/kernel/tracing, CONFIG_OSNOISE_TRACER. > +# Usage: rtla_cleanup_test.sh /path/to/rtla > + > +RTLA=${1:-rtla} > +TRACEFS=${TRACEFS:-/sys/kernel/tracing} > +INSTANCES=$TRACEFS/instances > +FAIL=0 > +PASS=0 > + > +log() { printf '%s\n' "$*"; } > +pass() { PASS=$((PASS+1)); log "PASS: $*"; } > +fail() { FAIL=$((FAIL+1)); log "FAIL: $*"; } > +cleanup_all() { > + for i in osnoise_top osnoise_hist timerlat_top timerlat_hist hwnoise_top; do > + [ -d "$INSTANCES/$i" ] && rmdir "$INSTANCES/$i" 2>/dev/null > + done > +} [Severity: Low] Does rtla ever create an instance named hwnoise_top, and should cleanup_all() include osnoise_trace and timerlat_aa instead? hwnoise_main() uses osnoise_top_ops and creates osnoise_top, while rtla also creates auxiliary osnoise_trace and timerlat_aa instances that cleanup_all() currently leaves behind. Also, the usage comment above names rtla_cleanup_test.sh instead of check-cleanup.sh, the comment on --help below claims main() recognizes -usage and references an earlier --version draft, and the comment on -S says it yields exit 2 when the action fails whereas run_tool() exits 2 whenever -S stops tracing. [ ... ] > +cleanup_all > +if [ ! -x "$RTLA" ]; then > + log "SKIP: $RTLA is not executable" > + exit 0 > +fi > +help_out=$("$RTLA" --help 2>&1) > +rtla_rc=$? > +if [ "$rtla_rc" -ne 129 ] || > + ! printf '%s\n' "$help_out" | grep -q 'rtla version'; then > + log "SKIP: $RTLA is not usable (--help exited $rtla_rc, no version banner)" > + exit 0 > +fi [Severity: Medium] Should a missing or broken $RTLA binary fail the test rather than exiting 0 with "SKIP:"? Because cleanup.t turns any "SKIP:" line on exit 0 into a passing "ok ... # SKIP" TAP result, a broken rtla build that crashes or fails on --help is reported as a test skip instead of a failure. In addition, when check-cleanup.sh is run standalone with its default RTLA=rtla, '[ ! -x "$RTLA" ]' checks only the current working directory rather than PATH. Also, in the SIGINT, SIGTERM, and repeated-interrupt cases below, 'wait "$pid"' ignores rtla's exit status, so an error exit (status 1) that cleans up the instance on the error-unwind path is reported as PASS. Finally, check-cleanup.sh sets no EXIT/INT/TERM trap to kill a background $pid and run cleanup_all() if killed by timeout, and cleanup.t discards $out when timeout exits with 124 or 137. > + > +# Kill a background rtla if a case fails before reaping it. > +stop_pid() { > + [ -n "$1" ] || return > + kill -KILL "$1" 2>/dev/null > + wait "$1" 2>/dev/null > +} > + > +# Wait for an rtla instance and its signal handler. The instance appears > +# before set_signals() runs, so wait for rtla to start its workload (or at > +# least for it to survive a short grace period) before sending SIGINT. > +wait_running() { > + _path=$1 > + _pid=$2 > + wait_present "$_path" 10000 || return 1 > + sleep 1 > + kill -0 "$_pid" 2>/dev/null > +} > + > +# --------------------------------------------------------------------------- > +# 1. SIGINT during a long run > +# --------------------------------------------------------------------------- > +cleanup_all > +$RTLA osnoise top -q -d 30s -P F:1 >/dev/null 2>&1 & [Severity: Medium] Can running "osnoise top ... -P F:1" without -c or -r starve SCHED_OTHER tasks across all CPUs? When -r and -p are omitted, osnoise_apply_config() configures a 100% duty cycle (1000000 us runtime per 1000000 us period), and omitting -c places SCHED_FIFO:1 osnoise/N kernel threads on every online CPU without moving rtla to a housekeeping CPU. On a kernel with RT throttling or the fair DL server disabled this hangs the system until the 2-minute timeout fires, and even with default RT throttling it consumes 95% of every CPU. Existing tests in osnoise.t and hwnoise.t pass "-c 0 -r 900000" when using "-P F:1" so a CPU and period headroom remain available for user tasks. > +pid=$! > +if ! wait_running "$INSTANCES/osnoise_top" "$pid"; then > + fail "SIGINT: instance was never created (rtla did not start?)" > + stop_pid "$pid" > +else > + kill -INT "$pid" 2>/dev/null > + wait "$pid" 2>/dev/null > + if wait_gone "$INSTANCES/osnoise_top"; then > + pass "SIGINT: instance removed after interrupt" > + else > + fail "SIGINT: instance still present after interrupt" > + fi > +fi [Severity: Medium] Can wait_running() return before run_tool() calls set_signals(), and does the unbounded 'wait "$pid"' mask broken SIGINT or SIGTERM handling? In tools/tracing/rtla/src/common.c, run_tool() creates the instances/osnoise_top directory inside ops->init_tool() at the start of initialization, then parses all tracefs events, configures osnoise, spawns per-CPU osnoise kernel threads, scans /proc/*/comm for "-P F:1", and enables tracing before installing signal handlers: tools/tracing/rtla/src/common.c:run_tool() { ... retval = ops->enable(tool); if (retval) goto out_trace; tool->start_time = time(NULL); set_signals(params); ... } If initialization takes longer than the 1-second sleep in wait_running(), SIGTERM hits SIG_DFL and kills rtla before set_signals() runs (leaking osnoise_top), while SIGINT is ignored because background jobs in a non-interactive shell inherit SIG_IGN for SIGINT until set_signals() overrides it. Then, because 'wait "$pid"' runs without a timeout before wait_gone, an ignored or broken signal simply blocks for 20-30 seconds until rtla's own "-d 30s" SIGALRM timer stops tracing and removes the instance, causing wait_gone to report a false PASS. -- Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795258353.git.chaosheng.qu.linux@gmail.com?part=2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 1/2] rtla: handle SIGTERM during a run 2026-11-21 11:31 [PATCH v3 0/2] rtla: handle SIGTERM and test abnormal exits Chaosheng Qu 2026-11-21 11:31 ` [PATCH v3 2/2] rtla/tests: cover cleanup on " Chaosheng Qu @ 2026-11-21 11:31 ` Chaosheng Qu 1 sibling, 0 replies; 4+ messages in thread From: Chaosheng Qu @ 2026-11-21 11:31 UTC (permalink / raw) To: linux-trace-kernel; +Cc: Steven Rostedt, Tomas Glozar, linux-kernel rtla installs a handler for SIGINT, and for SIGALRM when a duration is given, but not for SIGTERM. A run stopped by the system - a shutdown or a service manager - therefore dies without going through the cleanup path and leaves its tracefs instance behind, so the next invocation finds the instance name in use. Install the same handler for SIGTERM, and restore the default disposition in unset_signals(). Fixes: 2f3172f9dd58 ("tools/rtla: Consolidate code between osnoise/timerlat and hist/top") Signed-off-by: Chaosheng Qu <chaosheng.qu.linux@gmail.com> --- tools/tracing/rtla/src/common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/tracing/rtla/src/common.c b/tools/tracing/rtla/src/common.c index 8c7f5e75b..b86a60076 100644 --- a/tools/tracing/rtla/src/common.c +++ b/tools/tracing/rtla/src/common.c @@ -39,6 +39,7 @@ static void stop_trace(int sig) static void set_signals(struct common_params *params) { signal(SIGINT, stop_trace); + signal(SIGTERM, stop_trace); if (params->duration) { signal(SIGALRM, stop_trace); alarm(params->duration); @@ -51,6 +52,7 @@ static void set_signals(struct common_params *params) static void unset_signals(struct common_params *params) { signal(SIGINT, SIG_DFL); + signal(SIGTERM, SIG_DFL); if (params->duration) { alarm(0); signal(SIGALRM, SIG_DFL); -- 2.43.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-21 11:47 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-11-21 11:31 [PATCH v3 0/2] rtla: handle SIGTERM and test abnormal exits Chaosheng Qu 2026-11-21 11:31 ` [PATCH v3 2/2] rtla/tests: cover cleanup on " Chaosheng Qu 2026-11-21 11:47 ` sashiko-bot 2026-11-21 11:31 ` [PATCH v3 1/2] rtla: handle SIGTERM during a run Chaosheng Qu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).