Skip to contentSkip to conversation

libbpf: fix usage of u32 in userspace code

PATCH Applied Andrii Nakryiko 2 participants 2 messages Nov 25, 2019

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

PATCH 1/1 libbpf: fix usage of u32 in userspace code

u32 is not defined for libbpf when compiled outside of kernel sources (e.g., in Github projection). Use __u32 instead.

Fixes b8c54ea455dc ("libbpf: Add support to attach to fentry/fexit tracing progs")
---
 tools/lib/bpf/libbpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
index e1698461c6b3..b20f82e58989 100644
@@ -5128,7 +5128,7 @@ int libbpf_find_vmlinux_btf_id(const char *name,
 	char *dst = raw_tp_btf + sizeof(BTF_PREFIX) - 1;
 	const char *btf_name;
 	int err = -EINVAL;
-	u32 kind;
+	__u32 kind;
 
 	if (IS_ERR(btf)) {
 		pr_warn("vmlinux BTF is not found\n");
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Andrii Nakryiko

u32 is not defined for libbpf when compiled outside of kernel sources (e.g., in Github projection). Use __u32 instead.

Fixes b8c54ea455dc ("libbpf: Add support to attach to fentry/fexit tracing progs")

Applied. Thanks