diff options
author | Steven Rostedt <srostedt@redhat.com> | 2012-11-02 18:33:05 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-01-22 23:38:03 -0500 |
commit | 567cd4da54ff45513d2ca1f0e3cb9ba45b66d6cf (patch) | |
tree | 1a9e719a31643138fa76ecf556401fee1f536813 /kernel/trace/trace.h | |
parent | 897f68a48b1f8fb6cb7493e1ee37e3ed7f879937 (diff) |
ring-buffer: User context bit recursion checking
Using context bit recursion checking, we can help increase the
performance of the ring buffer.
Before this patch:
# echo function > /debug/tracing/current_tracer
# for i in `seq 10`; do ./hackbench 50; done
Time: 10.285
Time: 10.407
Time: 10.243
Time: 10.372
Time: 10.380
Time: 10.198
Time: 10.272
Time: 10.354
Time: 10.248
Time: 10.253
(average: 10.3012)
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)
a 4% savings!
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index c203a51dd412..04a2c7ab1735 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -291,11 +291,6 @@ struct tracer { | |||
291 | 291 | ||
292 | 292 | ||
293 | /* Only current can touch trace_recursion */ | 293 | /* Only current can touch trace_recursion */ |
294 | #define trace_recursion_inc() do { (current)->trace_recursion++; } while (0) | ||
295 | #define trace_recursion_dec() do { (current)->trace_recursion--; } while (0) | ||
296 | |||
297 | /* Ring buffer has the 10 LSB bits to count */ | ||
298 | #define trace_recursion_buffer() ((current)->trace_recursion & 0x3ff) | ||
299 | 294 | ||
300 | /* | 295 | /* |
301 | * For function tracing recursion: | 296 | * For function tracing recursion: |
@@ -323,7 +318,13 @@ struct tracer { | |||
323 | * caller, and we can skip the current check. | 318 | * caller, and we can skip the current check. |
324 | */ | 319 | */ |
325 | enum { | 320 | enum { |
326 | TRACE_FTRACE_BIT = 11, | 321 | TRACE_BUFFER_BIT, |
322 | TRACE_BUFFER_NMI_BIT, | ||
323 | TRACE_BUFFER_IRQ_BIT, | ||
324 | TRACE_BUFFER_SIRQ_BIT, | ||
325 | |||
326 | /* Start of function recursion bits */ | ||
327 | TRACE_FTRACE_BIT, | ||
327 | TRACE_FTRACE_NMI_BIT, | 328 | TRACE_FTRACE_NMI_BIT, |
328 | TRACE_FTRACE_IRQ_BIT, | 329 | TRACE_FTRACE_IRQ_BIT, |
329 | TRACE_FTRACE_SIRQ_BIT, | 330 | TRACE_FTRACE_SIRQ_BIT, |