From: Sergey Matyukevich Date: Thu, 14 Apr 2022 08:11:26 +0000 (+0300) Subject: ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6aa98f6217861889523e38b0141c8c71b2ef8a83;p=linux.git ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type Define appropriate uapi for the BPF_PROG_TYPE_PERF_EVENT program type by exporting the user_regs_struct structure instead of the pt_regs structure that is in-kernel only. Signed-off-by: Sergey Matyukevich Signed-off-by: Vineet Gupta --- diff --git a/arch/arc/include/asm/perf_event.h b/arch/arc/include/asm/perf_event.h index 4c919c0f4b305..d5719a260864c 100644 --- a/arch/arc/include/asm/perf_event.h +++ b/arch/arc/include/asm/perf_event.h @@ -63,4 +63,8 @@ struct arc_reg_cc_build { #define PERF_COUNT_ARC_HW_MAX (PERF_COUNT_HW_MAX + 8) +#ifdef CONFIG_PERF_EVENTS +#define perf_arch_bpf_user_pt_regs(regs) (struct user_regs_struct *)regs +#endif + #endif /* __ASM_PERF_EVENT_H */ diff --git a/arch/arc/include/uapi/asm/bpf_perf_event.h b/arch/arc/include/uapi/asm/bpf_perf_event.h new file mode 100644 index 0000000000000..6cb1c2823288b --- /dev/null +++ b/arch/arc/include/uapi/asm/bpf_perf_event.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ +#define _UAPI__ASM_BPF_PERF_EVENT_H__ + +#include + +typedef struct user_regs_struct bpf_user_pt_regs_t; + +#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */