Bug 6594 - investigate ftrace interface
Summary: investigate ftrace interface
Status: RESOLVED WORKSFORME
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-05 02:07 UTC by Frank Ch. Eigler
Modified: 2013-05-24 20:51 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2008-06-05 02:07:29 UTC
see git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel.git
branch tracing/ftrace
functions in include/linux/ftrace.h, [...]register_ftrace_function()
Comment 1 Frank Ch. Eigler 2008-06-05 02:11:27 UTC
probably needs kernel changes for:
... module-friendly ftrace registration api
... and a data (argument) passing mechanism
Comment 2 Masami Hiramatsu 2008-06-05 02:15:34 UTC
(In reply to comment #0)
> see git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel.git

FYI, recently, Ingo changed name of his tree.

http://www.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-ftrace.git

Comment 3 Frank Ch. Eigler 2008-07-07 20:27:33 UTC
Anonymous word-of-mouth from a colleague of the ftrace team suggests
an intention on their part to produce a module-facing interface for
the widget.  Once that exists, we can make systemtap work with it.
Comment 4 Frank Ch. Eigler 2008-07-20 18:59:31 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=454694
Comment 5 Masami Hiramatsu 2008-10-02 15:27:52 UTC
(In reply to comment #1)
> probably needs kernel changes for:
> ... module-friendly ftrace registration api

I think this should be done by simply exporting
register/unregister_ftrace_function().

> ... and a data (argument) passing mechanism

Arguments passing is hard because of mcount implementation.
It will give us just caller ip and callee ip.
So, in the first phase, might we support only $caller and $callee in
ftrace-based probe?

Comment 6 Frank Ch. Eigler 2008-10-02 16:56:35 UTC
> > probably needs kernel changes for:
> > ... module-friendly ftrace registration api
> I think this should be done by simply exporting
> register/unregister_ftrace_function().

Hooking into the "dyn-ftrace" functionality seems more relevant,
since that is what we'd need to choose only subsets of kernel
functions to probe.  The register_ftrace_function widget seems
to be suited only for a separate abstract event source that traps\*all* function
entries.


> > ... and a data (argument) passing mechanism
> 
> Arguments passing is hard because of mcount implementation.
> It will give us just caller ip and callee ip.
> So, in the first phase, might we support only $caller and $callee in
> ftrace-based probe?

I was not talking about accessing contextual data registers via ftrace.
We'll have to work somewhat hard to make that work at all.  What I
was referring to was a callback void* parameter that allows us
to tell apart potentially multiple registrations -- like the kprobe*
pointer we get back from kprobe callbacks.
Comment 7 Frank Ch. Eigler 2011-06-08 19:57:51 UTC
With srostedt's linux commit 936e074b, we now have ftrace function hooking
facilities available.  See ftrace_register_*, ftrace_set_*.
Comment 8 Frank Ch. Eigler 2011-08-10 23:21:44 UTC
Steve Rostedt's ftrace/kprobes integration patches may make this unnecessary.
https://lkml.org/lkml/2011/8/10/337
Comment 9 Frank Ch. Eigler 2013-05-24 20:51:55 UTC
The kprobes-via-ftrace widget was merged into linux 3.9.