Skip to content

Commit 33e544e

Browse files
author
Sergey Matyukevich
committed
ARC: 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 <sergey.matyukevich@synopsys.com>
1 parent de71929 commit 33e544e

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
@@ -65,6 +65,10 @@ struct arc_reg_cc_build {
6565

6666
#define PERF_COUNT_ARC_HW_MAX (PERF_COUNT_HW_MAX + 8)
6767

68+
#ifdef CONFIG_PERF_EVENTS
69+
#define perf_arch_bpf_user_pt_regs(regs) (struct user_regs_struct *)regs
70+
#endif
71+
6872
/*
6973
* Some ARC pct quirks:
7074
*
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)