1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ) 3 #define _TRACE_KVM_H 4 5 #include <linux/tracepoint.h> 6 7 #undef TRACE_SYSTEM 8 #define TRACE_SYSTEM kvm 9 #define TRACE_INCLUDE_PATH . 10 #define TRACE_INCLUDE_FILE trace 11 12 /* 13 * Tracepoint for guest mode entry. 14 */ 15 TRACE_EVENT(kvm_ppc_instr, 16 TP_PROTO(unsigned int inst, unsigned long _pc, unsigned int emulate), 17 TP_ARGS(inst, _pc, emulate), 18 19 TP_STRUCT__entry( 20 __field( unsigned int, inst ) 21 __field( unsigned long, pc ) 22 __field( unsigned int, emulate ) 23 ), 24 25 TP_fast_assign( 26 __entry->inst = inst; 27 __entry->pc = _pc; 28 __entry->emulate = emulate; 29 ), 30 31 TP_printk("inst %u pc 0x%lx emulate %u\n", 32 __entry->inst, __entry->pc, __entry->emulate) 33 ); 34 35 TRACE_EVENT(kvm_stlb_inval, 36 TP_PROTO(unsigned int stlb_index), 37 TP_ARGS(stlb_index), 38 39 TP_STRUCT__entry( 40 __field( unsigned int, stlb_index ) 41 ), 42 43 TP_fast_assign( 44 __entry->stlb_index = stlb_index; 45 ), 46 47 TP_printk("stlb_index %u", __entry->stlb_index) 48 ); 49 50 TRACE_EVENT(kvm_stlb_write, 51 TP_PROTO(unsigned int victim, unsigned int tid, unsigned int word0, 52 unsigned int word1, unsigned int word2), 53 TP_ARGS(victim, tid, word0, word1, word2), 54 55 TP_STRUCT__entry( 56 __field( unsigned int, victim ) 57 __field( unsigned int, tid ) 58 __field( unsigned int, word0 ) 59 __field( unsigned int, word1 ) 60 __field( unsigned int, word2 ) 61 ), 62 63 TP_fast_assign( 64 __entry->victim = victim; 65 __entry->tid = tid; 66 __entry->word0 = word0; 67 __entry->word1 = word1; 68 __entry->word2 = word2; 69 ), 70 71 TP_printk("victim %u tid %u w0 %u w1 %u w2 %u", 72 __entry->victim, __entry->tid, __entry->word0, 73 __entry->word1, __entry->word2) 74 ); 75 76 TRACE_EVENT(kvm_gtlb_write, 77 TP_PROTO(unsigned int gtlb_index, unsigned int tid, unsigned int word0, 78 unsigned int word1, unsigned int word2), 79 TP_ARGS(gtlb_index, tid, word0, word1, word2), 80 81 TP_STRUCT__entry( 82 __field( unsigned int, gtlb_index ) 83 __field( unsigned int, tid ) 84 __field( unsigned int, word0 ) 85 __field( unsigned int, word1 ) 86 __field( unsigned int, word2 ) 87 ), 88 89 TP_fast_assign( 90 __entry->gtlb_index = gtlb_index; 91 __entry->tid = tid; 92 __entry->word0 = word0; 93 __entry->word1 = word1; 94 __entry->word2 = word2; 95 ), 96 97 TP_printk("gtlb_index %u tid %u w0 %u w1 %u w2 %u", 98 __entry->gtlb_index, __entry->tid, __entry->word0, 99 __entry->word1, __entry->word2) 100 ); 101 102 TRACE_EVENT(kvm_check_requests, 103 TP_PROTO(struct kvm_vcpu *vcpu), 104 TP_ARGS(vcpu), 105 106 TP_STRUCT__entry( 107 __field( __u32, cpu_nr ) 108 __field( __u32, requests ) 109 ), 110 111 TP_fast_assign( 112 __entry->cpu_nr = vcpu->vcpu_id; 113 __entry->requests = vcpu->requests; 114 ), 115 116 TP_printk("vcpu=%x requests=%x", 117 __entry->cpu_nr, __entry->requests) 118 ); 119 120 #endif /* _TRACE_KVM_H */ 121 122 /* This part must be outside protection */ 123 #include <trace/define_trace.h> 124