RFC tracing: Using recursion bits for function tracing and ring buffer
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest8 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | ftrace: Fix global function tracers that are not recursion safekernel/ | +16 | 0 replies | |
| 2/8 | ftrace: Fix function tracing recursion self testkernel/ | +2 | 0 replies | |
| 3/8 | ftrace: Optimize the function tracer list loopkernel/ | +26 | 0 replies | |
| 4/8 | ftrace: Add context level recursion bit checkingkernel/ kernel/ | +42 | 0 replies | |
| 5/8 | tracing: Make the trace recursion bits into enumskernel/ | +17 | 0 replies | |
| 6/8 | tracing: Avoid unnecessary multiple recursion checkskernel/ kernel/ | +110 | 0 replies | |
| 7/8 | ftrace: Use only the preempt version of function tracingkernel/ | +14 | 0 replies | |
| 8/8 | ring-buffer: User context bit recursion checkingkernel/ kernel/ | +67 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/8][RFC] tracing: Using recursion bits for function tracing and ring buffer
A couple of months ago I was playing with getting recursion fixed with the function tracer. There's a lot of places that could use improvements, and I also found a few cases where the recursion protection would have false positives causing missed function tracing.
I implemented a per context bit checking (Normal, SoftIRQ, IRQ and NMI). Using 4 bits in the task_struct trace_recursion field, I was able to fix these issues as well as improve the speed of the function tracer and ring buffer.
Before the patches I had:
# echo function > /debug/tracing/current_tracer # for i in `seq 10`; do ./hackbench 50; done Time: 12.028 Time: 11.945 Time: 11.925 Time: 11.964 Time: 12.002 Time: 11.910 Time: 11.944 Time: 11.929 Time: 11.941 Time: 11.924
(average: 11.9512)
Now we have:
# echo function > /debug/tracing/current_tracer # for i in `seq 10`; do ./hackbench 50; done Time: 9.712 Time: 9.824 Time: 9.861 Time: 9.827 Time: 9.962 Time: 9.905 Time: 9.886 Time: 10.088 Time: 9.861 Time: 9.834
(average: 9.876)
This is a total of a 17.4% improvement in function tracing!
Steven Rostedt (8):
ftrace: Fix global function tracers that are not recursion safe
ftrace: Fix function tracing recursion self test
ftrace: Optimize the function tracer list loop
ftrace: Add context level recursion bit checking
tracing: Make the trace recursion bits into enums
tracing: Avoid unnecessary multiple recursion checks
ftrace: Use only the preempt version of function tracing
ring-buffer: User context bit recursion checking
----
kernel/trace/ftrace.c | 82 ++++++++++++++++--------- kernel/trace/ring_buffer.c | 85 +++++++++++++++++-------- kernel/trace/trace.h | 133 ++++++++++++++++++++++++++++++++++++---- kernel/trace/trace_functions.c | 61 +++++------------- kernel/trace/trace_selftest.c | 3 +- 5 files changed, 248 insertions(+), 116 deletions(-)