trace-s390.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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 points for injection of interrupts, either per machine or
  57. * per vcpu.
  58. */
  59. #define kvm_s390_int_type \
  60. {KVM_S390_SIGP_STOP, "sigp stop"}, \
  61. {KVM_S390_PROGRAM_INT, "program interrupt"}, \
  62. {KVM_S390_SIGP_SET_PREFIX, "sigp set prefix"}, \
  63. {KVM_S390_RESTART, "sigp restart"}, \
  64. {KVM_S390_INT_VIRTIO, "virtio interrupt"}, \
  65. {KVM_S390_INT_SERVICE, "sclp interrupt"}, \
  66. {KVM_S390_INT_EMERGENCY, "sigp emergency"}, \
  67. {KVM_S390_INT_EXTERNAL_CALL, "sigp ext call"}
  68. TRACE_EVENT(kvm_s390_inject_vm,
  69. TP_PROTO(__u64 type, __u32 parm, __u64 parm64, int who),
  70. TP_ARGS(type, parm, parm64, who),
  71. TP_STRUCT__entry(
  72. __field(__u32, inttype)
  73. __field(__u32, parm)
  74. __field(__u64, parm64)
  75. __field(int, who)
  76. ),
  77. TP_fast_assign(
  78. __entry->inttype = type & 0x00000000ffffffff;
  79. __entry->parm = parm;
  80. __entry->parm64 = parm64;
  81. __entry->who = who;
  82. ),
  83. TP_printk("inject%s: type:%x (%s) parm:%x parm64:%llx",
  84. (__entry->who == 1) ? " (from kernel)" :
  85. (__entry->who == 2) ? " (from user)" : "",
  86. __entry->inttype,
  87. __print_symbolic(__entry->inttype, kvm_s390_int_type),
  88. __entry->parm, __entry->parm64)
  89. );
  90. TRACE_EVENT(kvm_s390_inject_vcpu,
  91. TP_PROTO(unsigned int id, __u64 type, __u32 parm, __u64 parm64, \
  92. int who),
  93. TP_ARGS(id, type, parm, parm64, who),
  94. TP_STRUCT__entry(
  95. __field(int, id)
  96. __field(__u32, inttype)
  97. __field(__u32, parm)
  98. __field(__u64, parm64)
  99. __field(int, who)
  100. ),
  101. TP_fast_assign(
  102. __entry->id = id;
  103. __entry->inttype = type & 0x00000000ffffffff;
  104. __entry->parm = parm;
  105. __entry->parm64 = parm64;
  106. __entry->who = who;
  107. ),
  108. TP_printk("inject%s (vcpu %d): type:%x (%s) parm:%x parm64:%llx",
  109. (__entry->who == 1) ? " (from kernel)" :
  110. (__entry->who == 2) ? " (from user)" : "",
  111. __entry->id, __entry->inttype,
  112. __print_symbolic(__entry->inttype, kvm_s390_int_type),
  113. __entry->parm, __entry->parm64)
  114. );
  115. /*
  116. * Trace point for the actual delivery of interrupts.
  117. */
  118. TRACE_EVENT(kvm_s390_deliver_interrupt,
  119. TP_PROTO(unsigned int id, __u64 type, __u64 data0, __u64 data1),
  120. TP_ARGS(id, type, data0, data1),
  121. TP_STRUCT__entry(
  122. __field(int, id)
  123. __field(__u32, inttype)
  124. __field(__u64, data0)
  125. __field(__u64, data1)
  126. ),
  127. TP_fast_assign(
  128. __entry->id = id;
  129. __entry->inttype = type & 0x00000000ffffffff;
  130. __entry->data0 = data0;
  131. __entry->data1 = data1;
  132. ),
  133. TP_printk("deliver interrupt (vcpu %d): type:%x (%s) " \
  134. "data:%08llx %016llx",
  135. __entry->id, __entry->inttype,
  136. __print_symbolic(__entry->inttype, kvm_s390_int_type),
  137. __entry->data0, __entry->data1)
  138. );
  139. /*
  140. * Trace point for resets that may be requested from userspace.
  141. */
  142. TRACE_EVENT(kvm_s390_request_resets,
  143. TP_PROTO(__u64 resets),
  144. TP_ARGS(resets),
  145. TP_STRUCT__entry(
  146. __field(__u64, resets)
  147. ),
  148. TP_fast_assign(
  149. __entry->resets = resets;
  150. ),
  151. TP_printk("requesting userspace resets %llx",
  152. __entry->resets)
  153. );
  154. /*
  155. * Trace point for a vcpu's stop requests.
  156. */
  157. TRACE_EVENT(kvm_s390_stop_request,
  158. TP_PROTO(unsigned int action_bits),
  159. TP_ARGS(action_bits),
  160. TP_STRUCT__entry(
  161. __field(unsigned int, action_bits)
  162. ),
  163. TP_fast_assign(
  164. __entry->action_bits = action_bits;
  165. ),
  166. TP_printk("stop request, action_bits = %08x",
  167. __entry->action_bits)
  168. );
  169. /*
  170. * Trace point for enabling channel I/O instruction support.
  171. */
  172. TRACE_EVENT(kvm_s390_enable_css,
  173. TP_PROTO(void *kvm),
  174. TP_ARGS(kvm),
  175. TP_STRUCT__entry(
  176. __field(void *, kvm)
  177. ),
  178. TP_fast_assign(
  179. __entry->kvm = kvm;
  180. ),
  181. TP_printk("enabling channel I/O support (kvm @ %p)\n",
  182. __entry->kvm)
  183. );
  184. #endif /* _TRACE_KVMS390_H */
  185. /* This part must be outside protection */
  186. #include <trace/define_trace.h>