selftests/bpf: trace_helpers.c: do not use poisoned type
authorShung-Hsi Yu <shung-hsi.yu@suse.com>
Fri, 2 Feb 2024 09:55:58 +0000 (17:55 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Fri, 2 Feb 2024 22:14:03 +0000 (14:14 -0800)
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"

Fixes: c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize kallsyms cache")
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20240202095559.12900-1-shung-hsi.yu@suse.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/trace_helpers.c

index 4faa898ff7fc430ecf2a9ec39a7336618b625528..27fd7ed3e4b0cf3e0da9b971b40f8bca3b1ca23c 100644 (file)
@@ -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)) &&