trace_booke.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. #if !defined(_TRACE_KVM_BOOKE_H) || defined(TRACE_HEADER_MULTI_READ)
  2. #define _TRACE_KVM_BOOKE_H
  3. #include <linux/tracepoint.h>
  4. #undef TRACE_SYSTEM
  5. #define TRACE_SYSTEM kvm_booke
  6. #define kvm_trace_symbol_exit \
  7. {0, "CRITICAL"}, \
  8. {1, "MACHINE_CHECK"}, \
  9. {2, "DATA_STORAGE"}, \
  10. {3, "INST_STORAGE"}, \
  11. {4, "EXTERNAL"}, \
  12. {5, "ALIGNMENT"}, \
  13. {6, "PROGRAM"}, \
  14. {7, "FP_UNAVAIL"}, \
  15. {8, "SYSCALL"}, \
  16. {9, "AP_UNAVAIL"}, \
  17. {10, "DECREMENTER"}, \
  18. {11, "FIT"}, \
  19. {12, "WATCHDOG"}, \
  20. {13, "DTLB_MISS"}, \
  21. {14, "ITLB_MISS"}, \
  22. {15, "DEBUG"}, \
  23. {32, "SPE_UNAVAIL"}, \
  24. {33, "SPE_FP_DATA"}, \
  25. {34, "SPE_FP_ROUND"}, \
  26. {35, "PERFORMANCE_MONITOR"}, \
  27. {36, "DOORBELL"}, \
  28. {37, "DOORBELL_CRITICAL"}, \
  29. {38, "GUEST_DBELL"}, \
  30. {39, "GUEST_DBELL_CRIT"}, \
  31. {40, "HV_SYSCALL"}, \
  32. {41, "HV_PRIV"}
  33. TRACE_EVENT(kvm_exit,
  34. TP_PROTO(unsigned int exit_nr, struct kvm_vcpu *vcpu),
  35. TP_ARGS(exit_nr, vcpu),
  36. TP_STRUCT__entry(
  37. __field( unsigned int, exit_nr )
  38. __field( unsigned long, pc )
  39. __field( unsigned long, msr )
  40. __field( unsigned long, dar )
  41. __field( unsigned long, last_inst )
  42. ),
  43. TP_fast_assign(
  44. __entry->exit_nr = exit_nr;
  45. __entry->pc = kvmppc_get_pc(vcpu);
  46. __entry->dar = kvmppc_get_fault_dar(vcpu);
  47. __entry->msr = vcpu->arch.shared->msr;
  48. __entry->last_inst = vcpu->arch.last_inst;
  49. ),
  50. TP_printk("exit=%s"
  51. " | pc=0x%lx"
  52. " | msr=0x%lx"
  53. " | dar=0x%lx"
  54. " | last_inst=0x%lx"
  55. ,
  56. __print_symbolic(__entry->exit_nr, kvm_trace_symbol_exit),
  57. __entry->pc,
  58. __entry->msr,
  59. __entry->dar,
  60. __entry->last_inst
  61. )
  62. );
  63. TRACE_EVENT(kvm_unmap_hva,
  64. TP_PROTO(unsigned long hva),
  65. TP_ARGS(hva),
  66. TP_STRUCT__entry(
  67. __field( unsigned long, hva )
  68. ),
  69. TP_fast_assign(
  70. __entry->hva = hva;
  71. ),
  72. TP_printk("unmap hva 0x%lx\n", __entry->hva)
  73. );
  74. TRACE_EVENT(kvm_booke206_stlb_write,
  75. TP_PROTO(__u32 mas0, __u32 mas8, __u32 mas1, __u64 mas2, __u64 mas7_3),
  76. TP_ARGS(mas0, mas8, mas1, mas2, mas7_3),
  77. TP_STRUCT__entry(
  78. __field( __u32, mas0 )
  79. __field( __u32, mas8 )
  80. __field( __u32, mas1 )
  81. __field( __u64, mas2 )
  82. __field( __u64, mas7_3 )
  83. ),
  84. TP_fast_assign(
  85. __entry->mas0 = mas0;
  86. __entry->mas8 = mas8;
  87. __entry->mas1 = mas1;
  88. __entry->mas2 = mas2;
  89. __entry->mas7_3 = mas7_3;
  90. ),
  91. TP_printk("mas0=%x mas8=%x mas1=%x mas2=%llx mas7_3=%llx",
  92. __entry->mas0, __entry->mas8, __entry->mas1,
  93. __entry->mas2, __entry->mas7_3)
  94. );
  95. TRACE_EVENT(kvm_booke206_gtlb_write,
  96. TP_PROTO(__u32 mas0, __u32 mas1, __u64 mas2, __u64 mas7_3),
  97. TP_ARGS(mas0, mas1, mas2, mas7_3),
  98. TP_STRUCT__entry(
  99. __field( __u32, mas0 )
  100. __field( __u32, mas1 )
  101. __field( __u64, mas2 )
  102. __field( __u64, mas7_3 )
  103. ),
  104. TP_fast_assign(
  105. __entry->mas0 = mas0;
  106. __entry->mas1 = mas1;
  107. __entry->mas2 = mas2;
  108. __entry->mas7_3 = mas7_3;
  109. ),
  110. TP_printk("mas0=%x mas1=%x mas2=%llx mas7_3=%llx",
  111. __entry->mas0, __entry->mas1,
  112. __entry->mas2, __entry->mas7_3)
  113. );
  114. TRACE_EVENT(kvm_booke206_ref_release,
  115. TP_PROTO(__u64 pfn, __u32 flags),
  116. TP_ARGS(pfn, flags),
  117. TP_STRUCT__entry(
  118. __field( __u64, pfn )
  119. __field( __u32, flags )
  120. ),
  121. TP_fast_assign(
  122. __entry->pfn = pfn;
  123. __entry->flags = flags;
  124. ),
  125. TP_printk("pfn=%llx flags=%x",
  126. __entry->pfn, __entry->flags)
  127. );
  128. #ifdef CONFIG_SPE_POSSIBLE
  129. #define kvm_trace_symbol_irqprio_spe \
  130. {BOOKE_IRQPRIO_SPE_UNAVAIL, "SPE_UNAVAIL"}, \
  131. {BOOKE_IRQPRIO_SPE_FP_DATA, "SPE_FP_DATA"}, \
  132. {BOOKE_IRQPRIO_SPE_FP_ROUND, "SPE_FP_ROUND"},
  133. #else
  134. #define kvm_trace_symbol_irqprio_spe
  135. #endif
  136. #ifdef CONFIG_PPC_E500MC
  137. #define kvm_trace_symbol_irqprio_e500mc \
  138. {BOOKE_IRQPRIO_ALTIVEC_UNAVAIL, "ALTIVEC_UNAVAIL"}, \
  139. {BOOKE_IRQPRIO_ALTIVEC_ASSIST, "ALTIVEC_ASSIST"},
  140. #else
  141. #define kvm_trace_symbol_irqprio_e500mc
  142. #endif
  143. #define kvm_trace_symbol_irqprio \
  144. kvm_trace_symbol_irqprio_spe \
  145. kvm_trace_symbol_irqprio_e500mc \
  146. {BOOKE_IRQPRIO_DATA_STORAGE, "DATA_STORAGE"}, \
  147. {BOOKE_IRQPRIO_INST_STORAGE, "INST_STORAGE"}, \
  148. {BOOKE_IRQPRIO_ALIGNMENT, "ALIGNMENT"}, \
  149. {BOOKE_IRQPRIO_PROGRAM, "PROGRAM"}, \
  150. {BOOKE_IRQPRIO_FP_UNAVAIL, "FP_UNAVAIL"}, \
  151. {BOOKE_IRQPRIO_SYSCALL, "SYSCALL"}, \
  152. {BOOKE_IRQPRIO_AP_UNAVAIL, "AP_UNAVAIL"}, \
  153. {BOOKE_IRQPRIO_DTLB_MISS, "DTLB_MISS"}, \
  154. {BOOKE_IRQPRIO_ITLB_MISS, "ITLB_MISS"}, \
  155. {BOOKE_IRQPRIO_MACHINE_CHECK, "MACHINE_CHECK"}, \
  156. {BOOKE_IRQPRIO_DEBUG, "DEBUG"}, \
  157. {BOOKE_IRQPRIO_CRITICAL, "CRITICAL"}, \
  158. {BOOKE_IRQPRIO_WATCHDOG, "WATCHDOG"}, \
  159. {BOOKE_IRQPRIO_EXTERNAL, "EXTERNAL"}, \
  160. {BOOKE_IRQPRIO_FIT, "FIT"}, \
  161. {BOOKE_IRQPRIO_DECREMENTER, "DECREMENTER"}, \
  162. {BOOKE_IRQPRIO_PERFORMANCE_MONITOR, "PERFORMANCE_MONITOR"}, \
  163. {BOOKE_IRQPRIO_EXTERNAL_LEVEL, "EXTERNAL_LEVEL"}, \
  164. {BOOKE_IRQPRIO_DBELL, "DBELL"}, \
  165. {BOOKE_IRQPRIO_DBELL_CRIT, "DBELL_CRIT"} \
  166. TRACE_EVENT(kvm_booke_queue_irqprio,
  167. TP_PROTO(struct kvm_vcpu *vcpu, unsigned int priority),
  168. TP_ARGS(vcpu, priority),
  169. TP_STRUCT__entry(
  170. __field( __u32, cpu_nr )
  171. __field( __u32, priority )
  172. __field( unsigned long, pending )
  173. ),
  174. TP_fast_assign(
  175. __entry->cpu_nr = vcpu->vcpu_id;
  176. __entry->priority = priority;
  177. __entry->pending = vcpu->arch.pending_exceptions;
  178. ),
  179. TP_printk("vcpu=%x prio=%s pending=%lx",
  180. __entry->cpu_nr,
  181. __print_symbolic(__entry->priority, kvm_trace_symbol_irqprio),
  182. __entry->pending)
  183. );
  184. #endif
  185. /* This part must be outside protection */
  186. #undef TRACE_INCLUDE_PATH
  187. #undef TRACE_INCLUDE_FILE
  188. #define TRACE_INCLUDE_PATH .
  189. #define TRACE_INCLUDE_FILE trace_booke
  190. #include <trace/define_trace.h>