From: Jiri Olsa <olsajiri@gmail.com>
To: Jason Xing <kerneljasonxing@gmail.com>
Cc: 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 09:41:19 +0200 [thread overview]
Message-ID: <ZxYFn7fko5C9BnHe@krava> (raw)
In-Reply-To: <20241021050706.29403-1-kerneljasonxing@gmail.com>
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?
thanks,
jirka
>
> Signed-off-by: Jason Xing <kernelxing@tencent.com>
> ---
> v2
> Link: https://lore.kernel.org/all/20241020031422.46894-1-kerneljasonxing@gmail.com/
> 1. handle it in a proper way
> ---
> tools/testing/selftests/bpf/uprobe_multi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/bpf/uprobe_multi.c b/tools/testing/selftests/bpf/uprobe_multi.c
> index c7828b13e5ff..40231f02b95d 100644
> --- a/tools/testing/selftests/bpf/uprobe_multi.c
> +++ b/tools/testing/selftests/bpf/uprobe_multi.c
> @@ -4,6 +4,7 @@
> #include <string.h>
> #include <stdbool.h>
> #include <stdint.h>
> +#include <linux/mman.h>
> #include <sys/mman.h>
> #include <unistd.h>
> #include <sdt.h>
> --
> 2.37.3
>
next prev parent reply other threads:[~2024-10-21 7:41 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 [this message]
2024-10-21 7:51 ` Jason Xing
2024-10-21 8:07 ` Jason Xing
2024-10-21 9:34 ` Jiri Olsa
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=ZxYFn7fko5C9BnHe@krava \
--to=olsajiri@gmail.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 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.