Linux Trace Kernel
 help / color / mirror / Atom feed
* [PATCH 1/4] rtla/actions: Restore continue flag in actions_perform()
@ 2026-05-26 10:25 Tomas Glozar
  2026-05-26 10:25 ` [PATCH 2/4] rtla/tests: Add unit test for restoring continue flag Tomas Glozar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tomas Glozar @ 2026-05-26 10:25 UTC (permalink / raw)
  To: Steven Rostedt, Tomas Glozar
  Cc: John Kacur, Luis Goncalves, Crystal Wood, Costa Shulyupin,
	Wander Lairson Costa, LKML, linux-trace-kernel

Currently, actions_perform() only ever sets the continue flag (when
performing the continue action), but never resets it. That leads to
RTLA continuing tracing even if the continue action was not performed in
the current iteration.

For example, the following command:

$ rtla timerlat hist -T 100 --on-threshold shell,command='
    echo Spike!
    if [ -f /tmp/a ]
    then
      exit 1
    else
      touch /tmp/a
    fi' --on-threshold continue

should print Spike! at most once, because after hitting the threshold
for the first time, /tmp/a exists, the shell action will fail, and the
continue action is not performed. However, unless /tmp/a exists before
the measurement, it will print Spike! until stopped, as the continue
flag stays set.

Set the continue flag to false in the beginning of actions_perform() to
make RTLA continue only if the action was actually performed.

Fixes: 8d933d5c89e ("rtla/timerlat: Add continue action")
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
---
 tools/tracing/rtla/src/actions.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/tracing/rtla/src/actions.c b/tools/tracing/rtla/src/actions.c
index b0d68b5de08d..bf13d9d68f16 100644
--- a/tools/tracing/rtla/src/actions.c
+++ b/tools/tracing/rtla/src/actions.c
@@ -247,6 +247,8 @@ actions_perform(struct actions *self)
 	int pid, retval;
 	const struct action *action;
 
+	self->continue_flag = false;
+
 	for_each_action(self, action) {
 		switch (action->type) {
 		case ACTION_TRACE_OUTPUT:
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-26 10:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 10:25 [PATCH 1/4] rtla/actions: Restore continue flag in actions_perform() Tomas Glozar
2026-05-26 10:25 ` [PATCH 2/4] rtla/tests: Add unit test for restoring continue flag Tomas Glozar
2026-05-26 10:25 ` [PATCH 3/4] rtla/tests: Run runtime tests in temporary directory Tomas Glozar
2026-05-26 10:25 ` [PATCH 4/4] rtla/tests: Add runtime tests for restoring continue flag Tomas Glozar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox