]> git.ipfire.org Git - people/ms/linux.git/blobdiff - kernel/trace/trace_osnoise.c
Merge tag 'trace-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[people/ms/linux.git] / kernel / trace / trace_osnoise.c
index afb92e2f0aeab5327a727d464e9150815050feba..313439920a8ce90d27f13eab9931c08e29ebaf2b 100644 (file)
@@ -1578,11 +1578,27 @@ static enum hrtimer_restart timerlat_irq(struct hrtimer *timer)
 
        trace_timerlat_sample(&s);
 
-       notify_new_max_latency(diff);
+       if (osnoise_data.stop_tracing) {
+               if (time_to_us(diff) >= osnoise_data.stop_tracing) {
+
+                       /*
+                        * At this point, if stop_tracing is set and <= print_stack,
+                        * print_stack is set and would be printed in the thread handler.
+                        *
+                        * Thus, print the stack trace as it is helpful to define the
+                        * root cause of an IRQ latency.
+                        */
+                       if (osnoise_data.stop_tracing <= osnoise_data.print_stack) {
+                               timerlat_save_stack(0);
+                               timerlat_dump_stack(time_to_us(diff));
+                       }
 
-       if (osnoise_data.stop_tracing)
-               if (time_to_us(diff) >= osnoise_data.stop_tracing)
                        osnoise_stop_tracing();
+                       notify_new_max_latency(diff);
+
+                       return HRTIMER_NORESTART;
+               }
+       }
 
        wake_up_process(tlat->kthread);