From: Tomas Glozar <tglozar@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
John Kacur <jkacur@redhat.com>,
Luis Goncalves <lgoncalv@redhat.com>,
Gabriele Monaco <gmonaco@redhat.com>,
Tomas Glozar <tglozar@redhat.com>
Subject: [PATCH 4/5] rtla/timerlat_hist: Abort event processing on second signal
Date: Thu, 16 Jan 2025 15:49:30 +0100 [thread overview]
Message-ID: <20250116144931.649593-5-tglozar@redhat.com> (raw)
In-Reply-To: <20250116144931.649593-1-tglozar@redhat.com>
If either SIGINT is received twice, or after a SIGALRM (that is, after
timerlat was supposed to stop), abort processing events currently left
in the tracefs buffer and exit immediately.
This allows the user to exit rtla without waiting for processing all
events, should that take longer than wanted, at the cost of not
processing all samples.
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
---
tools/tracing/rtla/src/timerlat_hist.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c
index e8d249e22251..d0a4d20b7196 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -1149,6 +1149,14 @@ static int stop_tracing;
static struct trace_instance *hist_inst = NULL;
static void stop_hist(int sig)
{
+ if (stop_tracing) {
+ /*
+ * Stop requested twice in a row; abort event processing and
+ * exit immediately
+ */
+ tracefs_iterate_stop(hist_inst->inst);
+ return;
+ }
stop_tracing = 1;
if (hist_inst)
trace_instance_stop(hist_inst);
--
2.47.1
next prev parent reply other threads:[~2025-01-16 14:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 14:49 [PATCH 0/5] rtla/timerlat: Stop on signal properly when overloaded Tomas Glozar
2025-01-16 14:49 ` [PATCH 1/5] rtla: Add trace_instance_stop Tomas Glozar
2025-01-16 14:49 ` [PATCH 2/5] rtla/timerlat_hist: Stop timerlat tracer on signal Tomas Glozar
2025-01-16 14:49 ` [PATCH 3/5] rtla/timerlat_top: " Tomas Glozar
2025-01-17 0:56 ` Steven Rostedt
2025-01-17 7:13 ` Tomas Glozar
2025-01-17 10:50 ` Steven Rostedt
2025-01-16 14:49 ` Tomas Glozar [this message]
2025-01-16 14:49 ` [PATCH 5/5] rtla/timerlat_top: Abort event processing on second signal Tomas Glozar
2025-01-17 0:57 ` Steven Rostedt
2025-01-17 6:58 ` Gabriele Monaco
2025-01-17 0:46 ` [PATCH 0/5] rtla/timerlat: Stop on signal properly when overloaded Steven Rostedt
2025-01-17 12:04 ` Tomas Glozar
2025-01-17 15:29 ` Steven Rostedt
2025-01-17 15:55 ` Tomas Glozar
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=20250116144931.649593-5-tglozar@redhat.com \
--to=tglozar@redhat.com \
--cc=gmonaco@redhat.com \
--cc=jkacur@redhat.com \
--cc=lgoncalv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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