Re: [PATCH -tip v14 08/12] tracing: add kprobe-based event tracer

Frederic Weisbecker
2009-08-19T01:23:17Z

On Thu, Aug 13, 2009 at 04:35:11PM -0400, Masami Hiramatsu wrote:
> Add kprobes-based event tracer on ftrace.
>
> This tracer is similar to the events tracer which is based on Tracepoint
> infrastructure. Instead of Tracepoint, this tracer is based on kprobes
> (kprobe and kretprobe). It probes anywhere where kprobes can probe(this
> means, all functions body except for __kprobes functions).
>
> Similar to the events tracer, this tracer doesn't need to be activated via
> current_tracer, instead of that, just set probe points via
> /sys/kernel/debug/tracing/kprobe_events. And you can set filters on each
> probe events via /sys/kernel/debug/tracing/events/kprobes/<EVENT>/filter.
>
> This tracer supports following probe arguments for each probe.
>
> %REG : Fetch register REG
> sN : Fetch Nth entry of stack (N >= 0)
> sa : Fetch stack address.
> @ADDR : Fetch memory at ADDR (ADDR should be in kernel)
> @SYM[+|-offs] : Fetch memory at SYM +|- offs (SYM should be a data symbol)
> aN : Fetch function argument. (N >= 0)
> rv : Fetch return value.
> ra : Fetch return address.
> +|-offs(FETCHARG) : fetch memory at FETCHARG +|- offs address.
>
> See Documentation/trace/kprobetrace.txt for details.
>
> Changes from v13:
> - Support 'sa' for stack address.
> - Use call->data instead of container_of() macro.
>
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Frank Ch. Eigler <fche@redhat.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Jason Baron <jbaron@redhat.com>
> Cc: Jim Keniston <jkenisto@us.ibm.com>
> Cc: K.Prasad <prasad@linux.vnet.ibm.com>
> Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
> Cc: Li Zefan <lizf@cn.fujitsu.com>
> Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
> Cc: Roland McGrath <roland@redhat.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Tom Zanussi <tzanussi@gmail.com>
> Cc: Vegard Nossum <vegard.nossum@gmail.com>
> ---
>
> Documentation/trace/kprobetrace.txt | 139 ++++

I'll probably split this commit to have the first version of the
documentation as a separate patch in order to lighten this.

Frederic.