Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
tracing: Merge irqflags + preemt counter, add RT bits
PREEMPT_RT never reported "serving softirq". I took a look to see if it
could be changed. The tracing infrastructure examinates the preemtion
counter for that. PREEMPT_RT does not change the preemption counter
while disabling the bottom half or serving the softirqs in order to
remain preemptible. The in_serving_softirq() macro and the SOFTIRQ_OFFSET
define are still working but not on the preempt-counter.
I started to look how to integrate the RT bits regarding softirq.
The state of the interrupts (irqflags) and the preemption counter are
passed down to tracing_generic_entry_update(). However only one bit of
irqflags is actually required: The on/off state.
The irqflags and the preemption counter could be evaluated early and the
information stored in an integer `trace_ctx'.
tracing_generic_entry_update() would use the upper bits as the
TRACE_FLAG_* and the lower 16bit as the preemption counter (considering
that 1 must be substracted from the counter in some cases).
Whith this change the preemption counter is read in one place and the
relevant RT bits for softirq can be set there.
The actual preemption value is not used except for the tracing record.
The `irqflags' is also not used except for the _irqsave() locking in a
few spots.
As part of the patch I added __ to trace_event_buffer_commit() while
evaluating trace_event_buffer() for the struct trace_event_buffer usage
regarding the `pc' and `flags' members. It appears that those two can
also be merged into the `trace_ctx' integer.
With this change the callchain passes one argument less and evaluates
the flags early. A build with all tracers enabled on x86-64 with and
without the patch:
text data bss dec hex filename
24301717 22148594 13996284 60446595 39a5783 vmlinux.old
24301248 22148850 13996284 60446382 39a56ae vmlinux.new
data increased by 256 bytes, text shrank by 469 bytes.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>- Loading branch information