Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: handle MADV_PAGEOUT error in uprobe_multi.c
@ 2024-10-20  3:14 Jason Xing
  2024-10-20  4:10 ` Jason Xing
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Xing @ 2024-10-20  3:14 UTC (permalink / raw)
  To: ast, daniel, andrii, eddyz87, mykolal, martin.lau, song,
	yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, shuah
  Cc: bpf, linux-kselftest, Jason Xing

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

We can see MADV_PAGEOUT existing in mman-common.h on x86 arch, so
including this header file solves this compilation error.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 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..b0e11ffe0e1c 100644
--- a/tools/testing/selftests/bpf/uprobe_multi.c
+++ b/tools/testing/selftests/bpf/uprobe_multi.c
@@ -5,6 +5,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/mman.h>
+#include <mman-common.h>
 #include <unistd.h>
 #include <sdt.h>
 
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-20  5:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-20  3:14 [PATCH bpf-next] bpf: handle MADV_PAGEOUT error in uprobe_multi.c Jason Xing
2024-10-20  4:10 ` Jason Xing
2024-10-20  5:02   ` Jason Xing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox