1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 246f43c6eSMarcelo Tosatti #if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ) 346f43c6eSMarcelo Tosatti #define _TRACE_KVM_H 446f43c6eSMarcelo Tosatti 546f43c6eSMarcelo Tosatti #include <linux/tracepoint.h> 646f43c6eSMarcelo Tosatti 746f43c6eSMarcelo Tosatti #undef TRACE_SYSTEM 846f43c6eSMarcelo Tosatti #define TRACE_SYSTEM kvm 946f43c6eSMarcelo Tosatti 1046f43c6eSMarcelo Tosatti /* 1146f43c6eSMarcelo Tosatti * Tracepoint for guest mode entry. 1246f43c6eSMarcelo Tosatti */ 1346f43c6eSMarcelo Tosatti TRACE_EVENT(kvm_ppc_instr, 14346b2762SAlexander Graf TP_PROTO(unsigned int inst, unsigned long _pc, unsigned int emulate), 15346b2762SAlexander Graf TP_ARGS(inst, _pc, emulate), 1646f43c6eSMarcelo Tosatti 1746f43c6eSMarcelo Tosatti TP_STRUCT__entry( 1846f43c6eSMarcelo Tosatti __field( unsigned int, inst ) 1946f43c6eSMarcelo Tosatti __field( unsigned long, pc ) 2046f43c6eSMarcelo Tosatti __field( unsigned int, emulate ) 2146f43c6eSMarcelo Tosatti ), 2246f43c6eSMarcelo Tosatti 2346f43c6eSMarcelo Tosatti TP_fast_assign( 2446f43c6eSMarcelo Tosatti __entry->inst = inst; 25346b2762SAlexander Graf __entry->pc = _pc; 2646f43c6eSMarcelo Tosatti __entry->emulate = emulate; 2746f43c6eSMarcelo Tosatti ), 2846f43c6eSMarcelo Tosatti 2946f43c6eSMarcelo Tosatti TP_printk("inst %u pc 0x%lx emulate %u\n", 3046f43c6eSMarcelo Tosatti __entry->inst, __entry->pc, __entry->emulate) 3146f43c6eSMarcelo Tosatti ); 3246f43c6eSMarcelo Tosatti 3346f43c6eSMarcelo Tosatti TRACE_EVENT(kvm_stlb_inval, 3446f43c6eSMarcelo Tosatti TP_PROTO(unsigned int stlb_index), 3546f43c6eSMarcelo Tosatti TP_ARGS(stlb_index), 3646f43c6eSMarcelo Tosatti 3746f43c6eSMarcelo Tosatti TP_STRUCT__entry( 3846f43c6eSMarcelo Tosatti __field( unsigned int, stlb_index ) 3946f43c6eSMarcelo Tosatti ), 4046f43c6eSMarcelo Tosatti 4146f43c6eSMarcelo Tosatti TP_fast_assign( 4246f43c6eSMarcelo Tosatti __entry->stlb_index = stlb_index; 4346f43c6eSMarcelo Tosatti ), 4446f43c6eSMarcelo Tosatti 4546f43c6eSMarcelo Tosatti TP_printk("stlb_index %u", __entry->stlb_index) 4646f43c6eSMarcelo Tosatti ); 4746f43c6eSMarcelo Tosatti 4846f43c6eSMarcelo Tosatti TRACE_EVENT(kvm_stlb_write, 4946f43c6eSMarcelo Tosatti TP_PROTO(unsigned int victim, unsigned int tid, unsigned int word0, 5046f43c6eSMarcelo Tosatti unsigned int word1, unsigned int word2), 5146f43c6eSMarcelo Tosatti TP_ARGS(victim, tid, word0, word1, word2), 5246f43c6eSMarcelo Tosatti 5346f43c6eSMarcelo Tosatti TP_STRUCT__entry( 5446f43c6eSMarcelo Tosatti __field( unsigned int, victim ) 5546f43c6eSMarcelo Tosatti __field( unsigned int, tid ) 5646f43c6eSMarcelo Tosatti __field( unsigned int, word0 ) 5746f43c6eSMarcelo Tosatti __field( unsigned int, word1 ) 5846f43c6eSMarcelo Tosatti __field( unsigned int, word2 ) 5946f43c6eSMarcelo Tosatti ), 6046f43c6eSMarcelo Tosatti 6146f43c6eSMarcelo Tosatti TP_fast_assign( 6246f43c6eSMarcelo Tosatti __entry->victim = victim; 6346f43c6eSMarcelo Tosatti __entry->tid = tid; 6446f43c6eSMarcelo Tosatti __entry->word0 = word0; 6546f43c6eSMarcelo Tosatti __entry->word1 = word1; 6646f43c6eSMarcelo Tosatti __entry->word2 = word2; 6746f43c6eSMarcelo Tosatti ), 6846f43c6eSMarcelo Tosatti 6946f43c6eSMarcelo Tosatti TP_printk("victim %u tid %u w0 %u w1 %u w2 %u", 7046f43c6eSMarcelo Tosatti __entry->victim, __entry->tid, __entry->word0, 7146f43c6eSMarcelo Tosatti __entry->word1, __entry->word2) 7246f43c6eSMarcelo Tosatti ); 7346f43c6eSMarcelo Tosatti 7446f43c6eSMarcelo Tosatti TRACE_EVENT(kvm_gtlb_write, 7546f43c6eSMarcelo Tosatti TP_PROTO(unsigned int gtlb_index, unsigned int tid, unsigned int word0, 7646f43c6eSMarcelo Tosatti unsigned int word1, unsigned int word2), 7746f43c6eSMarcelo Tosatti TP_ARGS(gtlb_index, tid, word0, word1, word2), 7846f43c6eSMarcelo Tosatti 7946f43c6eSMarcelo Tosatti TP_STRUCT__entry( 8046f43c6eSMarcelo Tosatti __field( unsigned int, gtlb_index ) 8146f43c6eSMarcelo Tosatti __field( unsigned int, tid ) 8246f43c6eSMarcelo Tosatti __field( unsigned int, word0 ) 8346f43c6eSMarcelo Tosatti __field( unsigned int, word1 ) 8446f43c6eSMarcelo Tosatti __field( unsigned int, word2 ) 8546f43c6eSMarcelo Tosatti ), 8646f43c6eSMarcelo Tosatti 8746f43c6eSMarcelo Tosatti TP_fast_assign( 8846f43c6eSMarcelo Tosatti __entry->gtlb_index = gtlb_index; 8946f43c6eSMarcelo Tosatti __entry->tid = tid; 9046f43c6eSMarcelo Tosatti __entry->word0 = word0; 9146f43c6eSMarcelo Tosatti __entry->word1 = word1; 9246f43c6eSMarcelo Tosatti __entry->word2 = word2; 9346f43c6eSMarcelo Tosatti ), 9446f43c6eSMarcelo Tosatti 9546f43c6eSMarcelo Tosatti TP_printk("gtlb_index %u tid %u w0 %u w1 %u w2 %u", 9646f43c6eSMarcelo Tosatti __entry->gtlb_index, __entry->tid, __entry->word0, 9746f43c6eSMarcelo Tosatti __entry->word1, __entry->word2) 9846f43c6eSMarcelo Tosatti ); 9946f43c6eSMarcelo Tosatti 1006346046cSAlexander Graf TRACE_EVENT(kvm_check_requests, 1016346046cSAlexander Graf TP_PROTO(struct kvm_vcpu *vcpu), 1026346046cSAlexander Graf TP_ARGS(vcpu), 1036346046cSAlexander Graf 1046346046cSAlexander Graf TP_STRUCT__entry( 1056346046cSAlexander Graf __field( __u32, cpu_nr ) 1066346046cSAlexander Graf __field( __u32, requests ) 1076346046cSAlexander Graf ), 1086346046cSAlexander Graf 1096346046cSAlexander Graf TP_fast_assign( 1106346046cSAlexander Graf __entry->cpu_nr = vcpu->vcpu_id; 1116346046cSAlexander Graf __entry->requests = vcpu->requests; 1126346046cSAlexander Graf ), 1136346046cSAlexander Graf 1146346046cSAlexander Graf TP_printk("vcpu=%x requests=%x", 1156346046cSAlexander Graf __entry->cpu_nr, __entry->requests) 1166346046cSAlexander Graf ); 1176346046cSAlexander Graf 11846f43c6eSMarcelo Tosatti #endif /* _TRACE_KVM_H */ 11946f43c6eSMarcelo Tosatti 12046f43c6eSMarcelo Tosatti /* This part must be outside protection */ 121*28c5bcf7SScott Wood #undef TRACE_INCLUDE_PATH 122*28c5bcf7SScott Wood #undef TRACE_INCLUDE_FILE 123*28c5bcf7SScott Wood 124*28c5bcf7SScott Wood #define TRACE_INCLUDE_PATH . 125*28c5bcf7SScott Wood #define TRACE_INCLUDE_FILE trace 126*28c5bcf7SScott Wood 12746f43c6eSMarcelo Tosatti #include <trace/define_trace.h> 128