trace-s390.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. #if !defined(_TRACE_KVMS390_H) || defined(TRACE_HEADER_MULTI_READ)
  2. #define _TRACE_KVMS390_H
  3. #include <linux/tracepoint.h>
  4. #undef TRACE_SYSTEM
  5. #define TRACE_SYSTEM kvm-s390
  6. #define TRACE_INCLUDE_PATH .
  7. #undef TRACE_INCLUDE_FILE
  8. #define TRACE_INCLUDE_FILE trace-s390
  9. /*
  10. * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
  11. * legitimate C variable. It is not exported to user space.
  12. */
  13. #undef TRACE_SYSTEM_VAR
  14. #define TRACE_SYSTEM_VAR kvm_s390
  15. /*
  16. * Trace point for the creation of the kvm instance.
  17. */
  18. TRACE_EVENT(kvm_s390_create_vm,
  19. TP_PROTO(unsigned long type),
  20. TP_ARGS(type),
  21. TP_STRUCT__entry(
  22. __field(unsigned long, type)
  23. ),
  24. TP_fast_assign(
  25. __entry->type = type;
  26. ),
  27. TP_printk("create vm%s",
  28. __entry->type & KVM_VM_S390_UCONTROL ? " (UCONTROL)" : "")
  29. );
  30. /*
  31. * Trace points for creation and destruction of vpcus.
  32. */
  33. TRACE_EVENT(kvm_s390_create_vcpu,
  34. TP_PROTO(unsigned int id, struct kvm_vcpu *vcpu,
  35. struct kvm_s390_sie_block *sie_block),
  36. TP_ARGS(id, vcpu, sie_block),
  37. TP_STRUCT__entry(
  38. __field(unsigned int, id)
  39. __field(struct kvm_vcpu *, vcpu)
  40. __field(struct kvm_s390_sie_block *, sie_block)
  41. ),
  42. TP_fast_assign(
  43. __entry->id = id;
  44. __entry->vcpu = vcpu;
  45. __entry->sie_block = sie_block;
  46. ),
  47. TP_printk("create cpu %d at %p, sie block at %p", __entry->id,
  48. __entry->vcpu, __entry->sie_block)
  49. );
  50. TRACE_EVENT(kvm_s390_destroy_vcpu,
  51. TP_PROTO(unsigned int id),
  52. TP_ARGS(id),
  53. TP_STRUCT__entry(
  54. __field(unsigned int, id)
  55. ),
  56. TP_fast_assign(
  57. __entry->id = id;
  58. ),
  59. TP_printk("destroy cpu %d", __entry->id)
  60. );
  61. /*
  62. * Trace point for start and stop of vpcus.
  63. */
  64. TRACE_EVENT(kvm_s390_vcpu_start_stop,
  65. TP_PROTO(unsigned int id, int state),
  66. TP_ARGS(id, state),
  67. TP_STRUCT__entry(
  68. __field(unsigned int, id)
  69. __field(int, state)
  70. ),
  71. TP_fast_assign(
  72. __entry->id = id;
  73. __entry->state = state;
  74. ),
  75. TP_printk("%s cpu %d", __entry->state ? "starting" : "stopping",
  76. __entry->id)
  77. );
  78. /*
  79. * Trace points for injection of interrupts, either per machine or
  80. * per vcpu.
  81. */
  82. #define kvm_s390_int_type \
  83. {KVM_S390_SIGP_STOP, "sigp stop"}, \
  84. {KVM_S390_PROGRAM_INT, "program interrupt"}, \
  85. {KVM_S390_SIGP_SET_PREFIX, "sigp set prefix"}, \
  86. {KVM_S390_RESTART, "sigp restart"}, \
  87. {KVM_S390_INT_PFAULT_INIT, "pfault init"}, \
  88. {KVM_S390_INT_PFAULT_DONE, "pfault done"}, \
  89. {KVM_S390_MCHK, "machine check"}, \
  90. {KVM_S390_INT_CLOCK_COMP, "clock comparator"}, \
  91. {KVM_S390_INT_CPU_TIMER, "cpu timer"}, \
  92. {KVM_S390_INT_VIRTIO, "virtio interrupt"}, \
  93. {KVM_S390_INT_SERVICE, "sclp interrupt"}, \
  94. {KVM_S390_INT_EMERGENCY, "sigp emergency"}, \
  95. {KVM_S390_INT_EXTERNAL_CALL, "sigp ext call"}
  96. #define get_irq_name(__type) \
  97. (__type > KVM_S390_INT_IO_MAX ? \
  98. __print_symbolic(__type, kvm_s390_int_type) : \
  99. (__type & KVM_S390_INT_IO_AI_MASK ? \
  100. "adapter I/O interrupt" : "subchannel I/O interrupt"))
  101. TRACE_EVENT(kvm_s390_inject_vm,
  102. TP_PROTO(__u64 type, __u32 parm, __u64 parm64, int who),
  103. TP_ARGS(type, parm, parm64, who),
  104. TP_STRUCT__entry(
  105. __field(__u32, inttype)
  106. __field(__u32, parm)
  107. __field(__u64, parm64)
  108. __field(int, who)
  109. ),
  110. TP_fast_assign(
  111. __entry->inttype = type & 0x00000000ffffffff;
  112. __entry->parm = parm;
  113. __entry->parm64 = parm64;
  114. __entry->who = who;
  115. ),
  116. TP_printk("inject%s: type:%x (%s) parm:%x parm64:%llx",
  117. (__entry->who == 1) ? " (from kernel)" :
  118. (__entry->who == 2) ? " (from user)" : "",
  119. __entry->inttype, get_irq_name(__entry->inttype),
  120. __entry->parm, __entry->parm64)
  121. );
  122. TRACE_EVENT(kvm_s390_inject_vcpu,
  123. TP_PROTO(unsigned int id, __u64 type, __u32 parm, __u64 parm64),
  124. TP_ARGS(id, type, parm, parm64),
  125. TP_STRUCT__entry(
  126. __field(int, id)
  127. __field(__u32, inttype)
  128. __field(__u32, parm)
  129. __field(__u64, parm64)
  130. ),
  131. TP_fast_assign(
  132. __entry->id = id;
  133. __entry->inttype = type & 0x00000000ffffffff;
  134. __entry->parm = parm;
  135. __entry->parm64 = parm64;
  136. ),
  137. TP_printk("inject (vcpu %d): type:%x (%s) parm:%x parm64:%llx",
  138. __entry->id, __entry->inttype,
  139. get_irq_name(__entry->inttype), __entry->parm,
  140. __entry->parm64)
  141. );
  142. /*
  143. * Trace point for the actual delivery of interrupts.
  144. */
  145. TRACE_EVENT(kvm_s390_deliver_interrupt,
  146. TP_PROTO(unsigned int id, __u64 type, __u64 data0, __u64 data1),
  147. TP_ARGS(id, type, data0, data1),
  148. TP_STRUCT__entry(
  149. __field(int, id)
  150. __field(__u32, inttype)
  151. __field(__u64, data0)
  152. __field(__u64, data1)
  153. ),
  154. TP_fast_assign(
  155. __entry->id = id;
  156. __entry->inttype = type & 0x00000000ffffffff;
  157. __entry->data0 = data0;
  158. __entry->data1 = data1;
  159. ),
  160. TP_printk("deliver interrupt (vcpu %d): type:%x (%s) " \
  161. "data:%08llx %016llx",
  162. __entry->id, __entry->inttype,
  163. get_irq_name(__entry->inttype), __entry->data0,
  164. __entry->data1)
  165. );
  166. /*
  167. * Trace point for resets that may be requested from userspace.
  168. */
  169. TRACE_EVENT(kvm_s390_request_resets,
  170. TP_PROTO(__u64 resets),
  171. TP_ARGS(resets),
  172. TP_STRUCT__entry(
  173. __field(__u64, resets)
  174. ),
  175. TP_fast_assign(
  176. __entry->resets = resets;
  177. ),
  178. TP_printk("requesting userspace resets %llx",
  179. __entry->resets)
  180. );
  181. /*
  182. * Trace point for a vcpu's stop requests.
  183. */
  184. TRACE_EVENT(kvm_s390_stop_request,
  185. TP_PROTO(unsigned char stop_irq, unsigned char flags),
  186. TP_ARGS(stop_irq, flags),
  187. TP_STRUCT__entry(
  188. __field(unsigned char, stop_irq)
  189. __field(unsigned char, flags)
  190. ),
  191. TP_fast_assign(
  192. __entry->stop_irq = stop_irq;
  193. __entry->flags = flags;
  194. ),
  195. TP_printk("stop request, stop irq = %u, flags = %08x",
  196. __entry->stop_irq, __entry->flags)
  197. );
  198. /*
  199. * Trace point for enabling channel I/O instruction support.
  200. */
  201. TRACE_EVENT(kvm_s390_enable_css,
  202. TP_PROTO(void *kvm),
  203. TP_ARGS(kvm),
  204. TP_STRUCT__entry(
  205. __field(void *, kvm)
  206. ),
  207. TP_fast_assign(
  208. __entry->kvm = kvm;
  209. ),
  210. TP_printk("enabling channel I/O support (kvm @ %p)\n",
  211. __entry->kvm)
  212. );
  213. /*
  214. * Trace point for enabling and disabling interlocking-and-broadcasting
  215. * suppression.
  216. */
  217. TRACE_EVENT(kvm_s390_enable_disable_ibs,
  218. TP_PROTO(unsigned int id, int state),
  219. TP_ARGS(id, state),
  220. TP_STRUCT__entry(
  221. __field(unsigned int, id)
  222. __field(int, state)
  223. ),
  224. TP_fast_assign(
  225. __entry->id = id;
  226. __entry->state = state;
  227. ),
  228. TP_printk("%s ibs on cpu %d",
  229. __entry->state ? "enabling" : "disabling", __entry->id)
  230. );
  231. #endif /* _TRACE_KVMS390_H */
  232. /* This part must be outside protection */
  233. #include <trace/define_trace.h>