Thread (28 messages) flat view 28 messages, 6 authors, 2009-02-13

Re: [PATCH 0/7][RFC] function graph tracer port to PowerPC

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2009-02-12 02:38:12
Also in: lkml

On Thu, 12 Feb 2009, Michael Ellerman wrote:
quoted

The function graph tracer not only traces the start of a function
(uses the function tracer part for that) but also uses the kprobes
trick to replace the return address with a hook to trace the exit
of the function.
You use the "kprobes trick", but none of the kprobes code (AFAICS).
Couldn't there be some common code between the two?
I'm not 100% sure how kprobes work, but I believe they use traps. And then 
they set the return address to take another trap, to fix it. I could be 
totally off here, on how kprobes does this.

But ftrace is about executing the code directly. The return code jumps to 
a another function in asm that will set up the call to do the tracing, and 
then fix the return pointer back. The only thing that is similar between
the two approaches that I can tell, is that we both modify the return 
address of the function. I took a quick peek at the kprobes code and I 
see no easy way to share it.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help