From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH 5/5] tracing/uprobes: Use trace_event_buffer_reserve() helper
Date: Tue, 30 Nov 2021 13:40:53 +0900 [thread overview]
Message-ID: <20211130134053.4115f0d97c683a1b021c1833@kernel.org> (raw)
In-Reply-To: <20211130024319.439953082@goodmis.org>
On Mon, 29 Nov 2021 21:39:50 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> 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.
>
Ah, event_trigger_unlock_commit() is the pair commit function. I got it.
Anyway, the pair of trace_event_buffer_reserve() and trace_event_buffer_commit()
should be used.
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Thank you,
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> kernel/trace/trace_uprobe.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
> index f5f0039d31e5..177717c4e74a 100644
> --- a/kernel/trace/trace_uprobe.c
> +++ b/kernel/trace/trace_uprobe.c
> @@ -949,8 +949,8 @@ static void __uprobe_trace_func(struct trace_uprobe *tu,
> struct trace_event_file *trace_file)
> {
> struct uprobe_trace_entry_head *entry;
> + struct trace_event_buffer fbuffer;
> struct trace_buffer *buffer;
> - struct ring_buffer_event *event;
> void *data;
> int size, esize;
> struct trace_event_call *call = trace_probe_event_call(&tu->tp);
> @@ -965,12 +965,10 @@ static void __uprobe_trace_func(struct trace_uprobe *tu,
>
> esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
> size = esize + tu->tp.size + dsize;
> - event = trace_event_buffer_lock_reserve(&buffer, trace_file,
> - call->event.type, size, 0);
> - if (!event)
> + entry = trace_event_buffer_reserve(&fbuffer, trace_file, size);
> + if (!entry)
> return;
>
> - entry = ring_buffer_event_data(event);
> if (is_ret_probe(tu)) {
> entry->vaddr[0] = func;
> entry->vaddr[1] = instruction_pointer(regs);
> @@ -982,7 +980,7 @@ static void __uprobe_trace_func(struct trace_uprobe *tu,
>
> memcpy(data, ucb->buf, tu->tp.size + dsize);
>
> - event_trigger_unlock_commit(trace_file, buffer, event, entry, 0);
> + trace_event_buffer_commit(&fbuffer);
> }
>
> /* uprobe handler */
> --
> 2.33.0
--
Masami Hiramatsu <mhiramat@kernel.org>
prev parent reply other threads:[~2021-11-30 4:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 2:39 [PATCH 0/5] tracing: Various updates Steven Rostedt
2021-11-30 2:39 ` [PATCH 1/5] tracing: Use __this_cpu_read() in trace_event_buffer_lock_reserver() Steven Rostedt
2021-11-30 2:39 ` [PATCH 2/5] tracing: Disable preemption when using the filter buffer Steven Rostedt
2021-11-30 5:02 ` kernel test robot
2021-11-30 2:39 ` [PATCH 3/5] tracing: Have eprobes use filtering logic of trace events Steven Rostedt
2021-11-30 2:39 ` [PATCH 4/5] tracing/kprobes: Do not open code event reserve logic Steven Rostedt
2021-11-30 4:38 ` Masami Hiramatsu
2021-11-30 2:39 ` [PATCH 5/5] tracing/uprobes: Use trace_event_buffer_reserve() helper Steven Rostedt
2021-11-30 4:40 ` Masami Hiramatsu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211130134053.4115f0d97c683a1b021c1833@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox