diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2013-10-07 12:47:57 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-10-17 09:36:22 -0400 |
commit | 72c1253574a1854b0b6f196e24cd0dd08c1ad9b9 (patch) | |
tree | 3564efc426ce20608781d14a056484c4b18b0386 /arch/powerpc/kvm/trace.h | |
parent | 699cc87641c123128bf3a4e12c0a8d739b1ac2f3 (diff) |
kvm: powerpc: book3s: pr: move PR related tracepoints to a separate header
This patch moves PR related tracepoints to a separate header. This
enables in converting PR to a kernel module which will be done in
later patches
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/trace.h')
-rw-r--r-- | arch/powerpc/kvm/trace.h | 234 |
1 files changed, 7 insertions, 227 deletions
diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h index 9e8368edf371..80f252af6cb8 100644 --- a/arch/powerpc/kvm/trace.h +++ b/arch/powerpc/kvm/trace.h | |||
@@ -85,6 +85,12 @@ TRACE_EVENT(kvm_ppc_instr, | |||
85 | {41, "HV_PRIV"} | 85 | {41, "HV_PRIV"} |
86 | #endif | 86 | #endif |
87 | 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 | |||
88 | TRACE_EVENT(kvm_exit, | 94 | TRACE_EVENT(kvm_exit, |
89 | TP_PROTO(unsigned int exit_nr, struct kvm_vcpu *vcpu), | 95 | TP_PROTO(unsigned int exit_nr, struct kvm_vcpu *vcpu), |
90 | TP_ARGS(exit_nr, vcpu), | 96 | TP_ARGS(exit_nr, vcpu), |
@@ -94,9 +100,6 @@ TRACE_EVENT(kvm_exit, | |||
94 | __field( unsigned long, pc ) | 100 | __field( unsigned long, pc ) |
95 | __field( unsigned long, msr ) | 101 | __field( unsigned long, msr ) |
96 | __field( unsigned long, dar ) | 102 | __field( unsigned long, dar ) |
97 | #ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE | ||
98 | __field( unsigned long, srr1 ) | ||
99 | #endif | ||
100 | __field( unsigned long, last_inst ) | 103 | __field( unsigned long, last_inst ) |
101 | ), | 104 | ), |
102 | 105 | ||
@@ -105,9 +108,6 @@ TRACE_EVENT(kvm_exit, | |||
105 | __entry->pc = kvmppc_get_pc(vcpu); | 108 | __entry->pc = kvmppc_get_pc(vcpu); |
106 | __entry->dar = kvmppc_get_fault_dar(vcpu); | 109 | __entry->dar = kvmppc_get_fault_dar(vcpu); |
107 | __entry->msr = vcpu->arch.shared->msr; | 110 | __entry->msr = vcpu->arch.shared->msr; |
108 | #ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE | ||
109 | __entry->srr1 = vcpu->arch.shadow_srr1; | ||
110 | #endif | ||
111 | __entry->last_inst = vcpu->arch.last_inst; | 111 | __entry->last_inst = vcpu->arch.last_inst; |
112 | ), | 112 | ), |
113 | 113 | ||
@@ -115,18 +115,12 @@ TRACE_EVENT(kvm_exit, | |||
115 | " | pc=0x%lx" | 115 | " | pc=0x%lx" |
116 | " | msr=0x%lx" | 116 | " | msr=0x%lx" |
117 | " | dar=0x%lx" | 117 | " | dar=0x%lx" |
118 | #ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE | ||
119 | " | srr1=0x%lx" | ||
120 | #endif | ||
121 | " | last_inst=0x%lx" | 118 | " | last_inst=0x%lx" |
122 | , | 119 | , |
123 | __print_symbolic(__entry->exit_nr, kvm_trace_symbol_exit), | 120 | __print_symbolic(__entry->exit_nr, kvm_trace_symbol_exit), |
124 | __entry->pc, | 121 | __entry->pc, |
125 | __entry->msr, | 122 | __entry->msr, |
126 | __entry->dar, | 123 | __entry->dar, |
127 | #ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE | ||
128 | __entry->srr1, | ||
129 | #endif | ||
130 | __entry->last_inst | 124 | __entry->last_inst |
131 | ) | 125 | ) |
132 | ); | 126 | ); |
@@ -145,6 +139,7 @@ TRACE_EVENT(kvm_unmap_hva, | |||
145 | 139 | ||
146 | TP_printk("unmap hva 0x%lx\n", __entry->hva) | 140 | TP_printk("unmap hva 0x%lx\n", __entry->hva) |
147 | ); | 141 | ); |
142 | #endif | ||
148 | 143 | ||
149 | TRACE_EVENT(kvm_stlb_inval, | 144 | TRACE_EVENT(kvm_stlb_inval, |
150 | TP_PROTO(unsigned int stlb_index), | 145 | TP_PROTO(unsigned int stlb_index), |
@@ -231,221 +226,6 @@ TRACE_EVENT(kvm_check_requests, | |||
231 | __entry->cpu_nr, __entry->requests) | 226 | __entry->cpu_nr, __entry->requests) |
232 | ); | 227 | ); |
233 | 228 | ||
234 | |||
235 | /************************************************************************* | ||
236 | * Book3S trace points * | ||
237 | *************************************************************************/ | ||
238 | |||
239 | #ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE | ||
240 | |||
241 | TRACE_EVENT(kvm_book3s_reenter, | ||
242 | TP_PROTO(int r, struct kvm_vcpu *vcpu), | ||
243 | TP_ARGS(r, vcpu), | ||
244 | |||
245 | TP_STRUCT__entry( | ||
246 | __field( unsigned int, r ) | ||
247 | __field( unsigned long, pc ) | ||
248 | ), | ||
249 | |||
250 | TP_fast_assign( | ||
251 | __entry->r = r; | ||
252 | __entry->pc = kvmppc_get_pc(vcpu); | ||
253 | ), | ||
254 | |||
255 | TP_printk("reentry r=%d | pc=0x%lx", __entry->r, __entry->pc) | ||
256 | ); | ||
257 | |||
258 | #ifdef CONFIG_PPC_BOOK3S_64 | ||
259 | |||
260 | TRACE_EVENT(kvm_book3s_64_mmu_map, | ||
261 | TP_PROTO(int rflags, ulong hpteg, ulong va, pfn_t hpaddr, | ||
262 | struct kvmppc_pte *orig_pte), | ||
263 | TP_ARGS(rflags, hpteg, va, hpaddr, orig_pte), | ||
264 | |||
265 | TP_STRUCT__entry( | ||
266 | __field( unsigned char, flag_w ) | ||
267 | __field( unsigned char, flag_x ) | ||
268 | __field( unsigned long, eaddr ) | ||
269 | __field( unsigned long, hpteg ) | ||
270 | __field( unsigned long, va ) | ||
271 | __field( unsigned long long, vpage ) | ||
272 | __field( unsigned long, hpaddr ) | ||
273 | ), | ||
274 | |||
275 | TP_fast_assign( | ||
276 | __entry->flag_w = ((rflags & HPTE_R_PP) == 3) ? '-' : 'w'; | ||
277 | __entry->flag_x = (rflags & HPTE_R_N) ? '-' : 'x'; | ||
278 | __entry->eaddr = orig_pte->eaddr; | ||
279 | __entry->hpteg = hpteg; | ||
280 | __entry->va = va; | ||
281 | __entry->vpage = orig_pte->vpage; | ||
282 | __entry->hpaddr = hpaddr; | ||
283 | ), | ||
284 | |||
285 | TP_printk("KVM: %c%c Map 0x%lx: [%lx] 0x%lx (0x%llx) -> %lx", | ||
286 | __entry->flag_w, __entry->flag_x, __entry->eaddr, | ||
287 | __entry->hpteg, __entry->va, __entry->vpage, __entry->hpaddr) | ||
288 | ); | ||
289 | |||
290 | #endif /* CONFIG_PPC_BOOK3S_64 */ | ||
291 | |||
292 | TRACE_EVENT(kvm_book3s_mmu_map, | ||
293 | TP_PROTO(struct hpte_cache *pte), | ||
294 | TP_ARGS(pte), | ||
295 | |||
296 | TP_STRUCT__entry( | ||
297 | __field( u64, host_vpn ) | ||
298 | __field( u64, pfn ) | ||
299 | __field( ulong, eaddr ) | ||
300 | __field( u64, vpage ) | ||
301 | __field( ulong, raddr ) | ||
302 | __field( int, flags ) | ||
303 | ), | ||
304 | |||
305 | TP_fast_assign( | ||
306 | __entry->host_vpn = pte->host_vpn; | ||
307 | __entry->pfn = pte->pfn; | ||
308 | __entry->eaddr = pte->pte.eaddr; | ||
309 | __entry->vpage = pte->pte.vpage; | ||
310 | __entry->raddr = pte->pte.raddr; | ||
311 | __entry->flags = (pte->pte.may_read ? 0x4 : 0) | | ||
312 | (pte->pte.may_write ? 0x2 : 0) | | ||
313 | (pte->pte.may_execute ? 0x1 : 0); | ||
314 | ), | ||
315 | |||
316 | TP_printk("Map: hvpn=%llx pfn=%llx ea=%lx vp=%llx ra=%lx [%x]", | ||
317 | __entry->host_vpn, __entry->pfn, __entry->eaddr, | ||
318 | __entry->vpage, __entry->raddr, __entry->flags) | ||
319 | ); | ||
320 | |||
321 | TRACE_EVENT(kvm_book3s_mmu_invalidate, | ||
322 | TP_PROTO(struct hpte_cache *pte), | ||
323 | TP_ARGS(pte), | ||
324 | |||
325 | TP_STRUCT__entry( | ||
326 | __field( u64, host_vpn ) | ||
327 | __field( u64, pfn ) | ||
328 | __field( ulong, eaddr ) | ||
329 | __field( u64, vpage ) | ||
330 | __field( ulong, raddr ) | ||
331 | __field( int, flags ) | ||
332 | ), | ||
333 | |||
334 | TP_fast_assign( | ||
335 | __entry->host_vpn = pte->host_vpn; | ||
336 | __entry->pfn = pte->pfn; | ||
337 | __entry->eaddr = pte->pte.eaddr; | ||
338 | __entry->vpage = pte->pte.vpage; | ||
339 | __entry->raddr = pte->pte.raddr; | ||
340 | __entry->flags = (pte->pte.may_read ? 0x4 : 0) | | ||
341 | (pte->pte.may_write ? 0x2 : 0) | | ||
342 | (pte->pte.may_execute ? 0x1 : 0); | ||
343 | ), | ||
344 | |||
345 | TP_printk("Flush: hva=%llx pfn=%llx ea=%lx vp=%llx ra=%lx [%x]", | ||
346 | __entry->host_vpn, __entry->pfn, __entry->eaddr, | ||
347 | __entry->vpage, __entry->raddr, __entry->flags) | ||
348 | ); | ||
349 | |||
350 | TRACE_EVENT(kvm_book3s_mmu_flush, | ||
351 | TP_PROTO(const char *type, struct kvm_vcpu *vcpu, unsigned long long p1, | ||
352 | unsigned long long p2), | ||
353 | TP_ARGS(type, vcpu, p1, p2), | ||
354 | |||
355 | TP_STRUCT__entry( | ||
356 | __field( int, count ) | ||
357 | __field( unsigned long long, p1 ) | ||
358 | __field( unsigned long long, p2 ) | ||
359 | __field( const char *, type ) | ||
360 | ), | ||
361 | |||
362 | TP_fast_assign( | ||
363 | __entry->count = to_book3s(vcpu)->hpte_cache_count; | ||
364 | __entry->p1 = p1; | ||
365 | __entry->p2 = p2; | ||
366 | __entry->type = type; | ||
367 | ), | ||
368 | |||
369 | TP_printk("Flush %d %sPTEs: %llx - %llx", | ||
370 | __entry->count, __entry->type, __entry->p1, __entry->p2) | ||
371 | ); | ||
372 | |||
373 | TRACE_EVENT(kvm_book3s_slb_found, | ||
374 | TP_PROTO(unsigned long long gvsid, unsigned long long hvsid), | ||
375 | TP_ARGS(gvsid, hvsid), | ||
376 | |||
377 | TP_STRUCT__entry( | ||
378 | __field( unsigned long long, gvsid ) | ||
379 | __field( unsigned long long, hvsid ) | ||
380 | ), | ||
381 | |||
382 | TP_fast_assign( | ||
383 | __entry->gvsid = gvsid; | ||
384 | __entry->hvsid = hvsid; | ||
385 | ), | ||
386 | |||
387 | TP_printk("%llx -> %llx", __entry->gvsid, __entry->hvsid) | ||
388 | ); | ||
389 | |||
390 | TRACE_EVENT(kvm_book3s_slb_fail, | ||
391 | TP_PROTO(u16 sid_map_mask, unsigned long long gvsid), | ||
392 | TP_ARGS(sid_map_mask, gvsid), | ||
393 | |||
394 | TP_STRUCT__entry( | ||
395 | __field( unsigned short, sid_map_mask ) | ||
396 | __field( unsigned long long, gvsid ) | ||
397 | ), | ||
398 | |||
399 | TP_fast_assign( | ||
400 | __entry->sid_map_mask = sid_map_mask; | ||
401 | __entry->gvsid = gvsid; | ||
402 | ), | ||
403 | |||
404 | TP_printk("%x/%x: %llx", __entry->sid_map_mask, | ||
405 | SID_MAP_MASK - __entry->sid_map_mask, __entry->gvsid) | ||
406 | ); | ||
407 | |||
408 | TRACE_EVENT(kvm_book3s_slb_map, | ||
409 | TP_PROTO(u16 sid_map_mask, unsigned long long gvsid, | ||
410 | unsigned long long hvsid), | ||
411 | TP_ARGS(sid_map_mask, gvsid, hvsid), | ||
412 | |||
413 | TP_STRUCT__entry( | ||
414 | __field( unsigned short, sid_map_mask ) | ||
415 | __field( unsigned long long, guest_vsid ) | ||
416 | __field( unsigned long long, host_vsid ) | ||
417 | ), | ||
418 | |||
419 | TP_fast_assign( | ||
420 | __entry->sid_map_mask = sid_map_mask; | ||
421 | __entry->guest_vsid = gvsid; | ||
422 | __entry->host_vsid = hvsid; | ||
423 | ), | ||
424 | |||
425 | TP_printk("%x: %llx -> %llx", __entry->sid_map_mask, | ||
426 | __entry->guest_vsid, __entry->host_vsid) | ||
427 | ); | ||
428 | |||
429 | TRACE_EVENT(kvm_book3s_slbmte, | ||
430 | TP_PROTO(u64 slb_vsid, u64 slb_esid), | ||
431 | TP_ARGS(slb_vsid, slb_esid), | ||
432 | |||
433 | TP_STRUCT__entry( | ||
434 | __field( u64, slb_vsid ) | ||
435 | __field( u64, slb_esid ) | ||
436 | ), | ||
437 | |||
438 | TP_fast_assign( | ||
439 | __entry->slb_vsid = slb_vsid; | ||
440 | __entry->slb_esid = slb_esid; | ||
441 | ), | ||
442 | |||
443 | TP_printk("%llx, %llx", __entry->slb_vsid, __entry->slb_esid) | ||
444 | ); | ||
445 | |||
446 | #endif /* CONFIG_PPC_BOOK3S */ | ||
447 | |||
448 | |||
449 | /************************************************************************* | 229 | /************************************************************************* |
450 | * Book3E trace points * | 230 | * Book3E trace points * |
451 | *************************************************************************/ | 231 | *************************************************************************/ |