Skip to content

Commit 3e8b1a2

Browse files
committed
tracing: Have eprobes use filtering logic of trace events
The eprobes open code the reserving of the event on the ring buffer for ftrace instead of using the ftrace event wrappers, which means that it doesn't get affected by the filters, breaking the filtering logic on user space. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 6c536d7 commit 3e8b1a2

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

kernel/trace/trace_eprobe.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -489,18 +489,12 @@ __eprobe_trace_func(struct eprobe_data *edata, void *rec)
489489
if (trace_trigger_soft_disabled(edata->file))
490490
return;
491491

492-
fbuffer.trace_ctx = tracing_gen_ctx();
493-
fbuffer.trace_file = edata->file;
494-
495492
dsize = get_eprobe_size(&edata->ep->tp, rec);
496-
fbuffer.regs = NULL;
497-
498-
fbuffer.event =
499-
trace_event_buffer_lock_reserve(&fbuffer.buffer, edata->file,
500-
call->event.type,
501-
sizeof(*entry) + edata->ep->tp.size + dsize,
502-
fbuffer.trace_ctx);
503-
if (!fbuffer.event)
493+
494+
entry = trace_event_buffer_reserve(&fbuffer, edata->file,
495+
sizeof(*entry) + edata->ep->tp.size + dsize);
496+
497+
if (!entry)
504498
return;
505499

506500
entry = fbuffer.entry = ring_buffer_event_data(fbuffer.event);

0 commit comments

Comments
 (0)