All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing/function-graph-tracer: make set_graph_function file support ftrace regex
Date: Fri, 20 Feb 2009 15:42:32 +0100	[thread overview]
Message-ID: <20090220144231.GB5732@nowhere> (raw)
In-Reply-To: <20090220104004.GC28581@elte.hu>

On Fri, Feb 20, 2009 at 11:40:04AM +0100, Ingo Molnar wrote:
> 
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
> 
> > Impact: trace only functions matching a pattern
> > 
> > The set_graph_function file let one to trace only one or several
> > chosen functions and follow all their code flow.
> > 
> > Currently, only a constant function name is allowed so this patch
> > allows the ftrace_regex functions:
> > 
> > _ matches all functions that end with "name":
> >   echo *name > set_graph_function
> > 
> > _ matches all functions that begin with "name":
> >   echo name* > set_graph_function
> > 
> > _ matches all functions that contains "name":
> >   echo *name* > set_graph_function
> > 
> > Example:
> > 
> > echo mutex* > set_graph_function
> > 
> >  0)               |  mutex_lock_nested() {
> >  0)   0.563 us    |    __might_sleep();
> >  0)   2.072 us    |  }
> >  0)               |  mutex_unlock() {
> >  0)   1.036 us    |    __mutex_unlock_slowpath();
> >  0)   2.433 us    |  }
> >  0)               |  mutex_unlock() {
> >  0)   0.691 us    |    __mutex_unlock_slowpath();
> >  0)   1.787 us    |  }
> >  0)               |  mutex_lock_interruptible_nested() {
> >  0)   0.548 us    |    __might_sleep();
> >  0)   1.945 us    |  }
> > 
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > ---
> >  kernel/trace/ftrace.c |   56 +++++++++++++++++++++++++++++++++---------------
> >  1 files changed, 38 insertions(+), 18 deletions(-)
> 
> Applied, thanks Frederic!
> 
> I'm wondering about the following: the whole set_graph_function 
> method is limited (to FTRACE_GRAPH_MAX_FUNCS, 32 entries), is 
> not scalable (we walk the array of functions at every function 
> trace point), has a separate API, etc.
> 
> Wouldnt we off better with a good, generic function attributes 
> hash, and an extension to the generic regexp parser to enable 
> the setting of those attributes? One such attribute could be the 
> 'expand child function'
> 
> 	Ingo

And well, you are answering this question I couldn't solve yesterday.
One of my goal was to be able to trace easily the syscalls:

echo sys_* > set_graph_function

But this array is static. And making it runtime resizable resulted in other problems:
locking? but doing that for each function is unacceptable. rcu was a good
candidate but I wonder that rcu would have been traced too, occuring tracing recursion.

Well, using such generic hashtable with such an attribute is really a good idea.


  reply	other threads:[~2009-02-20 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19 20:13 [PATCH] tracing/function-graph-tracer: make set_graph_function file support ftrace regex Frederic Weisbecker
2009-02-20 10:40 ` Ingo Molnar
2009-02-20 14:42   ` Frederic Weisbecker [this message]
2009-02-20 16:58 ` Frederic Weisbecker

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=20090220144231.GB5732@nowhere \
    --to=fweisbec@gmail.com \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.