mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-18 10:34:24 +08:00
tracing/kprobes: Do not open code event reserve logic
As kprobe events use trace_event_buffer_commit() to commit the event to the ftrace ring buffer, for consistency, it should use trace_event_buffer_reserve() to allocate it, as the two functions are related. Link: https://lkml.kernel.org/r/20211130024319.257430762@goodmis.org Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
3e8b1a29a0
commit
5e6cd84e2f
@ -1383,17 +1383,11 @@ __kprobe_trace_func(struct trace_kprobe *tk, struct pt_regs *regs,
|
|||||||
if (trace_trigger_soft_disabled(trace_file))
|
if (trace_trigger_soft_disabled(trace_file))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fbuffer.trace_ctx = tracing_gen_ctx();
|
|
||||||
fbuffer.trace_file = trace_file;
|
|
||||||
|
|
||||||
dsize = __get_data_size(&tk->tp, regs);
|
dsize = __get_data_size(&tk->tp, regs);
|
||||||
|
|
||||||
fbuffer.event =
|
entry = trace_event_buffer_reserve(&fbuffer, trace_file,
|
||||||
trace_event_buffer_lock_reserve(&fbuffer.buffer, trace_file,
|
sizeof(*entry) + tk->tp.size + dsize);
|
||||||
call->event.type,
|
if (!entry)
|
||||||
sizeof(*entry) + tk->tp.size + dsize,
|
|
||||||
fbuffer.trace_ctx);
|
|
||||||
if (!fbuffer.event)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fbuffer.regs = regs;
|
fbuffer.regs = regs;
|
||||||
@ -1430,16 +1424,11 @@ __kretprobe_trace_func(struct trace_kprobe *tk, struct kretprobe_instance *ri,
|
|||||||
if (trace_trigger_soft_disabled(trace_file))
|
if (trace_trigger_soft_disabled(trace_file))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fbuffer.trace_ctx = tracing_gen_ctx();
|
|
||||||
fbuffer.trace_file = trace_file;
|
|
||||||
|
|
||||||
dsize = __get_data_size(&tk->tp, regs);
|
dsize = __get_data_size(&tk->tp, regs);
|
||||||
fbuffer.event =
|
|
||||||
trace_event_buffer_lock_reserve(&fbuffer.buffer, trace_file,
|
entry = trace_event_buffer_reserve(&fbuffer, trace_file,
|
||||||
call->event.type,
|
sizeof(*entry) + tk->tp.size + dsize);
|
||||||
sizeof(*entry) + tk->tp.size + dsize,
|
if (!entry)
|
||||||
fbuffer.trace_ctx);
|
|
||||||
if (!fbuffer.event)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fbuffer.regs = regs;
|
fbuffer.regs = regs;
|
||||||
|
Loading…
Reference in New Issue
Block a user