linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8][RFC] ftrace: Optimizing the function tracer
@ 2012-11-15 15:30 Steven Rostedt
  2012-11-15 15:30 ` [PATCH 1/8][RFC] ftrace: Fix global function tracers that are not recursion safe Steven Rostedt
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Steven Rostedt @ 2012-11-15 15:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
	Frederic Weisbecker

In the past I've worked on tricks to make the function tracer a bit
faster. I've lowered the overhead by 18% which is quite an improvement.
Thus, instead of only taking 11x longer in the kernel, it takes 9x ;-)

Anyway, these are the latest patches to improve function tracing and
are pretty much good to go mainline. I just wanted to do one last
RFC post before pushing them forward.

-- Steve


These patches can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
rfc/function-preempt-only-v2

Head SHA1: bf9d25e084984439cb32c1fc7cb0f1936c95c51a


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(-)


^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 0/8][RFC] tracing: Using recursion bits for function tracing and ring buffer
@ 2012-11-02 22:38 Steven Rostedt
  2012-11-02 22:38 ` [PATCH 8/8][RFC] ring-buffer: User context bit recursion checking Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2012-11-02 22:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
	Frederic Weisbecker

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(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-11-15 15:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 15:30 [PATCH 0/8][RFC] ftrace: Optimizing the function tracer Steven Rostedt
2012-11-15 15:30 ` [PATCH 1/8][RFC] ftrace: Fix global function tracers that are not recursion safe Steven Rostedt
2012-11-15 15:30 ` [PATCH 2/8][RFC] ftrace: Fix function tracing recursion self test Steven Rostedt
2012-11-15 15:30 ` [PATCH 3/8][RFC] ftrace: Optimize the function tracer list loop Steven Rostedt
2012-11-15 15:30 ` [PATCH 4/8][RFC] ftrace: Add context level recursion bit checking Steven Rostedt
2012-11-15 15:30 ` [PATCH 5/8][RFC] tracing: Make the trace recursion bits into enums Steven Rostedt
2012-11-15 15:30 ` [PATCH 6/8][RFC] tracing: Avoid unnecessary multiple recursion checks Steven Rostedt
2012-11-15 15:30 ` [PATCH 7/8][RFC] ftrace: Use only the preempt version of function tracing Steven Rostedt
2012-11-15 15:30 ` [PATCH 8/8][RFC] ring-buffer: User context bit recursion checking Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2012-11-02 22:38 [PATCH 0/8][RFC] tracing: Using recursion bits for function tracing and ring buffer Steven Rostedt
2012-11-02 22:38 ` [PATCH 8/8][RFC] ring-buffer: User context bit recursion checking Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).