summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/perf_event.h
diff options
context:
space:
mode:
authorQuan Zhou <zhouquan@iscas.ac.cn>2024-10-15 10:58:24 +0800
committerAnup Patel <anup@brainfault.org>2024-10-28 16:41:12 +0530
commit5bb5ccb3e8d8dba29941cd78d5c1bcd27b227b4a (patch)
tree08df2f4c3044bc2b0d3ae182af9bfde458dcbe39 /arch/riscv/include/asm/perf_event.h
parent81983758430957d9a5cb3333fe324fd70cf63e7e (diff)
riscv: perf: add guest vs host distinction
Introduce basic guest support in perf, enabling it to distinguish between PMU interrupts in the host or guest, and collect fundamental information. Signed-off-by: Quan Zhou <zhouquan@iscas.ac.cn> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Link: https://lore.kernel.org/r/a67d527dc1b11493fe11f7f53584772fdd983744.1728957131.git.zhouquan@iscas.ac.cn Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/riscv/include/asm/perf_event.h')
-rw-r--r--arch/riscv/include/asm/perf_event.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/perf_event.h b/arch/riscv/include/asm/perf_event.h
index 665bbc9b2f84..38926b4a902d 100644
--- a/arch/riscv/include/asm/perf_event.h
+++ b/arch/riscv/include/asm/perf_event.h
@@ -8,7 +8,11 @@
#ifndef _ASM_RISCV_PERF_EVENT_H
#define _ASM_RISCV_PERF_EVENT_H
+#ifdef CONFIG_PERF_EVENTS
#include <linux/perf_event.h>
+extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
+extern unsigned long perf_misc_flags(struct pt_regs *regs);
+#define perf_misc_flags(regs) perf_misc_flags(regs)
#define perf_arch_bpf_user_pt_regs(regs) (struct user_regs_struct *)regs
#define perf_arch_fetch_caller_regs(regs, __ip) { \
@@ -17,4 +21,6 @@
(regs)->sp = current_stack_pointer; \
(regs)->status = SR_PP; \
}
+#endif
+
#endif /* _ASM_RISCV_PERF_EVENT_H */