trace-s390.h 6.3 KB

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