All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	containers@lists.osdl.org, Eric Biederman <ebiederm@xmission.com>,
	Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
	"Serge E. Hallyn" <serue@us.ibm.com>
Subject: Re: [PATCH 0/3] ftrace: updates for tip
Date: Thu, 4 Dec 2008 09:35:07 +0100	[thread overview]
Message-ID: <20081204083507.GE32594@elte.hu> (raw)
In-Reply-To: <20081203203656.776893226@goodmis.org>


* Steven Rostedt <rostedt@goodmis.org> wrote:

> Ingo,
> 
> This series has three patches.
> 
> The first patch adds a new feature that I've been wanting to have for 
> some time and Arjan even requested. That is to pick a function and only 
> trace that function and its children. Dynamic ftrace and function graph 
> needs to be enabled for this.
> 
> To do the above, I added a "trace" flags field in the task structure. 
> The second patch uses this for the ftrace pid code. It searches for the 
> task based on the pid and sets the trace flag, then in the ftrace 
> function caller it only needs to check this flag.

Btw., i'd love to see this done via the regular regexp interface though, 
if possible - instead of the add-on interface you added.

( Also perhaps enable to toggle tracing via the /proc/<PID>/ hierarchy - 
  a /proc/<PID>/tracing_enabled switch or so. )

Regarding the filter functions, the basic principle should be 
mathematical set operations, like we have it now: add and remove, union, 
wildcards, etc.

I'd suggest a natural and intuitive extension of the current syntax. 
(while keeping all the current bits)

I already suggested a 'inverse' filter in a previous mail:

  echo "-schedule*" >> set_ftrace_filter

This rule operates on the current set of filter functions: it strikes out 
all existing filter functions that match this pattern.

To handle PIDs, we could do something like:

  echo "sshd-312:schedule" > set_ftrace_filter

This would restrict tracing to the sshd-pid:312 task.

Note: the PID portion of the filter rules still stay separate from the 
function names - we dont want per task function filter rules.

A natural variation would be:

  echo "312:schedule" > set_ftrace_filter

to only specify the PID, or:

  echo "312,313:schedule" > set_ftrace_filter

to specify two PIDs, or:

  echo "sshd:schedule" > set_ftrace_filter

to only specify the 'comm' part, which expands to all PIDs where 
task->comm matches sshd. Another variation would be:

  echo "loop*:schedule" > set_ftrace_filter

that matches all PIDs where task->comm matches loop*.

To specify recursive tracing, we could use something like:

  echo "loop*+schedule" > set_ftrace_filter

the '+' would signal that the 'schedule' function is 'expanded' and all 
its child functions are traced as well.

btw., maybe it makes sense to separate the regexp rule-set from the set 
of functions that we are tracing right now. For example:

  $ echo "schedule*" >  set_ftrace_filter
  $ echo "time*"     >> set_ftrace_filter
  $ echo "sys_*"     >> set_ftrace_filter

  $ cat set_ftrace_filter
  schedule*
  time*
  sys_*

We'd also have a separate, current_ftrace_functions file as well which 
shows all traced functions. (on a global basis - with possible PID filter 
rules added where applicable)

I know this will be hellishly hard to implement, but it would be _very_ 
elegant, and _very_ usable.

What do you think?

	Ingo

  parent reply	other threads:[~2008-12-04  8:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03 20:36 [PATCH 0/3] ftrace: updates for tip Steven Rostedt
2008-12-03 20:36 ` [PATCH 1/3] ftrace: graph of a single function Steven Rostedt
2008-12-03 20:36   ` Steven Rostedt
     [not found]   ` <20081203203828.920111079-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org>
2008-12-03 21:07     ` Andrew Morton
2008-12-03 21:07       ` Andrew Morton
2008-12-03 21:10       ` Steven Rostedt
2008-12-03 21:32         ` Andrew Morton
2008-12-03 21:36           ` Steven Rostedt
2008-12-04  8:39             ` Ingo Molnar
2008-12-03 21:08     ` Andrew Morton
2008-12-03 21:08       ` Andrew Morton
2008-12-03 21:11       ` Steven Rostedt
2008-12-04  8:41         ` Ingo Molnar
2008-12-04  8:43           ` Peter Zijlstra
2008-12-15  9:21           ` Andy Whitcroft
2008-12-04  6:24   ` [PATCH 1/1] ftrace: avoid duplicated function when writing set_graph_function Liming Wang
2008-12-04  8:42     ` Ingo Molnar
2008-12-03 20:36 ` [PATCH 2/3] ftrace: use task struct trace flag to filter on pid Steven Rostedt
2008-12-03 22:34   ` Eric W. Biederman
2008-12-03 20:36 ` [PATCH 3/3] ftrace: trace single pid for function graph tracer Steven Rostedt
2008-12-03 20:49   ` Andrew Morton
2008-12-03 20:52     ` Steven Rostedt
2008-12-03 23:36       ` Eric W. Biederman
2008-12-04  2:29         ` Steven Rostedt
2008-12-04  4:22           ` Eric W. Biederman
2008-12-04  4:32             ` Steven Rostedt
2008-12-04  8:19 ` [PATCH 0/3] ftrace: updates for tip Ingo Molnar
2008-12-04  8:35 ` Ingo Molnar [this message]
2008-12-04 13:30   ` Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2009-02-05  6:13 Steven Rostedt
2009-02-05 13:37 ` Ingo Molnar
2009-02-03  2:38 Steven Rostedt
2008-12-24  4:24 Steven Rostedt
2008-12-24 23:13 ` Frederic Weisbecker
2008-12-24 23:24 ` Frederic Weisbecker
2008-12-29 11:46 ` Ingo Molnar
2008-11-15  0:45 Steven Rostedt
2008-11-12 22:52 [PATCH 0/3] ftrace " Steven Rostedt
2008-11-13  8:50 ` Ingo Molnar

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=20081204083507.GE32594@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=containers@lists.osdl.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=serue@us.ibm.com \
    --cc=sukadev@linux.vnet.ibm.com \
    /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.