Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Jason Xing <kerneljasonxing@gmail.com>,
	Alan Maguire <alan.maguire@oracle.com>
Cc: Jiri Olsa <olsajiri@gmail.com>,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	eddyz87@gmail.com, mykolal@fb.com, martin.lau@linux.dev,
	song@kernel.org, yonghong.song@linux.dev,
	john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
	haoluo@google.com, shuah@kernel.org, bpf@vger.kernel.org,
	linux-kselftest@vger.kernel.org,
	Jason Xing <kernelxing@tencent.com>
Subject: Re: [PATCH bpf-next v2] bpf: handle MADV_PAGEOUT error in uprobe_multi.c
Date: Mon, 21 Oct 2024 11:34:43 +0200	[thread overview]
Message-ID: <ZxYgM_YDoSJO1TxL@krava> (raw)
In-Reply-To: <CAL+tcoAw1WGnJs2DQjEyzsh_rNXKA44oYX5RvQi8nCvt4+ynLQ@mail.gmail.com>

On Mon, Oct 21, 2024 at 04:07:15PM +0800, Jason Xing wrote:
> On Mon, Oct 21, 2024 at 3:51 PM Jason Xing <kerneljasonxing@gmail.com> wrote:
> >
> > On Mon, Oct 21, 2024 at 3:41 PM Jiri Olsa <olsajiri@gmail.com> wrote:
> > >
> > > On Mon, Oct 21, 2024 at 01:07:06PM +0800, Jason Xing wrote:
> > > > From: Jason Xing <kernelxing@tencent.com>
> > > >
> > > > When I compiled the tools/testing/selftests/bpf, the following error
> > > > pops out:
> > > > uprobe_multi.c: In function ‘trigger_uprobe’:
> > > > uprobe_multi.c:109:26: error: ‘MADV_PAGEOUT’ undeclared (first use in this function); did you mean ‘MADV_RANDOM’?
> > > >    madvise(addr, page_sz, MADV_PAGEOUT);
> > > >                           ^~~~~~~~~~~~
> > > >                           MADV_RANDOM
> > > >
> > > > Including the <linux/linux/mman.h> header file solves this compilation error.
> > >
> > > hi,
> > > strange, uprobe_multi.c even has:
> > >
> > > #ifndef MADV_PAGEOUT
> > > #define MADV_PAGEOUT 21
> > > #endif
> > >
> > > and '#include <sys/mman.h>' should be all that's needed
> > >
> > > could you please share more details (extra flags) on how you compile?
> >
> > OMG, thanks for reminding me. The net-next branch that I compiled
> > doesn't have those three lines. Now I can see them in bpf-next. So I
> > think the issue has been fixed already :)
> 
> Link is https://lore.kernel.org/bpf/d9846ceb-b758-4c17-82d1-e5504122a50a@oracle.com/
> 
> The previous comment is not that right. Making sure to include
> <sys/mman.h> first solves the issue so there are no complaints when
> compiling. No need to define MADV_PAGEOUT, I think.

right, but looks like it was not enough on Alan's setup [1]

jirka


[1] c27d8235ba97 selftests/bpf: Fix uprobe_multi compilation error

  reply	other threads:[~2024-10-21  9:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  5:07 [PATCH bpf-next v2] bpf: handle MADV_PAGEOUT error in uprobe_multi.c Jason Xing
2024-10-21  7:41 ` Jiri Olsa
2024-10-21  7:51   ` Jason Xing
2024-10-21  8:07     ` Jason Xing
2024-10-21  9:34       ` Jiri Olsa [this message]
2024-10-21 10:49         ` Jason Xing

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=ZxYgM_YDoSJO1TxL@krava \
    --to=olsajiri@gmail.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kernelxing@tencent.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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