All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: linux-trace-kernel@vger.kernel.org, rostedt@goodmis.org,
	mhiramat@kernel.org, bpf@vger.kernel.org,
	mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next 1/3] uprobes: encapsulate preparation of uprobe args buffer
Date: Wed, 13 Mar 2024 16:15:08 +0100	[thread overview]
Message-ID: <20240313151507.GA25452@redhat.com> (raw)
In-Reply-To: <20240312210233.1941599-2-andrii@kernel.org>

LGTM, one nit below.

On 03/12, Andrii Nakryiko wrote:
>
> +static struct uprobe_cpu_buffer *prepare_uprobe_buffer(struct trace_uprobe *tu,
> +						       struct pt_regs *regs)
> +{
> +	struct uprobe_cpu_buffer *ucb;
> +	int dsize, esize;
> +
> +	esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
> +	dsize = __get_data_size(&tu->tp, regs);
> +
> +	ucb = uprobe_buffer_get();
> +	ucb->dsize = dsize;
> +
> +	store_trace_args(ucb->buf, &tu->tp, regs, esize, dsize);
> +
> +	return ucb;
> +}

OK, but note that every user of ->dsize adds tp.size. So I think you can
simplify this code a bit more if you change prepare_uprobe_buffer() to do

	ucb->dsize = tu->tp.size + dsize;

and update the users.

Oleg.


  reply	other threads:[~2024-03-13 15:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 21:02 [PATCH bpf-next 0/3] uprobes: two common case speed ups Andrii Nakryiko
2024-03-12 21:02 ` [PATCH bpf-next 1/3] uprobes: encapsulate preparation of uprobe args buffer Andrii Nakryiko
2024-03-13 15:15   ` Oleg Nesterov [this message]
2024-03-13 16:52     ` Andrii Nakryiko
2024-03-12 21:02 ` [PATCH bpf-next 2/3] uprobes: prepare uprobe args buffer lazily Andrii Nakryiko
2024-03-13 15:47   ` Oleg Nesterov
2024-03-13 16:57     ` Andrii Nakryiko
2024-03-12 21:02 ` [PATCH bpf-next 3/3] uprobes: add speculative lockless system-wide uprobe filter check Andrii Nakryiko
2024-03-13 13:19   ` Oleg Nesterov
2024-03-13 17:01     ` Andrii Nakryiko
2024-03-13  9:41 ` [PATCH bpf-next 0/3] uprobes: two common case speed ups Jiri Olsa
2024-03-13 17:33   ` Andrii Nakryiko

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=20240313151507.GA25452@redhat.com \
    --to=oleg@redhat.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.