Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kvm: powerpc: booke: Move booke related tracepoints to separate header

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

authored by

Aneesh Kumar K.V and committed by
Alexander Graf
dba291f2 72c12535

+183 -207
+3 -1
arch/powerpc/kvm/booke.c
··· 40 40 41 41 #include "timing.h" 42 42 #include "booke.h" 43 - #include "trace.h" 43 + 44 + #define CREATE_TRACE_POINTS 45 + #include "trace_booke.h" 44 46 45 47 unsigned long kvmppc_booke_handlers; 46 48
+1 -1
arch/powerpc/kvm/e500_mmu.c
··· 32 32 #include <asm/kvm_ppc.h> 33 33 34 34 #include "e500.h" 35 - #include "trace.h" 35 + #include "trace_booke.h" 36 36 #include "timing.h" 37 37 #include "e500_mmu_host.h" 38 38
+2 -1
arch/powerpc/kvm/e500_mmu_host.c
··· 32 32 #include <asm/kvm_ppc.h> 33 33 34 34 #include "e500.h" 35 - #include "trace.h" 36 35 #include "timing.h" 37 36 #include "e500_mmu_host.h" 37 + 38 + #include "trace_booke.h" 38 39 39 40 #define to_htlb1_esel(esel) (host_tlb_params[1].entries - (esel) - 1) 40 41
-204
arch/powerpc/kvm/trace.h
··· 31 31 __entry->inst, __entry->pc, __entry->emulate) 32 32 ); 33 33 34 - #ifdef CONFIG_PPC_BOOK3S 35 - #define kvm_trace_symbol_exit \ 36 - {0x100, "SYSTEM_RESET"}, \ 37 - {0x200, "MACHINE_CHECK"}, \ 38 - {0x300, "DATA_STORAGE"}, \ 39 - {0x380, "DATA_SEGMENT"}, \ 40 - {0x400, "INST_STORAGE"}, \ 41 - {0x480, "INST_SEGMENT"}, \ 42 - {0x500, "EXTERNAL"}, \ 43 - {0x501, "EXTERNAL_LEVEL"}, \ 44 - {0x502, "EXTERNAL_HV"}, \ 45 - {0x600, "ALIGNMENT"}, \ 46 - {0x700, "PROGRAM"}, \ 47 - {0x800, "FP_UNAVAIL"}, \ 48 - {0x900, "DECREMENTER"}, \ 49 - {0x980, "HV_DECREMENTER"}, \ 50 - {0xc00, "SYSCALL"}, \ 51 - {0xd00, "TRACE"}, \ 52 - {0xe00, "H_DATA_STORAGE"}, \ 53 - {0xe20, "H_INST_STORAGE"}, \ 54 - {0xe40, "H_EMUL_ASSIST"}, \ 55 - {0xf00, "PERFMON"}, \ 56 - {0xf20, "ALTIVEC"}, \ 57 - {0xf40, "VSX"} 58 - #else 59 - #define kvm_trace_symbol_exit \ 60 - {0, "CRITICAL"}, \ 61 - {1, "MACHINE_CHECK"}, \ 62 - {2, "DATA_STORAGE"}, \ 63 - {3, "INST_STORAGE"}, \ 64 - {4, "EXTERNAL"}, \ 65 - {5, "ALIGNMENT"}, \ 66 - {6, "PROGRAM"}, \ 67 - {7, "FP_UNAVAIL"}, \ 68 - {8, "SYSCALL"}, \ 69 - {9, "AP_UNAVAIL"}, \ 70 - {10, "DECREMENTER"}, \ 71 - {11, "FIT"}, \ 72 - {12, "WATCHDOG"}, \ 73 - {13, "DTLB_MISS"}, \ 74 - {14, "ITLB_MISS"}, \ 75 - {15, "DEBUG"}, \ 76 - {32, "SPE_UNAVAIL"}, \ 77 - {33, "SPE_FP_DATA"}, \ 78 - {34, "SPE_FP_ROUND"}, \ 79 - {35, "PERFORMANCE_MONITOR"}, \ 80 - {36, "DOORBELL"}, \ 81 - {37, "DOORBELL_CRITICAL"}, \ 82 - {38, "GUEST_DBELL"}, \ 83 - {39, "GUEST_DBELL_CRIT"}, \ 84 - {40, "HV_SYSCALL"}, \ 85 - {41, "HV_PRIV"} 86 - #endif 87 - 88 - #ifndef CONFIG_KVM_BOOK3S_PR_POSSIBLE 89 - /* 90 - * For pr we define this in trace_pr.h since it pr can be built as 91 - * a module 92 - */ 93 - 94 - TRACE_EVENT(kvm_exit, 95 - TP_PROTO(unsigned int exit_nr, struct kvm_vcpu *vcpu), 96 - TP_ARGS(exit_nr, vcpu), 97 - 98 - TP_STRUCT__entry( 99 - __field( unsigned int, exit_nr ) 100 - __field( unsigned long, pc ) 101 - __field( unsigned long, msr ) 102 - __field( unsigned long, dar ) 103 - __field( unsigned long, last_inst ) 104 - ), 105 - 106 - TP_fast_assign( 107 - __entry->exit_nr = exit_nr; 108 - __entry->pc = kvmppc_get_pc(vcpu); 109 - __entry->dar = kvmppc_get_fault_dar(vcpu); 110 - __entry->msr = vcpu->arch.shared->msr; 111 - __entry->last_inst = vcpu->arch.last_inst; 112 - ), 113 - 114 - TP_printk("exit=%s" 115 - " | pc=0x%lx" 116 - " | msr=0x%lx" 117 - " | dar=0x%lx" 118 - " | last_inst=0x%lx" 119 - , 120 - __print_symbolic(__entry->exit_nr, kvm_trace_symbol_exit), 121 - __entry->pc, 122 - __entry->msr, 123 - __entry->dar, 124 - __entry->last_inst 125 - ) 126 - ); 127 - 128 - TRACE_EVENT(kvm_unmap_hva, 129 - TP_PROTO(unsigned long hva), 130 - TP_ARGS(hva), 131 - 132 - TP_STRUCT__entry( 133 - __field( unsigned long, hva ) 134 - ), 135 - 136 - TP_fast_assign( 137 - __entry->hva = hva; 138 - ), 139 - 140 - TP_printk("unmap hva 0x%lx\n", __entry->hva) 141 - ); 142 - #endif 143 - 144 34 TRACE_EVENT(kvm_stlb_inval, 145 35 TP_PROTO(unsigned int stlb_index), 146 36 TP_ARGS(stlb_index), ··· 115 225 TP_printk("vcpu=%x requests=%x", 116 226 __entry->cpu_nr, __entry->requests) 117 227 ); 118 - 119 - /************************************************************************* 120 - * Book3E trace points * 121 - *************************************************************************/ 122 - 123 - #ifdef CONFIG_BOOKE 124 - 125 - TRACE_EVENT(kvm_booke206_stlb_write, 126 - TP_PROTO(__u32 mas0, __u32 mas8, __u32 mas1, __u64 mas2, __u64 mas7_3), 127 - TP_ARGS(mas0, mas8, mas1, mas2, mas7_3), 128 - 129 - TP_STRUCT__entry( 130 - __field( __u32, mas0 ) 131 - __field( __u32, mas8 ) 132 - __field( __u32, mas1 ) 133 - __field( __u64, mas2 ) 134 - __field( __u64, mas7_3 ) 135 - ), 136 - 137 - TP_fast_assign( 138 - __entry->mas0 = mas0; 139 - __entry->mas8 = mas8; 140 - __entry->mas1 = mas1; 141 - __entry->mas2 = mas2; 142 - __entry->mas7_3 = mas7_3; 143 - ), 144 - 145 - TP_printk("mas0=%x mas8=%x mas1=%x mas2=%llx mas7_3=%llx", 146 - __entry->mas0, __entry->mas8, __entry->mas1, 147 - __entry->mas2, __entry->mas7_3) 148 - ); 149 - 150 - TRACE_EVENT(kvm_booke206_gtlb_write, 151 - TP_PROTO(__u32 mas0, __u32 mas1, __u64 mas2, __u64 mas7_3), 152 - TP_ARGS(mas0, mas1, mas2, mas7_3), 153 - 154 - TP_STRUCT__entry( 155 - __field( __u32, mas0 ) 156 - __field( __u32, mas1 ) 157 - __field( __u64, mas2 ) 158 - __field( __u64, mas7_3 ) 159 - ), 160 - 161 - TP_fast_assign( 162 - __entry->mas0 = mas0; 163 - __entry->mas1 = mas1; 164 - __entry->mas2 = mas2; 165 - __entry->mas7_3 = mas7_3; 166 - ), 167 - 168 - TP_printk("mas0=%x mas1=%x mas2=%llx mas7_3=%llx", 169 - __entry->mas0, __entry->mas1, 170 - __entry->mas2, __entry->mas7_3) 171 - ); 172 - 173 - TRACE_EVENT(kvm_booke206_ref_release, 174 - TP_PROTO(__u64 pfn, __u32 flags), 175 - TP_ARGS(pfn, flags), 176 - 177 - TP_STRUCT__entry( 178 - __field( __u64, pfn ) 179 - __field( __u32, flags ) 180 - ), 181 - 182 - TP_fast_assign( 183 - __entry->pfn = pfn; 184 - __entry->flags = flags; 185 - ), 186 - 187 - TP_printk("pfn=%llx flags=%x", 188 - __entry->pfn, __entry->flags) 189 - ); 190 - 191 - TRACE_EVENT(kvm_booke_queue_irqprio, 192 - TP_PROTO(struct kvm_vcpu *vcpu, unsigned int priority), 193 - TP_ARGS(vcpu, priority), 194 - 195 - TP_STRUCT__entry( 196 - __field( __u32, cpu_nr ) 197 - __field( __u32, priority ) 198 - __field( unsigned long, pending ) 199 - ), 200 - 201 - TP_fast_assign( 202 - __entry->cpu_nr = vcpu->vcpu_id; 203 - __entry->priority = priority; 204 - __entry->pending = vcpu->arch.pending_exceptions; 205 - ), 206 - 207 - TP_printk("vcpu=%x prio=%x pending=%lx", 208 - __entry->cpu_nr, __entry->priority, __entry->pending) 209 - ); 210 - 211 - #endif 212 228 213 229 #endif /* _TRACE_KVM_H */ 214 230
+177
arch/powerpc/kvm/trace_booke.h
··· 1 + #if !defined(_TRACE_KVM_BOOKE_H) || defined(TRACE_HEADER_MULTI_READ) 2 + #define _TRACE_KVM_BOOKE_H 3 + 4 + #include <linux/tracepoint.h> 5 + 6 + #undef TRACE_SYSTEM 7 + #define TRACE_SYSTEM kvm_booke 8 + #define TRACE_INCLUDE_PATH . 9 + #define TRACE_INCLUDE_FILE trace_booke 10 + 11 + #define kvm_trace_symbol_exit \ 12 + {0, "CRITICAL"}, \ 13 + {1, "MACHINE_CHECK"}, \ 14 + {2, "DATA_STORAGE"}, \ 15 + {3, "INST_STORAGE"}, \ 16 + {4, "EXTERNAL"}, \ 17 + {5, "ALIGNMENT"}, \ 18 + {6, "PROGRAM"}, \ 19 + {7, "FP_UNAVAIL"}, \ 20 + {8, "SYSCALL"}, \ 21 + {9, "AP_UNAVAIL"}, \ 22 + {10, "DECREMENTER"}, \ 23 + {11, "FIT"}, \ 24 + {12, "WATCHDOG"}, \ 25 + {13, "DTLB_MISS"}, \ 26 + {14, "ITLB_MISS"}, \ 27 + {15, "DEBUG"}, \ 28 + {32, "SPE_UNAVAIL"}, \ 29 + {33, "SPE_FP_DATA"}, \ 30 + {34, "SPE_FP_ROUND"}, \ 31 + {35, "PERFORMANCE_MONITOR"}, \ 32 + {36, "DOORBELL"}, \ 33 + {37, "DOORBELL_CRITICAL"}, \ 34 + {38, "GUEST_DBELL"}, \ 35 + {39, "GUEST_DBELL_CRIT"}, \ 36 + {40, "HV_SYSCALL"}, \ 37 + {41, "HV_PRIV"} 38 + 39 + TRACE_EVENT(kvm_exit, 40 + TP_PROTO(unsigned int exit_nr, struct kvm_vcpu *vcpu), 41 + TP_ARGS(exit_nr, vcpu), 42 + 43 + TP_STRUCT__entry( 44 + __field( unsigned int, exit_nr ) 45 + __field( unsigned long, pc ) 46 + __field( unsigned long, msr ) 47 + __field( unsigned long, dar ) 48 + __field( unsigned long, last_inst ) 49 + ), 50 + 51 + TP_fast_assign( 52 + __entry->exit_nr = exit_nr; 53 + __entry->pc = kvmppc_get_pc(vcpu); 54 + __entry->dar = kvmppc_get_fault_dar(vcpu); 55 + __entry->msr = vcpu->arch.shared->msr; 56 + __entry->last_inst = vcpu->arch.last_inst; 57 + ), 58 + 59 + TP_printk("exit=%s" 60 + " | pc=0x%lx" 61 + " | msr=0x%lx" 62 + " | dar=0x%lx" 63 + " | last_inst=0x%lx" 64 + , 65 + __print_symbolic(__entry->exit_nr, kvm_trace_symbol_exit), 66 + __entry->pc, 67 + __entry->msr, 68 + __entry->dar, 69 + __entry->last_inst 70 + ) 71 + ); 72 + 73 + TRACE_EVENT(kvm_unmap_hva, 74 + TP_PROTO(unsigned long hva), 75 + TP_ARGS(hva), 76 + 77 + TP_STRUCT__entry( 78 + __field( unsigned long, hva ) 79 + ), 80 + 81 + TP_fast_assign( 82 + __entry->hva = hva; 83 + ), 84 + 85 + TP_printk("unmap hva 0x%lx\n", __entry->hva) 86 + ); 87 + 88 + TRACE_EVENT(kvm_booke206_stlb_write, 89 + TP_PROTO(__u32 mas0, __u32 mas8, __u32 mas1, __u64 mas2, __u64 mas7_3), 90 + TP_ARGS(mas0, mas8, mas1, mas2, mas7_3), 91 + 92 + TP_STRUCT__entry( 93 + __field( __u32, mas0 ) 94 + __field( __u32, mas8 ) 95 + __field( __u32, mas1 ) 96 + __field( __u64, mas2 ) 97 + __field( __u64, mas7_3 ) 98 + ), 99 + 100 + TP_fast_assign( 101 + __entry->mas0 = mas0; 102 + __entry->mas8 = mas8; 103 + __entry->mas1 = mas1; 104 + __entry->mas2 = mas2; 105 + __entry->mas7_3 = mas7_3; 106 + ), 107 + 108 + TP_printk("mas0=%x mas8=%x mas1=%x mas2=%llx mas7_3=%llx", 109 + __entry->mas0, __entry->mas8, __entry->mas1, 110 + __entry->mas2, __entry->mas7_3) 111 + ); 112 + 113 + TRACE_EVENT(kvm_booke206_gtlb_write, 114 + TP_PROTO(__u32 mas0, __u32 mas1, __u64 mas2, __u64 mas7_3), 115 + TP_ARGS(mas0, mas1, mas2, mas7_3), 116 + 117 + TP_STRUCT__entry( 118 + __field( __u32, mas0 ) 119 + __field( __u32, mas1 ) 120 + __field( __u64, mas2 ) 121 + __field( __u64, mas7_3 ) 122 + ), 123 + 124 + TP_fast_assign( 125 + __entry->mas0 = mas0; 126 + __entry->mas1 = mas1; 127 + __entry->mas2 = mas2; 128 + __entry->mas7_3 = mas7_3; 129 + ), 130 + 131 + TP_printk("mas0=%x mas1=%x mas2=%llx mas7_3=%llx", 132 + __entry->mas0, __entry->mas1, 133 + __entry->mas2, __entry->mas7_3) 134 + ); 135 + 136 + TRACE_EVENT(kvm_booke206_ref_release, 137 + TP_PROTO(__u64 pfn, __u32 flags), 138 + TP_ARGS(pfn, flags), 139 + 140 + TP_STRUCT__entry( 141 + __field( __u64, pfn ) 142 + __field( __u32, flags ) 143 + ), 144 + 145 + TP_fast_assign( 146 + __entry->pfn = pfn; 147 + __entry->flags = flags; 148 + ), 149 + 150 + TP_printk("pfn=%llx flags=%x", 151 + __entry->pfn, __entry->flags) 152 + ); 153 + 154 + TRACE_EVENT(kvm_booke_queue_irqprio, 155 + TP_PROTO(struct kvm_vcpu *vcpu, unsigned int priority), 156 + TP_ARGS(vcpu, priority), 157 + 158 + TP_STRUCT__entry( 159 + __field( __u32, cpu_nr ) 160 + __field( __u32, priority ) 161 + __field( unsigned long, pending ) 162 + ), 163 + 164 + TP_fast_assign( 165 + __entry->cpu_nr = vcpu->vcpu_id; 166 + __entry->priority = priority; 167 + __entry->pending = vcpu->arch.pending_exceptions; 168 + ), 169 + 170 + TP_printk("vcpu=%x prio=%x pending=%lx", 171 + __entry->cpu_nr, __entry->priority, __entry->pending) 172 + ); 173 + 174 + #endif 175 + 176 + /* This part must be outside protection */ 177 + #include <trace/define_trace.h>