diff options
-rw-r--r-- | Documentation/trace/kprobetrace.txt | 11 | ||||
-rw-r--r-- | kernel/trace/trace_kprobe.c | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt index 6521681e7838..9b8f7c6040a7 100644 --- a/Documentation/trace/kprobetrace.txt +++ b/Documentation/trace/kprobetrace.txt | |||
@@ -122,8 +122,15 @@ print fmt: "(%lx) dfd=%lx filename=%lx flags=%lx mode=%lx", REC->ip, REC->dfd, R | |||
122 | 122 | ||
123 | echo > /sys/kernel/debug/tracing/kprobe_events | 123 | echo > /sys/kernel/debug/tracing/kprobe_events |
124 | 124 | ||
125 | This clears all probe points. and you can see the traced information via | 125 | This clears all probe points. |
126 | /sys/kernel/debug/tracing/trace. | 126 | |
127 | Right after definition, each event is disabled by default. For tracing these | ||
128 | events, you need to enable it. | ||
129 | |||
130 | echo 1 > /sys/kernel/debug/tracing/events/kprobes/myprobe/enable | ||
131 | echo 1 > /sys/kernel/debug/tracing/events/kprobes/myretprobe/enable | ||
132 | |||
133 | And you can see the traced information via /sys/kernel/debug/tracing/trace. | ||
127 | 134 | ||
128 | cat /sys/kernel/debug/tracing/trace | 135 | cat /sys/kernel/debug/tracing/trace |
129 | # tracer: nop | 136 | # tracer: nop |
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index d8db9357489b..f6821f16227e 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -383,7 +383,7 @@ static int register_trace_probe(struct trace_probe *tp) | |||
383 | goto end; | 383 | goto end; |
384 | } | 384 | } |
385 | 385 | ||
386 | tp->flags = TP_FLAG_TRACE; | 386 | tp->rp.kp.flags |= KPROBE_FLAG_DISABLED; |
387 | if (probe_is_return(tp)) | 387 | if (probe_is_return(tp)) |
388 | ret = register_kretprobe(&tp->rp); | 388 | ret = register_kretprobe(&tp->rp); |
389 | else | 389 | else |
@@ -1298,7 +1298,7 @@ static int register_probe_event(struct trace_probe *tp) | |||
1298 | call->id = register_ftrace_event(&tp->event); | 1298 | call->id = register_ftrace_event(&tp->event); |
1299 | if (!call->id) | 1299 | if (!call->id) |
1300 | return -ENODEV; | 1300 | return -ENODEV; |
1301 | call->enabled = 1; | 1301 | call->enabled = 0; |
1302 | call->regfunc = probe_event_enable; | 1302 | call->regfunc = probe_event_enable; |
1303 | call->unregfunc = probe_event_disable; | 1303 | call->unregfunc = probe_event_disable; |
1304 | 1304 | ||