1 // SPDX-License-Identifier: GPL-2.0
3 * Tracepoints for RISC-V KVM
5 * Copyright 2024 Beijing ESWIN Computing Technology Co., Ltd.
8 #if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
11 #include <linux/tracepoint.h>
14 #define TRACE_SYSTEM kvm
16 TRACE_EVENT(kvm_entry
,
17 TP_PROTO(struct kvm_vcpu
*vcpu
),
21 __field(unsigned long, pc
)
25 __entry
->pc
= vcpu
->arch
.guest_context
.sepc
;
28 TP_printk("PC: 0x016%lx", __entry
->pc
)
32 TP_PROTO(struct kvm_cpu_trap
*trap
),
36 __field(unsigned long, sepc
)
37 __field(unsigned long, scause
)
38 __field(unsigned long, stval
)
39 __field(unsigned long, htval
)
40 __field(unsigned long, htinst
)
44 __entry
->sepc
= trap
->sepc
;
45 __entry
->scause
= trap
->scause
;
46 __entry
->stval
= trap
->stval
;
47 __entry
->htval
= trap
->htval
;
48 __entry
->htinst
= trap
->htinst
;
51 TP_printk("SEPC:0x%lx, SCAUSE:0x%lx, STVAL:0x%lx, HTVAL:0x%lx, HTINST:0x%lx",
59 #endif /* _TRACE_RSICV_KVM_H */
61 #undef TRACE_INCLUDE_PATH
62 #define TRACE_INCLUDE_PATH .
63 #undef TRACE_INCLUDE_FILE
64 #define TRACE_INCLUDE_FILE trace
66 /* This part must be outside protection */
67 #include <trace/define_trace.h>