Re: [PATCH bpf-next] bpf: handle implicit declaration of function gettid in bpf_iter.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 29, 2024 at 12:20 AM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
>
> On Sun, Oct 27, 2024 at 8:41 PM Jason Xing <kerneljasonxing@xxxxxxxxx> wrote:
> >
> > From: Jason Xing <kernelxing@xxxxxxxxxxx>
> >
> > As we can see from the title, when I compiled the selftests/bpf, I
> > saw the error:
> > implicit declaration of function ‘gettid’ ; did you mean ‘getgid’? [-Werror=implicit-function-declaration]
> >   skel->bss->tid = gettid();
> >                    ^~~~~~
> >                    getgid
> >
> > Adding a define to fix it (referring to
> > tools/perf/tests/shell/coresight/thread_loop/thread_loop.c file.
> >
> > Signed-off-by: Jason Xing <kernelxing@xxxxxxxxxxx>
> > ---
> >  tools/testing/selftests/bpf/prog_tests/bpf_iter.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
> > index f0a3a9c18e9e..a105759f3dcf 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
> > @@ -34,6 +34,8 @@
> >  #include "bpf_iter_ksym.skel.h"
> >  #include "bpf_iter_sockmap.skel.h"
> >
> > +#define gettid() syscall(SYS_gettid)
> > +
>
> We just call syscall(SYS_gettid) directly in all other tests, so let's
> do just that?

I got it and will adjust the bpf_iter.c in the next version.

Thanks,
Jason





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux