selftests/bpf: trace_helpers.c: do not use poisoned type
Subsystems (3)
PATCH 1/1 selftests/bpf: trace_helpers.c: do not use poisoned type
After commit c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize kallsyms cache") trace_helpers.c now includes libbpf_internal.h, and thus can no longer use the u32 type (among others) since they are poison in libbpf_internal.h. Replace u32 with __u32 to fix the following error when building trace_helpers.c on powerpc:
error: attempt to use poisoned "u32"
---
Somehow this error only shows up when I'm building on ppc64le, but not x86_64 and aarch64. But I didn't investigate further.
--- tools/testing/selftests/bpf/trace_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/trace_helpers.c +1 -1
@@ -271,7 +271,7 @@ ssize_t get_uprobe_offset(const void *addr)* addi r2,r2,XXXX */ { -const u32 *insn = (const u32 *)(uintptr_t )addr; +const __u32 *insn = (const __u32 *)(uintptr_t )addr; if ((((*insn & OP_RT_RA_MASK) == ADDIS_R2_R12) || ((*insn & OP_RT_RA_MASK) == LIS_R2)) &&
base-commit: 943b043aeecce9accb6d367af47791c633e95e4d
Signature · 1 line
2.43.0
Quoted 6 lines · Shung-Hsi Yu
After commit
c698eaebdf47("selftests/bpf:trace_helpers.c: Optimize kallsyms cache")trace_helpers.cnow includeslibbpf_internal.h, and thus can no longer use the u32 type (among others) since they are poison inlibbpf_internal.h. Replace u32 with__u32to fix the following error when buildingtrace_helpers.con powerpc:
Quoted 7 lines
error: attempt to use poisoned "u32"
Fixes c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize kallsyms cache")Signed-off-by Shung-Hsi Yu <[email protected]>---
Somehow this error only shows up when I'm building on ppc64le, but notx86_64and aarch64. But I didn't investigate further.
it's within powerpc ifdef:
#if defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2
jirka
Quoted 22 lines
--- tools/testing/selftests/bpf/trace_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/trace_helpers.c +1
-1@@ -271,7 +271,7 @@ ssize_t get_uprobe_offset(const void *addr)* addi r2,r2,XXXX */ { -const u32 *insn = (const u32 *)(uintptr_t )addr; +const __u32 *insn = (const __u32 *)(uintptr_t )addr; if ((((*insn & OP_RT_RA_MASK) == ADDIS_R2_R12) || ((*insn & OP_RT_RA_MASK) == LIS_R2)) &&base-commit:
943b043aeecce9accb6d367af47791c633e95e4dSignature · 1 line
2.43.0
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:
Quoted 9 lines · On Fri, 2 Feb 2024 17:55:58 +0800 you wrote:
After commit
c698eaebdf47("selftests/bpf:trace_helpers.c: Optimize kallsyms cache")trace_helpers.cnow includeslibbpf_internal.h, and thus can no longer use the u32 type (among others) since they are poison inlibbpf_internal.h. Replace u32 with__u32to fix the following error when buildingtrace_helpers.con powerpc:error: attempt to use poisoned "u32"
[...]
Here is the summary with links:
- [bpf] selftests/bpf: trace_helpers.c: do not use poisoned type
https://git.kernel.org/bpf/bpf-next/c/a68b50f47bec
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html