trace_booke.h 5.2 KB

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