mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
tracing/kprobes: Rename Kprobe-tracer to kprobe-event
Rename Kprobes-based event tracer to kprobes-based tracing event (kprobe-event), since it is not a tracer but an extensible tracing event interface. This also changes CONFIG_KPROBE_TRACER to CONFIG_KPROBE_EVENT and sets it y by default. Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Jim Keniston <jkenisto@us.ibm.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Frank Ch. Eigler <fche@redhat.com> Cc: Jason Baron <jbaron@redhat.com> Cc: K.Prasad <prasad@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> LKML-Reference: <20091104001247.3454.14131.stgit@harusame> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
91365bbe4f
commit
77b44d1b7c
4 changed files with 31 additions and 30 deletions
|
@ -1,26 +1,23 @@
|
||||||
Kprobe-based Event Tracer
|
Kprobe-based Event Tracing
|
||||||
=========================
|
==========================
|
||||||
|
|
||||||
Documentation is written by Masami Hiramatsu
|
Documentation is written by Masami Hiramatsu
|
||||||
|
|
||||||
|
|
||||||
Overview
|
Overview
|
||||||
--------
|
--------
|
||||||
This tracer is similar to the events tracer which is based on Tracepoint
|
These events are similar to tracepoint based events. Instead of Tracepoint,
|
||||||
infrastructure. Instead of Tracepoint, this tracer is based on kprobes(kprobe
|
this is based on kprobes (kprobe and kretprobe). So it can probe wherever
|
||||||
and kretprobe). It probes anywhere where kprobes can probe(this means, all
|
kprobes can probe (this means, all functions body except for __kprobes
|
||||||
functions body except for __kprobes functions).
|
functions). Unlike the Tracepoint based event, this can be added and removed
|
||||||
|
dynamically, on the fly.
|
||||||
|
|
||||||
Unlike the function tracer, this tracer can probe instructions inside of
|
To enable this feature, build your kernel with CONFIG_KPROBE_TRACING=y.
|
||||||
kernel functions. It allows you to check which instruction has been executed.
|
|
||||||
|
|
||||||
Unlike the Tracepoint based events tracer, this tracer can add and remove
|
Similar to the events tracer, this doesn't need to be activated via
|
||||||
probe points on the fly.
|
current_tracer. Instead of that, add probe points via
|
||||||
|
/sys/kernel/debug/tracing/kprobe_events, and enable it via
|
||||||
Similar to the events tracer, this tracer doesn't need to be activated via
|
/sys/kernel/debug/tracing/events/kprobes/<EVENT>/enabled.
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
Synopsis of kprobe_events
|
Synopsis of kprobe_events
|
||||||
|
@ -55,9 +52,9 @@ Per-Probe Event Filtering
|
||||||
-------------------------
|
-------------------------
|
||||||
Per-probe event filtering feature allows you to set different filter on each
|
Per-probe event filtering feature allows you to set different filter on each
|
||||||
probe and gives you what arguments will be shown in trace buffer. If an event
|
probe and gives you what arguments will be shown in trace buffer. If an event
|
||||||
name is specified right after 'p:' or 'r:' in kprobe_events, the tracer adds
|
name is specified right after 'p:' or 'r:' in kprobe_events, it adds an event
|
||||||
an event under tracing/events/kprobes/<EVENT>, at the directory you can see
|
under tracing/events/kprobes/<EVENT>, at the directory you can see 'id',
|
||||||
'id', 'enabled', 'format' and 'filter'.
|
'enabled', 'format' and 'filter'.
|
||||||
|
|
||||||
enabled:
|
enabled:
|
||||||
You can enable/disable the probe by writing 1 or 0 on it.
|
You can enable/disable the probe by writing 1 or 0 on it.
|
||||||
|
@ -71,6 +68,7 @@ filter:
|
||||||
id:
|
id:
|
||||||
This shows the id of this probe event.
|
This shows the id of this probe event.
|
||||||
|
|
||||||
|
|
||||||
Event Profiling
|
Event Profiling
|
||||||
---------------
|
---------------
|
||||||
You can check the total number of probe hits and probe miss-hits via
|
You can check the total number of probe hits and probe miss-hits via
|
||||||
|
|
|
@ -428,17 +428,22 @@ config BLK_DEV_IO_TRACE
|
||||||
|
|
||||||
If unsure, say N.
|
If unsure, say N.
|
||||||
|
|
||||||
config KPROBE_TRACER
|
config KPROBE_EVENT
|
||||||
depends on KPROBES
|
depends on KPROBES
|
||||||
depends on X86
|
depends on X86
|
||||||
bool "Trace kprobes"
|
bool "Enable kprobes-based dynamic events"
|
||||||
select TRACING
|
select TRACING
|
||||||
select GENERIC_TRACER
|
default y
|
||||||
help
|
help
|
||||||
This tracer probes everywhere where kprobes can probe it, and
|
This allows the user to add tracing events (similar to tracepoints) on the fly
|
||||||
records various registers and memories specified by user.
|
via the ftrace interface. See Documentation/trace/kprobetrace.txt
|
||||||
This also allows you to trace kprobe probe points as a dynamic
|
for more details.
|
||||||
defined events. It provides per-probe event filtering interface.
|
|
||||||
|
Those events can be inserted wherever kprobes can probe, and record
|
||||||
|
various register and memory values.
|
||||||
|
|
||||||
|
This option is also required by perf-probe subcommand of perf tools. If
|
||||||
|
you want to use perf tools, this option is strongly recommended.
|
||||||
|
|
||||||
config DYNAMIC_FTRACE
|
config DYNAMIC_FTRACE
|
||||||
bool "enable/disable ftrace tracepoints dynamically"
|
bool "enable/disable ftrace tracepoints dynamically"
|
||||||
|
|
|
@ -53,7 +53,7 @@ obj-$(CONFIG_EVENT_TRACING) += trace_export.o
|
||||||
obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
|
obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
|
||||||
obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
|
obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
|
||||||
obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
|
obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
|
||||||
obj-$(CONFIG_KPROBE_TRACER) += trace_kprobe.o
|
obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o
|
||||||
obj-$(CONFIG_EVENT_TRACING) += power-traces.o
|
obj-$(CONFIG_EVENT_TRACING) += power-traces.o
|
||||||
|
|
||||||
libftrace-y := ftrace.o
|
libftrace-y := ftrace.o
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* kprobe based kernel tracer
|
* Kprobes-based tracing events
|
||||||
*
|
*
|
||||||
* Created by Masami Hiramatsu <mhiramat@redhat.com>
|
* Created by Masami Hiramatsu <mhiramat@redhat.com>
|
||||||
*
|
*
|
||||||
|
@ -57,8 +57,6 @@ const char *reserved_field_names[] = {
|
||||||
FIELD_STRING_FUNC,
|
FIELD_STRING_FUNC,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* currently, trace_kprobe only supports X86. */
|
|
||||||
|
|
||||||
struct fetch_func {
|
struct fetch_func {
|
||||||
unsigned long (*func)(struct pt_regs *, void *);
|
unsigned long (*func)(struct pt_regs *, void *);
|
||||||
void *data;
|
void *data;
|
||||||
|
@ -191,7 +189,7 @@ static __kprobes void free_indirect_fetch_data(struct indirect_fetch_data *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kprobe tracer core functions
|
* Kprobe event core functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct probe_arg {
|
struct probe_arg {
|
||||||
|
|
Loading…
Reference in a new issue