public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Bird <tim.bird@am.sony.com>
To: "rostedt@goodmis.org" <rostedt@goodmis.org>
Cc: "Bird, Tim" <Timothy.Bird@am.sony.com>,
	Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Li Zefan <lizf@cn.fujitsu.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux kernel <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 2/4] ftrace - add function_duration tracer
Date: Thu, 10 Dec 2009 14:36:51 -0800	[thread overview]
Message-ID: <4B217803.6080407@am.sony.com> (raw)
In-Reply-To: <1260482698.2146.234.camel@gandalf.stny.rr.com>

Steven Rostedt wrote:
>> I'm a little worried about this.  ftrace is already an order
>> of magnitude more overhead than the previous tracer I was using.
> 
> Which tracer was that? I know you used the -finstrument-functions for
> tracing before, and that has quite a bit overhead as well. The ring
> buffer has gone through a lot to speed it up.

KFT.  It used -finstrument-functions, which did result in
a few more instructions per call site than mcount does.  However,
the code paths in KFT are much shorter than in ftrace.
And the fact that both function exit and entry are instrumented
meant that I didn't have to do funky trampoline junk, or
manage a separate structure, in order to capture function
exit events.

It is somewhat to be expected that ftrace would have higher
overhead, because ftrace does more. But in the version
of code I was using (which is probably quite old), there
was lots of extraneous code in the hot path.
For example, there are at least 4 checks in the code
to detect whether tracing is active or not.

The ring buffer code was particularly slow.  I was using
a simple fixed-size array in KFT (on a uniprocessor), and
the time to save an event was under 1 microsecond.  With
ftrace on the same hardware, it costs about 6 microseconds
to save an event.
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================


  parent reply	other threads:[~2009-12-10 22:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 22:40 [PATCH 2/4] ftrace - add function_duration tracer Tim Bird
2009-12-10  7:08 ` Ingo Molnar
2009-12-10 12:03   ` Frederic Weisbecker
2009-12-10 14:11     ` Ingo Molnar
2009-12-10 14:53       ` Steven Rostedt
2009-12-10 15:38         ` Ingo Molnar
2009-12-10 16:22           ` Steven Rostedt
2009-12-10 16:52             ` Ingo Molnar
2009-12-10 17:16               ` Steven Rostedt
2009-12-10 17:28           ` Frank Ch. Eigler
2009-12-10 17:57             ` Ingo Molnar
2009-12-10 18:04               ` Frank Ch. Eigler
2009-12-10 18:35                 ` Ingo Molnar
2009-12-10 18:50                   ` Frank Ch. Eigler
2009-12-10 20:14                     ` Ingo Molnar
2009-12-10 21:30                       ` Frank Ch. Eigler
2009-12-10 14:29     ` Steven Rostedt
2009-12-10 16:16       ` Ingo Molnar
2009-12-10 20:23       ` Frederic Weisbecker
2009-12-10 21:55         ` Steven Rostedt
2009-12-10 22:40           ` Frederic Weisbecker
2009-12-10 21:13   ` Tim Bird
2009-12-10 22:04     ` Steven Rostedt
2009-12-10 22:26       ` Tim Bird
2009-12-10 22:36       ` Tim Bird [this message]
2009-12-10 23:47         ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B217803.6080407@am.sony.com \
    --to=tim.bird@am.sony.com \
    --cc=Timothy.Bird@am.sony.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox