Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Marc Zyngier | 01630ab | 2017-05-12 11:04:52 +0100 | [diff] [blame] | 2 | #if !defined(_TRACE_ARM_KVM_H) || defined(TRACE_HEADER_MULTI_READ) |
| 3 | #define _TRACE_ARM_KVM_H |
Christoffer Dall | 749cf76c | 2013-01-20 18:28:06 -0500 | [diff] [blame] | 4 | |
| 5 | #include <linux/tracepoint.h> |
| 6 | |
| 7 | #undef TRACE_SYSTEM |
| 8 | #define TRACE_SYSTEM kvm |
| 9 | |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 10 | /* Architecturally implementation defined CP15 register access */ |
| 11 | TRACE_EVENT(kvm_emulate_cp15_imp, |
| 12 | TP_PROTO(unsigned long Op1, unsigned long Rt1, unsigned long CRn, |
| 13 | unsigned long CRm, unsigned long Op2, bool is_write), |
| 14 | TP_ARGS(Op1, Rt1, CRn, CRm, Op2, is_write), |
| 15 | |
| 16 | TP_STRUCT__entry( |
| 17 | __field( unsigned int, Op1 ) |
| 18 | __field( unsigned int, Rt1 ) |
| 19 | __field( unsigned int, CRn ) |
| 20 | __field( unsigned int, CRm ) |
| 21 | __field( unsigned int, Op2 ) |
| 22 | __field( bool, is_write ) |
| 23 | ), |
| 24 | |
| 25 | TP_fast_assign( |
| 26 | __entry->is_write = is_write; |
| 27 | __entry->Op1 = Op1; |
| 28 | __entry->Rt1 = Rt1; |
| 29 | __entry->CRn = CRn; |
| 30 | __entry->CRm = CRm; |
| 31 | __entry->Op2 = Op2; |
| 32 | ), |
| 33 | |
| 34 | TP_printk("Implementation defined CP15: %s\tp15, %u, r%u, c%u, c%u, %u", |
| 35 | (__entry->is_write) ? "mcr" : "mrc", |
| 36 | __entry->Op1, __entry->Rt1, __entry->CRn, |
| 37 | __entry->CRm, __entry->Op2) |
| 38 | ); |
| 39 | |
Andre Przywara | 924de80 | 2015-01-12 16:56:16 +0000 | [diff] [blame] | 40 | TRACE_EVENT(kvm_wfx, |
| 41 | TP_PROTO(unsigned long vcpu_pc, bool is_wfe), |
| 42 | TP_ARGS(vcpu_pc, is_wfe), |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 43 | |
| 44 | TP_STRUCT__entry( |
| 45 | __field( unsigned long, vcpu_pc ) |
Andre Przywara | 924de80 | 2015-01-12 16:56:16 +0000 | [diff] [blame] | 46 | __field( bool, is_wfe ) |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 47 | ), |
| 48 | |
| 49 | TP_fast_assign( |
| 50 | __entry->vcpu_pc = vcpu_pc; |
Andre Przywara | 924de80 | 2015-01-12 16:56:16 +0000 | [diff] [blame] | 51 | __entry->is_wfe = is_wfe; |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 52 | ), |
| 53 | |
Andre Przywara | 924de80 | 2015-01-12 16:56:16 +0000 | [diff] [blame] | 54 | TP_printk("guest executed wf%c at: 0x%08lx", |
| 55 | __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc) |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 56 | ); |
| 57 | |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 58 | TRACE_EVENT(kvm_hvc, |
| 59 | TP_PROTO(unsigned long vcpu_pc, unsigned long r0, unsigned long imm), |
| 60 | TP_ARGS(vcpu_pc, r0, imm), |
| 61 | |
| 62 | TP_STRUCT__entry( |
| 63 | __field( unsigned long, vcpu_pc ) |
| 64 | __field( unsigned long, r0 ) |
| 65 | __field( unsigned long, imm ) |
| 66 | ), |
| 67 | |
| 68 | TP_fast_assign( |
| 69 | __entry->vcpu_pc = vcpu_pc; |
| 70 | __entry->r0 = r0; |
| 71 | __entry->imm = imm; |
| 72 | ), |
| 73 | |
| 74 | TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx", |
| 75 | __entry->vcpu_pc, __entry->r0, __entry->imm) |
| 76 | ); |
| 77 | |
Marc Zyngier | 01630ab | 2017-05-12 11:04:52 +0100 | [diff] [blame] | 78 | #endif /* _TRACE_ARM_KVM_H */ |
Christoffer Dall | 749cf76c | 2013-01-20 18:28:06 -0500 | [diff] [blame] | 79 | |
| 80 | #undef TRACE_INCLUDE_PATH |
Marc Zyngier | 01630ab | 2017-05-12 11:04:52 +0100 | [diff] [blame] | 81 | #define TRACE_INCLUDE_PATH . |
Christoffer Dall | 749cf76c | 2013-01-20 18:28:06 -0500 | [diff] [blame] | 82 | #undef TRACE_INCLUDE_FILE |
| 83 | #define TRACE_INCLUDE_FILE trace |
| 84 | |
| 85 | /* This part must be outside protection */ |
| 86 | #include <trace/define_trace.h> |