Skip to contentSkip to conversation

selftests/bpf: Fix compilation error in get_uprobe_offset()

PATCH Applied Jerome Marchand 4 participants 4 messages Dec 18, 2024 – Dec 19, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/bpf: Fix compilation error in get_uprobe_offset()

In get_uprobe_offset(), the call to procmap_query() use the constant PROCMAP_QUERY_VMA_EXECUTABLE, even if PROCMAP_QUERY is not defined.

Define PROCMAP_QUERY_VMA_EXECUTABLE when PROCMAP_QUERY isn't.

Fixes 4e9e07603ecd ("selftests/bpf: make use of PROCMAP_QUERY ioctl if available")
---
 tools/testing/selftests/bpf/trace_helpers.c | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/bpf/trace_helpers.c +3 -0
index 2d742fdac6b9..51fa29e0e083 100644
@@ -293,6 +293,9 @@ static int procmap_query(int fd, const void *addr, __u32 query_flags, size_t *st
 	return 0;
 }
 #else
+
+#define PROCMAP_QUERY_VMA_EXECUTABLE 0x04
+
 static int procmap_query(int fd, const void *addr, __u32 query_flags, size_t *start, size_t *offset, int *flags)
 {
 	return -EOPNOTSUPP;
Signature · 1 line
2.47.1
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jerome Marchand

In get_uprobe_offset(), the call to procmap_query() use the constant PROCMAP_QUERY_VMA_EXECUTABLE, even if PROCMAP_QUERY is not defined.

Define PROCMAP_QUERY_VMA_EXECUTABLE when PROCMAP_QUERY isn't.

Fixes 4e9e07603ecd ("selftests/bpf: make use of PROCMAP_QUERY ioctl if available")
maintainer
#2 lore raw
Quoted 10 lines · Yonghong Song
Quoted 7 lines · Jerome Marchand

In get_uprobe_offset(), the call to procmap_query() use the constant PROCMAP_QUERY_VMA_EXECUTABLE, even if PROCMAP_QUERY is not defined.

Define PROCMAP_QUERY_VMA_EXECUTABLE when PROCMAP_QUERY isn't.

Fixes 4e9e07603ecd ("selftests/bpf: make use of PROCMAP_QUERY ioctl if available")

lgtm, I've wrapped this in an ifndef while applying.

#3 lore raw
In reply to Jerome Marchand
This patch was applied to bpf/bpf.git (master) by Daniel Borkmann <[email protected]>:

Hello:

This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <[email protected]>:

Quoted 9 lines · On Wed, 18 Dec 2024 18:57:24 +0100 you wrote:

In get_uprobe_offset(), the call to procmap_query() use the constant PROCMAP_QUERY_VMA_EXECUTABLE, even if PROCMAP_QUERY is not defined.

Define PROCMAP_QUERY_VMA_EXECUTABLE when PROCMAP_QUERY isn't.

Fixes 4e9e07603ecd ("selftests/bpf: make use of PROCMAP_QUERY ioctl if available")

[...]

Here is the summary with links:
- selftests/bpf: Fix compilation error in get_uprobe_offset()

    https://git.kernel.org/bpf/bpf/c/716f2bca1ce9

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html