tracing/timerlat: Notify IRQ new max latency only if stop tracing is set
authorDaniel Bristot de Oliveira <bristot@kernel.org>
Tue, 10 May 2022 09:45:23 +0000 (11:45 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 27 May 2022 01:13:00 +0000 (21:13 -0400)
commitaa748949b4e665f473bc5abdc5f66029cb5f5522
treea5cd6b1b9dbb3b3307b488f5c4d133cbf2192584
parent43994049180704fd1faf78623fabd9a5cd443708
tracing/timerlat: Notify IRQ new max latency only if stop tracing is set

Currently, the notification of a new max latency is sent from
timerlat's IRQ handler anytime a new max latency is found.

While this behavior is not wrong, the send IPI overhead itself
will increase the thread latency and that is not the desired
effect (tracing overhead).

Moreover, the thread will notify a new max latency again because
the thread latency as it is always higher than the IRQ latency
that woke it up.

The only case in which it is helpful to notify a new max latency
from IRQ is when stop tracing (for the IRQ) is set, as in this
case, the thread will not be dispatched.

Notify a new max latency from the IRQ handler only if stop tracing is
set for the IRQ handler.

Link: https://lkml.kernel.org/r/2c2d9a56c0886c8402ba320de32856cbbb10c2bb.1652175637.git.bristot@kernel.org
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Reported-by: Clark Williams <williams@redhat.com>
Fixes: a955d7eac177 ("trace: Add timerlat tracer")
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_osnoise.c