[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1_dIwRiqbsuWgvF@krava>
Date: Mon, 16 Dec 2024 08:56:19 +0100
From: Jiri Olsa <olsajiri@...il.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Oleg Nesterov <oleg@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
Hao Luo <haoluo@...gle.com>, Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Alan Maguire <alan.maguire@...cle.com>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next 13/13] selftests/bpf: Add 5-byte nop uprobe
trigger bench
On Fri, Dec 13, 2024 at 01:57:56PM -0800, Andrii Nakryiko wrote:
> On Wed, Dec 11, 2024 at 5:36 AM Jiri Olsa <jolsa@...nel.org> wrote:
> >
> > Add 5-byte nop uprobe trigger bench (x86_64 specific) to measure
> > uprobes/uretprobes on top of nop5 instruction.
> >
> > Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> > ---
> > tools/testing/selftests/bpf/bench.c | 12 ++++++
> > .../selftests/bpf/benchs/bench_trigger.c | 42 +++++++++++++++++++
> > .../selftests/bpf/benchs/run_bench_uprobes.sh | 2 +-
> > 3 files changed, 55 insertions(+), 1 deletion(-)
> >
>
> [...]
>
> > static void usetup(bool use_retprobe, bool use_multi, void *target_addr)
> > {
> > size_t uprobe_offset;
> > @@ -448,6 +462,28 @@ static void uretprobe_multi_ret_setup(void)
> > usetup(true, true /* use_multi */, &uprobe_target_ret);
> > }
> >
> > +#ifdef __x86_64__
> > +static void uprobe_nop5_setup(void)
> > +{
> > + usetup(false, false /* !use_multi */, &uprobe_target_nop5);
> > +}
> > +
> > +static void uretprobe_nop5_setup(void)
> > +{
> > + usetup(false, false /* !use_multi */, &uprobe_target_nop5);
> > +}
>
> true /* use_retprobe */
>
> that's the problem with bench setup, right?
yes, but there's more ;-)
we also need change in arch_uretprobe_hijack_return_addr to skip
the extra 3 values (pushed on stack by the uprobe trampoline) when
hijacking the returm value, I'll send new version
jirka
>
> > +
> > +static void uprobe_multi_nop5_setup(void)
> > +{
> > + usetup(false, true /* use_multi */, &uprobe_target_nop5);
> > +}
> > +
> > +static void uretprobe_multi_nop5_setup(void)
> > +{
> > + usetup(false, true /* use_multi */, &uprobe_target_nop5);
> > +}
> > +#endif
> > +
> > const struct bench bench_trig_syscall_count = {
> > .name = "trig-syscall-count",
> > .validate = trigger_validate,
>
> [...]
Powered by blists - more mailing lists