Re: [PATCH 0/3][RFC] tracing/kprobes: prevent jprobes from crashingfunction graph tracer

From: Masami Hiramatsu
Date: Sun Nov 01 2009 - 09:49:35 EST


Frank Ch. Eigler wrote:
Steven Rostedt<rostedt@xxxxxxxxxxx> writes:

[...] Jprobes and the function graph tracer use the same mechanism
to trace the exit of a function. Unfortunately, only one can be done
at a time. The function graph tracer replaces the return address
with its own handler, but so does jprobes. The two are not
compatible. [...]

What about kretprobes? It too uses the same mechanism.

Exactly, kretprobe uses similar mechanism with func-graph tracer.

Fortunately, it doesn't cause any problem, because kretprobe doesn't
skip any function-return, and func-graph tracer(mcount) always intrudes
a function after kretprobe.

---
call func
<-- kretprobe prehandler changes return address
func()
<-- func-graph prehandler changes return address
...
return
--> func-graph trampoline sets ip to "kretprobe trampoline"
--> kretprobe trampoline sets ip to "real return address"
(return address)
---

So that kretprobe handler doesn't conflict with function graph tracer.

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@xxxxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/