Skip to content

Commit 6aa98f6

Browse files
Sergey Matyukevichvineetgarc
authored andcommitted
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 <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
1 parent 9a78a8a commit 6aa98f6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

arch/arc/include/asm/perf_event.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,8 @@ struct arc_reg_cc_build {
6363

6464
#define PERF_COUNT_ARC_HW_MAX (PERF_COUNT_HW_MAX + 8)
6565

66+
#ifdef CONFIG_PERF_EVENTS
67+
#define perf_arch_bpf_user_pt_regs(regs) (struct user_regs_struct *)regs
68+
#endif
69+
6670
#endif /* __ASM_PERF_EVENT_H */
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
#ifndef _UAPI__ASM_BPF_PERF_EVENT_H__
3+
#define _UAPI__ASM_BPF_PERF_EVENT_H__
4+
5+
#include <asm/ptrace.h>
6+
7+
typedef struct user_regs_struct bpf_user_pt_regs_t;
8+
9+
#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */

0 commit comments

Comments
 (0)