Skip to content

Commit b7d5eb2

Browse files
committed
tracing/uprobes: Use trace_event_buffer_reserve() helper
To be consistent with kprobes and eprobes, use trace_event_buffer_reserver() and trace_event_buffer_commit(). This will ensure that any updates to trace events will also be implemented on uprobe events. Link: https://lkml.kernel.org/r/[email protected] Acked-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 5e6cd84 commit b7d5eb2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

kernel/trace/trace_uprobe.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,7 @@ static void __uprobe_trace_func(struct trace_uprobe *tu,
949949
struct trace_event_file *trace_file)
950950
{
951951
struct uprobe_trace_entry_head *entry;
952-
struct trace_buffer *buffer;
953-
struct ring_buffer_event *event;
952+
struct trace_event_buffer fbuffer;
954953
void *data;
955954
int size, esize;
956955
struct trace_event_call *call = trace_probe_event_call(&tu->tp);
@@ -965,12 +964,10 @@ static void __uprobe_trace_func(struct trace_uprobe *tu,
965964

966965
esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
967966
size = esize + tu->tp.size + dsize;
968-
event = trace_event_buffer_lock_reserve(&buffer, trace_file,
969-
call->event.type, size, 0);
970-
if (!event)
967+
entry = trace_event_buffer_reserve(&fbuffer, trace_file, size);
968+
if (!entry)
971969
return;
972970

973-
entry = ring_buffer_event_data(event);
974971
if (is_ret_probe(tu)) {
975972
entry->vaddr[0] = func;
976973
entry->vaddr[1] = instruction_pointer(regs);
@@ -982,7 +979,7 @@ static void __uprobe_trace_func(struct trace_uprobe *tu,
982979

983980
memcpy(data, ucb->buf, tu->tp.size + dsize);
984981

985-
event_trigger_unlock_commit(trace_file, buffer, event, entry, 0);
982+
trace_event_buffer_commit(&fbuffer);
986983
}
987984

988985
/* uprobe handler */

0 commit comments

Comments
 (0)