All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com>
Cc: Jiri Olsa <olsajiri@gmail.com>,
	bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, linux-open-source@crowdstrike.com
Subject: Re: [External] Re: [RFC PATCH bpf-next 2/2] selftests/bpf: Add tests for duplicate kprobe symbol handling
Date: Tue, 24 Feb 2026 14:06:26 +0100	[thread overview]
Message-ID: <aZ2iUnroUsOp3QQY@krava> (raw)
In-Reply-To: <aZ2DXhDKG9iS4Rcm@krava>

On Tue, Feb 24, 2026 at 11:54:24AM +0100, Jiri Olsa wrote:
> On Mon, Feb 23, 2026 at 01:56:15PM -0500, Andrey Grodzovsky wrote:
> > On Mon, Feb 23, 2026 at 4:19 AM Jiri Olsa <olsajiri@gmail.com> wrote:
> > >
> > > On Wed, Feb 18, 2026 at 05:56:17PM -0500, Andrey Grodzovsky wrote:
> > >
> > > SNIP
> > >
> > > > diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod_dup_sym.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod_dup_sym.c
> > > > new file mode 100644
> > > > index 000000000000..98b3e085ae90
> > > > --- /dev/null
> > > > +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod_dup_sym.c
> > > > @@ -0,0 +1,45 @@
> > > > +// SPDX-License-Identifier: GPL-2.0
> > > > +/* Copyright (c) 2025 CrowdStrike */
> > > > +/* Test module for duplicate kprobe symbol handling */
> > > > +#include <linux/init.h>
> > > > +#include <linux/module.h>
> > > > +#include <linux/kernel.h>
> > > > +
> > > > +/* Duplicate symbol to test kprobe attachment with duplicate symbols.
> > > > + * This creates a duplicate of the syscall wrapper used in attach_probe tests.
> > > > + * The libbpf fix should handle this by preferring the vmlinux symbol.
> > > > + * This function should NEVER be called - kprobes should attach to vmlinux version.
> > > > + */
> > > > +#ifdef __x86_64__
> > > > +noinline int __x64_sys_nanosleep(void)
> > > > +#elif defined(__s390x__)
> > > > +noinline int __s390x_sys_nanosleep(void)
> > > > +#elif defined(__aarch64__)
> > > > +noinline int __arm64_sys_nanosleep(void)
> > > > +#elif defined(__riscv)
> > > > +noinline int __riscv_sys_nanosleep(void)
> > > > +#else
> > > > +noinline int sys_nanosleep(void)
> > > > +#endif
> > > > +{
> > > > +     WARN_ONCE(1, "bpf_testmod_dup_sym: dummy nanosleep symbol called - this should never execute!\n");
> > > > +     return -EINVAL;
> > > > +}
> > >
> > > hi,
> > > this fails to build for me:
> > >
> > >   CC [M]  bpf_testmod_dup_sym.o
> > > bpf_testmod_dup_sym.c:14:14: error: no previous prototype for ‘__x64_sys_nanosleep’ [-Werror=missing-prototypes]
> > >    14 | noinline int __x64_sys_nanosleep(void)
> > >       |              ^~~~~~~~~~~~~~~~~~~
> > >
> > > jirka
> > 
> > Hey Jiri, ran i on my local mirror of CI repo  with latest rebased to
> > origin/bpf-next_base with command
> > tools/testing/selftests/bpf/vmtest.sh -- ./test_progs -t attach_probe
> > and (arch is x86) and eveyrhing pass.
> > Then i also ran in guthub
> > https://github.com/kernel-patches/bpf/pull/11138 and the only single
> > failure i got
> > is during runtime is some unrealted test failure.
> > https://github.com/kernel-patches/bpf/actions/runs/22318486040/job/64571209293?pr=11138
> > This seems to be because of me defining sys_nanosleep duplicate
> > without static qualifier and so if your
> > local build has -Werror=missing-prototypes,  this warning cause a
> > failure? Do you think we should
> > add static here ?
> 
> I think adding declaration will fix it, but if CI is fine,
> it's something in my setup.. please ignore, I'll check

ok it's just warning, but does not break the build, I can see it
in CI run as well..  but I guess we still want to fix it.. let's
add the missing externs?

jirka

      reply	other threads:[~2026-02-24 13:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 22:56 [RFC PATCH bpf-next 0/2] libbpf: Handle duplicate kprobe symbols Andrey Grodzovsky
2026-02-18 22:56 ` [RFC PATCH bpf-next 1/2] libbpf: Handle duplicate kprobe symbols in attach_kprobe_opts Andrey Grodzovsky
2026-02-18 23:31   ` bot+bpf-ci
2026-02-19  0:28   ` Emil Tsalapatis
2026-02-19 21:57     ` [External] " Andrey Grodzovsky
2026-02-18 22:56 ` [RFC PATCH bpf-next 2/2] selftests/bpf: Add tests for duplicate kprobe symbol handling Andrey Grodzovsky
2026-02-23  9:19   ` Jiri Olsa
2026-02-23 18:56     ` [External] " Andrey Grodzovsky
2026-02-24 10:54       ` Jiri Olsa
2026-02-24 13:06         ` Jiri Olsa [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=aZ2iUnroUsOp3QQY@krava \
    --to=olsajiri@gmail.com \
    --cc=andrey.grodzovsky@crowdstrike.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-open-source@crowdstrike.com \
    /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.