From 7a845a09010a82f65bee1f06922548147d1aaad8 Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Wed, 25 Aug 2021 08:48:51 +0200 Subject: [PATCH] ktrace-CO-RE: Fix compile failure due to missing vmlinux_arch.h Fixes pull request #24 I had forgot to git add headers/vmlinux/vmlinux_arch.h in PR#24 which caused compile failures for ktrace-CO-RE. Signed-off-by: Jesper Dangaard Brouer --- headers/vmlinux/vmlinux_arch.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 headers/vmlinux/vmlinux_arch.h diff --git a/headers/vmlinux/vmlinux_arch.h b/headers/vmlinux/vmlinux_arch.h new file mode 100644 index 0000000..735d638 --- /dev/null +++ b/headers/vmlinux/vmlinux_arch.h @@ -0,0 +1,24 @@ +#ifndef __VMLINUX_ARCH_H__ +#define __VMLINUX_ARCH_H__ +/* + * Notice: Defining __VMLINUX_H__ (or __KERNEL__) cause + * header file to define architecture specific PT_REGS_PARM's. + * Thus, use this together with vmlinux_local.h. + * + * When using '-target bpf' the fallback mechanism doesn't detect right arch + * via compiler defines. + * + * Makefile system in lib/common.mk detect ARCH and defines the + * defines __TARGET_ARCH_$(ARCH) matched on below. + */ +#if defined(__TARGET_ARCH_x86) + #include "vmlinux/arch/x86/vmlinux.h" +#elif defined(__TARGET_ARCH_arm64) + #include "vmlinux/arch/arm64/vmlinux.h" +#elif defined(__TARGET_ARCH_powerpc) + #include "vmlinux/arch/powerpc/vmlinux.h" +#else + #warning "Makefile for BPF-tracing on this arch: not supported yet" +#endif + +#endif /* __VMLINUX_ARCH_H__ */