From: Chaosheng Qu <chaosheng.qu.linux@gmail.com>
To: linux-trace-kernel@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
Tomas Glozar <tglozar@redhat.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 1/2] rtla: handle SIGTERM during a run
Date: Sat, 21 Nov 2026 19:31:27 +0800 [thread overview]
Message-ID: <328ecfadb98649f317985124b6b49bae2d356bcf.1795258353.git.chaosheng.qu.linux@gmail.com> (raw)
In-Reply-To: <cover.1795258353.git.chaosheng.qu.linux@gmail.com>
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
next prev parent reply other threads:[~2026-11-21 11:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-11-21 11:31 ` [PATCH v3 2/2] rtla/tests: cover cleanup on " Chaosheng Qu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=328ecfadb98649f317985124b6b49bae2d356bcf.1795258353.git.chaosheng.qu.linux@gmail.com \
--to=chaosheng.qu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglozar@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®