Skip to content

Commit 80967b3

Browse files
lenticularis39rostedt
authored andcommitted
rtla/timerlat_top: Abort event processing on second signal
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. Cc: John Kacur <[email protected]> Cc: Luis Goncalves <[email protected]> Cc: Gabriele Monaco <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Tomas Glozar <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent d6899e5 commit 80967b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/tracing/rtla/src/timerlat_top.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,14 @@ static int stop_tracing;
903903
static struct trace_instance *top_inst = NULL;
904904
static void stop_top(int sig)
905905
{
906+
if (stop_tracing) {
907+
/*
908+
* Stop requested twice in a row; abort event processing and
909+
* exit immediately
910+
*/
911+
tracefs_iterate_stop(top_inst->inst);
912+
return;
913+
}
906914
stop_tracing = 1;
907915
if (top_inst)
908916
trace_instance_stop(top_inst);

0 commit comments

Comments
 (0)