tracing: Use in_serving_softirq() to deduct softirq status.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 25 Jan 2021 19:45:10 +0000 (20:45 +0100)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 2 Feb 2021 22:02:06 +0000 (17:02 -0500)
commitfe427886bf41279085e0707cced41150dbcd8512
tree20577d28c052e895e9ed58e7e1df35181471c52a
parent0c02006e6f5b0a3e73499bbf5943d9174c5ed640
tracing: Use in_serving_softirq() to deduct softirq status.

PREEMPT_RT does not report "serving softirq" because the tracing core
looks at the preemption counter while PREEMPT_RT does not update it
while processing softirqs in order to remain preemptible. The
information is stored somewhere else.
The in_serving_softirq() macro and the SOFTIRQ_OFFSET define are still
working but not on the preempt-counter.

Use in_serving_softirq() macro which works on PREEMPT_RT. On !PREEMPT_RT
the compiler (gcc-10 / clang-11) is smart enough to optimize the
in_serving_softirq() related read of the preemption counter away.
The only difference I noticed by using in_serving_softirq() on
!PREEMPT_RT is that gcc-10 implemented tracing_gen_ctx_flags() as
reading FLAG, jmp _tracing_gen_ctx_flags(). Without in_serving_softirq()
it inlined _tracing_gen_ctx_flags() into tracing_gen_ctx_flags().

Link: https://lkml.kernel.org/r/20210125194511.3924915-4-bigeasy@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c