ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type
Subsystems (3)
PATCH 1/1 ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type
From: Sergey Matyukevich <[email protected]>
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.
---
Originally I sent this patch via linux-snps-arc mailing list: see [1]. However this patch accompanies ARC support for libbpf bpf_tracing.h accepted to bpf kernel tree: see [2].
So it looks like it makes sense to post this patch here as well. I will also update linux-snps-arc patch series accordingly.
Regards,
Sergey
[1] https://lore.kernel.org/linux-snps-arc/[email protected]/
[2] https://lore.kernel.org/bpf/[email protected]/
arch/arc/include/asm/perf_event.h | 4 ++++ arch/arc/include/uapi/asm/bpf_perf_event.h | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 arch/arc/include/uapi/asm/bpf_perf_event.h
arch/arc/include/asm/perf_event.h +4 -0
@@ -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 */
arch/arc/include/uapi/asm/bpf_perf_event.h new file +9 -0
@@ -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 <asm/ptrace.h> + +typedef struct user_regs_struct bpf_user_pt_regs_t ; + +#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
Signature · 1 line
2.35.1
Vineet Gupta
maintainerQuoted 13 lines · Sergey Matyukevich
From: Sergey Matyukevich <[email protected]>
Define appropriate uapi for the
BPF_PROG_TYPE_PERF_EVENTprogram type by exporting theuser_regs_structstructure instead of thept_regsstructure that is in-kernel only.Signed-off-by Sergey Matyukevich <[email protected]>---
Originally I sent this patch via linux-snps-arc mailing list: see [1]. However this patch accompanies ARC support for libbpf
bpf_tracing.haccepted to bpf kernel tree: see [2].
Quoted 5 lines
So it looks like it makes sense to post this patch here as well. I will also update linux-snps-arc patch series accordingly.
Regards,
Sergey
Applied !
Thx,
-Vineet
Quoted 38 lines
[1] https://lore.kernel.org/linux-snps-arc/[email protected]/
[2] https://lore.kernel.org/bpf/[email protected]/arch/arc/include/asm/perf_event.h | 4 ++++ arch/arc/include/uapi/asm/bpf_perf_event.h | 9 +++++++++ 2 files changed, 13 insertions(+)create mode 100644
arch/arc/include/uapi/asm/bpf_perf_event.harch/arc/include/asm/perf_event.h +4
-0@@ -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 */ arch/arc/include/uapi/asm/bpf_perf_event.h new file +9
-0@@ -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 <asm/ptrace.h> + +typedef struct user_regs_struct bpf_user_pt_regs_t ; + +#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */