Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / arch / riscv / kvm / trace.h
blob3d54175d805cbc276358dc8699a4ce900be86eb6
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Tracepoints for RISC-V KVM
5 * Copyright 2024 Beijing ESWIN Computing Technology Co., Ltd.
7 */
8 #if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define _TRACE_KVM_H
11 #include <linux/tracepoint.h>
13 #undef TRACE_SYSTEM
14 #define TRACE_SYSTEM kvm
16 TRACE_EVENT(kvm_entry,
17 TP_PROTO(struct kvm_vcpu *vcpu),
18 TP_ARGS(vcpu),
20 TP_STRUCT__entry(
21 __field(unsigned long, pc)
24 TP_fast_assign(
25 __entry->pc = vcpu->arch.guest_context.sepc;
28 TP_printk("PC: 0x016%lx", __entry->pc)
31 TRACE_EVENT(kvm_exit,
32 TP_PROTO(struct kvm_cpu_trap *trap),
33 TP_ARGS(trap),
35 TP_STRUCT__entry(
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)
43 TP_fast_assign(
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",
52 __entry->sepc,
53 __entry->scause,
54 __entry->stval,
55 __entry->htval,
56 __entry->htinst)
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>