Skip to content

Commit e11c9c8

Browse files
crwood-rhrostedt
authored andcommitted
tracing/osnoise: Dump stack on timerlat uret threshold event
Dump the saved IRQ stack trace regardless of whether the event was THREAD_CONTEXT or THREAD_URET. In the uret case, the latency presumably had not yet crossed the threshold at IRQ time (or else it would have dumped the stack at thread wakeup time, unless we're racing with a change to the threshold), but it may have at least contributed -- and this is possible with THREAD_CONTEXT as well. In any case, it helps with writing reliable rtla tests if we always get a stack trace on a threshold event. Cc: John Kacur <jkacur@redhat.com> Cc: Tomas Glozar <tglozar@redhat.com> Cc: Costa Shulyupin <costa.shul@redhat.com> Cc: Wander Lairson Costa <wander@redhat.com> Link: https://patch.msgid.link/20260511223143.1477332-1-crwood@redhat.com Signed-off-by: Crystal Wood <crwood@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 5200f5f commit e11c9c8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

kernel/trace/trace_osnoise.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,9 +2544,12 @@ timerlat_fd_read(struct file *file, char __user *ubuf, size_t count,
25442544
notify_new_max_latency(diff);
25452545

25462546
tlat->tracing_thread = false;
2547-
if (osnoise_data.stop_tracing_total)
2548-
if (time_to_us(diff) >= osnoise_data.stop_tracing_total)
2547+
if (osnoise_data.stop_tracing_total) {
2548+
if (time_to_us(diff) >= osnoise_data.stop_tracing_total) {
2549+
timerlat_dump_stack(time_to_us(diff));
25492550
osnoise_stop_tracing();
2551+
}
2552+
}
25502553
} else {
25512554
tlat->tracing_thread = false;
25522555
tlat->kthread = current;

0 commit comments

Comments
 (0)