Skip to content

ftrace: updates for tip

Steven Rostedt containers lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ftrace: graph of a single functioninclude/linux/ftrace.h include/linux/sched.h kernel/trace/ftrace.c +2 more+314 -112 replies
2/3ftrace: use task struct trace flag to filter on pidkernel/trace/ftrace.c+25 -31 reply
3/3ftrace: trace single pid for function graph tracerkernel/trace/ftrace.c kernel/trace/trace.c kernel/trace/trace.h+14 -16 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] ftrace: updates for tip

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.

This means we can now trace more than one pid without any more overhead. It also means that we should be able to use the name space code that the container guys want us to. But since I'm not very up on the namespace code, I'm still using just the normal 'pid'. I've Cc'd the container folks so perhaps they could write up a patch for me ;-)

Note: When writing to the set_ftrace_pid two things happen.
- The task with the matching pid gets the trace flag set.
- Any other task has its trace flag cleared.
#2 needs to be addressed when converting to pid name spaces. Just because it is not enough to simply find the matching task. It may be good enough to just clear all tasks and then find the one that matches.

The last patch makes the function graph tracer honor the set_ftrace_pid.

The following patches are in:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git

branch: tip/devel

Steven Rostedt (3):
ftrace: graph of a single function
ftrace: use task struct trace flag to filter on pid
ftrace: trace single pid for function graph tracer

----

 include/linux/ftrace.h |   46 +++++++++
 include/linux/sched.h  |    4 +
 kernel/trace/ftrace.c  |  257 +++++++++++++++++++++++++++++++++++++++++++++++-
 kernel/trace/trace.c   |   11 ++
 kernel/trace/trace.h   |   40 +++++++-
 5 files changed, 353 insertions(+), 5 deletions(-)