Skip to content

Commit

Permalink
ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
  • Loading branch information
Sergey Matyukevich authored and Vineet Gupta committed Apr 26, 2022
1 parent 9a78a8a commit 6aa98f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/arc/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
9 changes: 9 additions & 0 deletions arch/arc/include/uapi/asm/bpf_perf_event.h
Original file line number Diff line number Diff line change
@@ -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__ */

0 comments on commit 6aa98f6

Please sign in to comment.