Skip to content

Commit 72cbbc8

Browse files
Alexei StarovoitovIngo Molnar
authored andcommitted
tracing: Add kprobe flag
add TRACE_EVENT_FL_KPROBE flag to differentiate kprobe type of tracepoints, since bpf programs can only be attached to kprobe type of PERF_TYPE_TRACEPOINT perf events. Signed-off-by: Alexei Starovoitov <[email protected]> Reviewed-by: Steven Rostedt <[email protected]> Reviewed-by: Masami Hiramatsu <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: David S. Miller <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 4e537f7 commit 72cbbc8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

include/linux/ftrace_event.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ enum {
252252
TRACE_EVENT_FL_WAS_ENABLED_BIT,
253253
TRACE_EVENT_FL_USE_CALL_FILTER_BIT,
254254
TRACE_EVENT_FL_TRACEPOINT_BIT,
255+
TRACE_EVENT_FL_KPROBE_BIT,
255256
};
256257

257258
/*
@@ -265,6 +266,7 @@ enum {
265266
* it is best to clear the buffers that used it).
266267
* USE_CALL_FILTER - For ftrace internal events, don't use file filter
267268
* TRACEPOINT - Event is a tracepoint
269+
* KPROBE - Event is a kprobe
268270
*/
269271
enum {
270272
TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT),
@@ -274,6 +276,7 @@ enum {
274276
TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT),
275277
TRACE_EVENT_FL_USE_CALL_FILTER = (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT),
276278
TRACE_EVENT_FL_TRACEPOINT = (1 << TRACE_EVENT_FL_TRACEPOINT_BIT),
279+
TRACE_EVENT_FL_KPROBE = (1 << TRACE_EVENT_FL_KPROBE_BIT),
277280
};
278281

279282
struct ftrace_event_call {

kernel/trace/trace_kprobe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ static int register_kprobe_event(struct trace_kprobe *tk)
12861286
kfree(call->print_fmt);
12871287
return -ENODEV;
12881288
}
1289-
call->flags = 0;
1289+
call->flags = TRACE_EVENT_FL_KPROBE;
12901290
call->class->reg = kprobe_register;
12911291
call->data = tk;
12921292
ret = trace_add_event_call(call);

0 commit comments

Comments
 (0)