trace_hv.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. #if !defined(_TRACE_KVM_HV_H) || defined(TRACE_HEADER_MULTI_READ)
  2. #define _TRACE_KVM_HV_H
  3. #include <linux/tracepoint.h>
  4. #include "trace_book3s.h"
  5. #include <asm/hvcall.h>
  6. #include <asm/kvm_asm.h>
  7. #undef TRACE_SYSTEM
  8. #define TRACE_SYSTEM kvm_hv
  9. #define kvm_trace_symbol_hcall \
  10. {H_REMOVE, "H_REMOVE"}, \
  11. {H_ENTER, "H_ENTER"}, \
  12. {H_READ, "H_READ"}, \
  13. {H_CLEAR_MOD, "H_CLEAR_MOD"}, \
  14. {H_CLEAR_REF, "H_CLEAR_REF"}, \
  15. {H_PROTECT, "H_PROTECT"}, \
  16. {H_GET_TCE, "H_GET_TCE"}, \
  17. {H_PUT_TCE, "H_PUT_TCE"}, \
  18. {H_SET_SPRG0, "H_SET_SPRG0"}, \
  19. {H_SET_DABR, "H_SET_DABR"}, \
  20. {H_PAGE_INIT, "H_PAGE_INIT"}, \
  21. {H_SET_ASR, "H_SET_ASR"}, \
  22. {H_ASR_ON, "H_ASR_ON"}, \
  23. {H_ASR_OFF, "H_ASR_OFF"}, \
  24. {H_LOGICAL_CI_LOAD, "H_LOGICAL_CI_LOAD"}, \
  25. {H_LOGICAL_CI_STORE, "H_LOGICAL_CI_STORE"}, \
  26. {H_LOGICAL_CACHE_LOAD, "H_LOGICAL_CACHE_LOAD"}, \
  27. {H_LOGICAL_CACHE_STORE, "H_LOGICAL_CACHE_STORE"}, \
  28. {H_LOGICAL_ICBI, "H_LOGICAL_ICBI"}, \
  29. {H_LOGICAL_DCBF, "H_LOGICAL_DCBF"}, \
  30. {H_GET_TERM_CHAR, "H_GET_TERM_CHAR"}, \
  31. {H_PUT_TERM_CHAR, "H_PUT_TERM_CHAR"}, \
  32. {H_REAL_TO_LOGICAL, "H_REAL_TO_LOGICAL"}, \
  33. {H_HYPERVISOR_DATA, "H_HYPERVISOR_DATA"}, \
  34. {H_EOI, "H_EOI"}, \
  35. {H_CPPR, "H_CPPR"}, \
  36. {H_IPI, "H_IPI"}, \
  37. {H_IPOLL, "H_IPOLL"}, \
  38. {H_XIRR, "H_XIRR"}, \
  39. {H_PERFMON, "H_PERFMON"}, \
  40. {H_MIGRATE_DMA, "H_MIGRATE_DMA"}, \
  41. {H_REGISTER_VPA, "H_REGISTER_VPA"}, \
  42. {H_CEDE, "H_CEDE"}, \
  43. {H_CONFER, "H_CONFER"}, \
  44. {H_PROD, "H_PROD"}, \
  45. {H_GET_PPP, "H_GET_PPP"}, \
  46. {H_SET_PPP, "H_SET_PPP"}, \
  47. {H_PURR, "H_PURR"}, \
  48. {H_PIC, "H_PIC"}, \
  49. {H_REG_CRQ, "H_REG_CRQ"}, \
  50. {H_FREE_CRQ, "H_FREE_CRQ"}, \
  51. {H_VIO_SIGNAL, "H_VIO_SIGNAL"}, \
  52. {H_SEND_CRQ, "H_SEND_CRQ"}, \
  53. {H_COPY_RDMA, "H_COPY_RDMA"}, \
  54. {H_REGISTER_LOGICAL_LAN, "H_REGISTER_LOGICAL_LAN"}, \
  55. {H_FREE_LOGICAL_LAN, "H_FREE_LOGICAL_LAN"}, \
  56. {H_ADD_LOGICAL_LAN_BUFFER, "H_ADD_LOGICAL_LAN_BUFFER"}, \
  57. {H_SEND_LOGICAL_LAN, "H_SEND_LOGICAL_LAN"}, \
  58. {H_BULK_REMOVE, "H_BULK_REMOVE"}, \
  59. {H_MULTICAST_CTRL, "H_MULTICAST_CTRL"}, \
  60. {H_SET_XDABR, "H_SET_XDABR"}, \
  61. {H_STUFF_TCE, "H_STUFF_TCE"}, \
  62. {H_PUT_TCE_INDIRECT, "H_PUT_TCE_INDIRECT"}, \
  63. {H_CHANGE_LOGICAL_LAN_MAC, "H_CHANGE_LOGICAL_LAN_MAC"}, \
  64. {H_VTERM_PARTNER_INFO, "H_VTERM_PARTNER_INFO"}, \
  65. {H_REGISTER_VTERM, "H_REGISTER_VTERM"}, \
  66. {H_FREE_VTERM, "H_FREE_VTERM"}, \
  67. {H_RESET_EVENTS, "H_RESET_EVENTS"}, \
  68. {H_ALLOC_RESOURCE, "H_ALLOC_RESOURCE"}, \
  69. {H_FREE_RESOURCE, "H_FREE_RESOURCE"}, \
  70. {H_MODIFY_QP, "H_MODIFY_QP"}, \
  71. {H_QUERY_QP, "H_QUERY_QP"}, \
  72. {H_REREGISTER_PMR, "H_REREGISTER_PMR"}, \
  73. {H_REGISTER_SMR, "H_REGISTER_SMR"}, \
  74. {H_QUERY_MR, "H_QUERY_MR"}, \
  75. {H_QUERY_MW, "H_QUERY_MW"}, \
  76. {H_QUERY_HCA, "H_QUERY_HCA"}, \
  77. {H_QUERY_PORT, "H_QUERY_PORT"}, \
  78. {H_MODIFY_PORT, "H_MODIFY_PORT"}, \
  79. {H_DEFINE_AQP1, "H_DEFINE_AQP1"}, \
  80. {H_GET_TRACE_BUFFER, "H_GET_TRACE_BUFFER"}, \
  81. {H_DEFINE_AQP0, "H_DEFINE_AQP0"}, \
  82. {H_RESIZE_MR, "H_RESIZE_MR"}, \
  83. {H_ATTACH_MCQP, "H_ATTACH_MCQP"}, \
  84. {H_DETACH_MCQP, "H_DETACH_MCQP"}, \
  85. {H_CREATE_RPT, "H_CREATE_RPT"}, \
  86. {H_REMOVE_RPT, "H_REMOVE_RPT"}, \
  87. {H_REGISTER_RPAGES, "H_REGISTER_RPAGES"}, \
  88. {H_DISABLE_AND_GETC, "H_DISABLE_AND_GETC"}, \
  89. {H_ERROR_DATA, "H_ERROR_DATA"}, \
  90. {H_GET_HCA_INFO, "H_GET_HCA_INFO"}, \
  91. {H_GET_PERF_COUNT, "H_GET_PERF_COUNT"}, \
  92. {H_MANAGE_TRACE, "H_MANAGE_TRACE"}, \
  93. {H_FREE_LOGICAL_LAN_BUFFER, "H_FREE_LOGICAL_LAN_BUFFER"}, \
  94. {H_QUERY_INT_STATE, "H_QUERY_INT_STATE"}, \
  95. {H_POLL_PENDING, "H_POLL_PENDING"}, \
  96. {H_ILLAN_ATTRIBUTES, "H_ILLAN_ATTRIBUTES"}, \
  97. {H_MODIFY_HEA_QP, "H_MODIFY_HEA_QP"}, \
  98. {H_QUERY_HEA_QP, "H_QUERY_HEA_QP"}, \
  99. {H_QUERY_HEA, "H_QUERY_HEA"}, \
  100. {H_QUERY_HEA_PORT, "H_QUERY_HEA_PORT"}, \
  101. {H_MODIFY_HEA_PORT, "H_MODIFY_HEA_PORT"}, \
  102. {H_REG_BCMC, "H_REG_BCMC"}, \
  103. {H_DEREG_BCMC, "H_DEREG_BCMC"}, \
  104. {H_REGISTER_HEA_RPAGES, "H_REGISTER_HEA_RPAGES"}, \
  105. {H_DISABLE_AND_GET_HEA, "H_DISABLE_AND_GET_HEA"}, \
  106. {H_GET_HEA_INFO, "H_GET_HEA_INFO"}, \
  107. {H_ALLOC_HEA_RESOURCE, "H_ALLOC_HEA_RESOURCE"}, \
  108. {H_ADD_CONN, "H_ADD_CONN"}, \
  109. {H_DEL_CONN, "H_DEL_CONN"}, \
  110. {H_JOIN, "H_JOIN"}, \
  111. {H_VASI_STATE, "H_VASI_STATE"}, \
  112. {H_ENABLE_CRQ, "H_ENABLE_CRQ"}, \
  113. {H_GET_EM_PARMS, "H_GET_EM_PARMS"}, \
  114. {H_SET_MPP, "H_SET_MPP"}, \
  115. {H_GET_MPP, "H_GET_MPP"}, \
  116. {H_HOME_NODE_ASSOCIATIVITY, "H_HOME_NODE_ASSOCIATIVITY"}, \
  117. {H_BEST_ENERGY, "H_BEST_ENERGY"}, \
  118. {H_XIRR_X, "H_XIRR_X"}, \
  119. {H_RANDOM, "H_RANDOM"}, \
  120. {H_COP, "H_COP"}, \
  121. {H_GET_MPP_X, "H_GET_MPP_X"}, \
  122. {H_SET_MODE, "H_SET_MODE"}, \
  123. {H_RTAS, "H_RTAS"}
  124. #define kvm_trace_symbol_kvmret \
  125. {RESUME_GUEST, "RESUME_GUEST"}, \
  126. {RESUME_GUEST_NV, "RESUME_GUEST_NV"}, \
  127. {RESUME_HOST, "RESUME_HOST"}, \
  128. {RESUME_HOST_NV, "RESUME_HOST_NV"}
  129. #define kvm_trace_symbol_hcall_rc \
  130. {H_SUCCESS, "H_SUCCESS"}, \
  131. {H_BUSY, "H_BUSY"}, \
  132. {H_CLOSED, "H_CLOSED"}, \
  133. {H_NOT_AVAILABLE, "H_NOT_AVAILABLE"}, \
  134. {H_CONSTRAINED, "H_CONSTRAINED"}, \
  135. {H_PARTIAL, "H_PARTIAL"}, \
  136. {H_IN_PROGRESS, "H_IN_PROGRESS"}, \
  137. {H_PAGE_REGISTERED, "H_PAGE_REGISTERED"}, \
  138. {H_PARTIAL_STORE, "H_PARTIAL_STORE"}, \
  139. {H_PENDING, "H_PENDING"}, \
  140. {H_CONTINUE, "H_CONTINUE"}, \
  141. {H_LONG_BUSY_START_RANGE, "H_LONG_BUSY_START_RANGE"}, \
  142. {H_LONG_BUSY_ORDER_1_MSEC, "H_LONG_BUSY_ORDER_1_MSEC"}, \
  143. {H_LONG_BUSY_ORDER_10_MSEC, "H_LONG_BUSY_ORDER_10_MSEC"}, \
  144. {H_LONG_BUSY_ORDER_100_MSEC, "H_LONG_BUSY_ORDER_100_MSEC"}, \
  145. {H_LONG_BUSY_ORDER_1_SEC, "H_LONG_BUSY_ORDER_1_SEC"}, \
  146. {H_LONG_BUSY_ORDER_10_SEC, "H_LONG_BUSY_ORDER_10_SEC"}, \
  147. {H_LONG_BUSY_ORDER_100_SEC, "H_LONG_BUSY_ORDER_100_SEC"}, \
  148. {H_LONG_BUSY_END_RANGE, "H_LONG_BUSY_END_RANGE"}, \
  149. {H_TOO_HARD, "H_TOO_HARD"}, \
  150. {H_HARDWARE, "H_HARDWARE"}, \
  151. {H_FUNCTION, "H_FUNCTION"}, \
  152. {H_PRIVILEGE, "H_PRIVILEGE"}, \
  153. {H_PARAMETER, "H_PARAMETER"}, \
  154. {H_BAD_MODE, "H_BAD_MODE"}, \
  155. {H_PTEG_FULL, "H_PTEG_FULL"}, \
  156. {H_NOT_FOUND, "H_NOT_FOUND"}, \
  157. {H_RESERVED_DABR, "H_RESERVED_DABR"}, \
  158. {H_NO_MEM, "H_NO_MEM"}, \
  159. {H_AUTHORITY, "H_AUTHORITY"}, \
  160. {H_PERMISSION, "H_PERMISSION"}, \
  161. {H_DROPPED, "H_DROPPED"}, \
  162. {H_SOURCE_PARM, "H_SOURCE_PARM"}, \
  163. {H_DEST_PARM, "H_DEST_PARM"}, \
  164. {H_REMOTE_PARM, "H_REMOTE_PARM"}, \
  165. {H_RESOURCE, "H_RESOURCE"}, \
  166. {H_ADAPTER_PARM, "H_ADAPTER_PARM"}, \
  167. {H_RH_PARM, "H_RH_PARM"}, \
  168. {H_RCQ_PARM, "H_RCQ_PARM"}, \
  169. {H_SCQ_PARM, "H_SCQ_PARM"}, \
  170. {H_EQ_PARM, "H_EQ_PARM"}, \
  171. {H_RT_PARM, "H_RT_PARM"}, \
  172. {H_ST_PARM, "H_ST_PARM"}, \
  173. {H_SIGT_PARM, "H_SIGT_PARM"}, \
  174. {H_TOKEN_PARM, "H_TOKEN_PARM"}, \
  175. {H_MLENGTH_PARM, "H_MLENGTH_PARM"}, \
  176. {H_MEM_PARM, "H_MEM_PARM"}, \
  177. {H_MEM_ACCESS_PARM, "H_MEM_ACCESS_PARM"}, \
  178. {H_ATTR_PARM, "H_ATTR_PARM"}, \
  179. {H_PORT_PARM, "H_PORT_PARM"}, \
  180. {H_MCG_PARM, "H_MCG_PARM"}, \
  181. {H_VL_PARM, "H_VL_PARM"}, \
  182. {H_TSIZE_PARM, "H_TSIZE_PARM"}, \
  183. {H_TRACE_PARM, "H_TRACE_PARM"}, \
  184. {H_MASK_PARM, "H_MASK_PARM"}, \
  185. {H_MCG_FULL, "H_MCG_FULL"}, \
  186. {H_ALIAS_EXIST, "H_ALIAS_EXIST"}, \
  187. {H_P_COUNTER, "H_P_COUNTER"}, \
  188. {H_TABLE_FULL, "H_TABLE_FULL"}, \
  189. {H_ALT_TABLE, "H_ALT_TABLE"}, \
  190. {H_MR_CONDITION, "H_MR_CONDITION"}, \
  191. {H_NOT_ENOUGH_RESOURCES, "H_NOT_ENOUGH_RESOURCES"}, \
  192. {H_R_STATE, "H_R_STATE"}, \
  193. {H_RESCINDED, "H_RESCINDED"}, \
  194. {H_P2, "H_P2"}, \
  195. {H_P3, "H_P3"}, \
  196. {H_P4, "H_P4"}, \
  197. {H_P5, "H_P5"}, \
  198. {H_P6, "H_P6"}, \
  199. {H_P7, "H_P7"}, \
  200. {H_P8, "H_P8"}, \
  201. {H_P9, "H_P9"}, \
  202. {H_TOO_BIG, "H_TOO_BIG"}, \
  203. {H_OVERLAP, "H_OVERLAP"}, \
  204. {H_INTERRUPT, "H_INTERRUPT"}, \
  205. {H_BAD_DATA, "H_BAD_DATA"}, \
  206. {H_NOT_ACTIVE, "H_NOT_ACTIVE"}, \
  207. {H_SG_LIST, "H_SG_LIST"}, \
  208. {H_OP_MODE, "H_OP_MODE"}, \
  209. {H_COP_HW, "H_COP_HW"}, \
  210. {H_UNSUPPORTED_FLAG_START, "H_UNSUPPORTED_FLAG_START"}, \
  211. {H_UNSUPPORTED_FLAG_END, "H_UNSUPPORTED_FLAG_END"}, \
  212. {H_MULTI_THREADS_ACTIVE, "H_MULTI_THREADS_ACTIVE"}, \
  213. {H_OUTSTANDING_COP_OPS, "H_OUTSTANDING_COP_OPS"}
  214. TRACE_EVENT(kvm_guest_enter,
  215. TP_PROTO(struct kvm_vcpu *vcpu),
  216. TP_ARGS(vcpu),
  217. TP_STRUCT__entry(
  218. __field(int, vcpu_id)
  219. __field(unsigned long, pc)
  220. __field(unsigned long, pending_exceptions)
  221. __field(u8, ceded)
  222. ),
  223. TP_fast_assign(
  224. __entry->vcpu_id = vcpu->vcpu_id;
  225. __entry->pc = kvmppc_get_pc(vcpu);
  226. __entry->ceded = vcpu->arch.ceded;
  227. __entry->pending_exceptions = vcpu->arch.pending_exceptions;
  228. ),
  229. TP_printk("VCPU %d: pc=0x%lx pexcp=0x%lx ceded=%d",
  230. __entry->vcpu_id,
  231. __entry->pc,
  232. __entry->pending_exceptions, __entry->ceded)
  233. );
  234. TRACE_EVENT(kvm_guest_exit,
  235. TP_PROTO(struct kvm_vcpu *vcpu),
  236. TP_ARGS(vcpu),
  237. TP_STRUCT__entry(
  238. __field(int, vcpu_id)
  239. __field(int, trap)
  240. __field(unsigned long, pc)
  241. __field(unsigned long, msr)
  242. __field(u8, ceded)
  243. ),
  244. TP_fast_assign(
  245. __entry->vcpu_id = vcpu->vcpu_id;
  246. __entry->trap = vcpu->arch.trap;
  247. __entry->ceded = vcpu->arch.ceded;
  248. __entry->pc = kvmppc_get_pc(vcpu);
  249. __entry->msr = vcpu->arch.shregs.msr;
  250. ),
  251. TP_printk("VCPU %d: trap=%s pc=0x%lx msr=0x%lx, ceded=%d",
  252. __entry->vcpu_id,
  253. __print_symbolic(__entry->trap, kvm_trace_symbol_exit),
  254. __entry->pc, __entry->msr, __entry->ceded
  255. )
  256. );
  257. TRACE_EVENT(kvm_page_fault_enter,
  258. TP_PROTO(struct kvm_vcpu *vcpu, unsigned long *hptep,
  259. struct kvm_memory_slot *memslot, unsigned long ea,
  260. unsigned long dsisr),
  261. TP_ARGS(vcpu, hptep, memslot, ea, dsisr),
  262. TP_STRUCT__entry(
  263. __field(int, vcpu_id)
  264. __field(unsigned long, hpte_v)
  265. __field(unsigned long, hpte_r)
  266. __field(unsigned long, gpte_r)
  267. __field(unsigned long, ea)
  268. __field(u64, base_gfn)
  269. __field(u32, slot_flags)
  270. __field(u32, dsisr)
  271. ),
  272. TP_fast_assign(
  273. __entry->vcpu_id = vcpu->vcpu_id;
  274. __entry->hpte_v = hptep[0];
  275. __entry->hpte_r = hptep[1];
  276. __entry->gpte_r = hptep[2];
  277. __entry->ea = ea;
  278. __entry->dsisr = dsisr;
  279. __entry->base_gfn = memslot ? memslot->base_gfn : -1UL;
  280. __entry->slot_flags = memslot ? memslot->flags : 0;
  281. ),
  282. TP_printk("VCPU %d: hpte=0x%lx:0x%lx guest=0x%lx ea=0x%lx,%x slot=0x%llx,0x%x",
  283. __entry->vcpu_id,
  284. __entry->hpte_v, __entry->hpte_r, __entry->gpte_r,
  285. __entry->ea, __entry->dsisr,
  286. __entry->base_gfn, __entry->slot_flags)
  287. );
  288. TRACE_EVENT(kvm_page_fault_exit,
  289. TP_PROTO(struct kvm_vcpu *vcpu, unsigned long *hptep, long ret),
  290. TP_ARGS(vcpu, hptep, ret),
  291. TP_STRUCT__entry(
  292. __field(int, vcpu_id)
  293. __field(unsigned long, hpte_v)
  294. __field(unsigned long, hpte_r)
  295. __field(long, ret)
  296. ),
  297. TP_fast_assign(
  298. __entry->vcpu_id = vcpu->vcpu_id;
  299. __entry->hpte_v = hptep[0];
  300. __entry->hpte_r = hptep[1];
  301. __entry->ret = ret;
  302. ),
  303. TP_printk("VCPU %d: hpte=0x%lx:0x%lx ret=0x%lx",
  304. __entry->vcpu_id,
  305. __entry->hpte_v, __entry->hpte_r, __entry->ret)
  306. );
  307. TRACE_EVENT(kvm_hcall_enter,
  308. TP_PROTO(struct kvm_vcpu *vcpu),
  309. TP_ARGS(vcpu),
  310. TP_STRUCT__entry(
  311. __field(int, vcpu_id)
  312. __field(unsigned long, req)
  313. __field(unsigned long, gpr4)
  314. __field(unsigned long, gpr5)
  315. __field(unsigned long, gpr6)
  316. __field(unsigned long, gpr7)
  317. ),
  318. TP_fast_assign(
  319. __entry->vcpu_id = vcpu->vcpu_id;
  320. __entry->req = kvmppc_get_gpr(vcpu, 3);
  321. __entry->gpr4 = kvmppc_get_gpr(vcpu, 4);
  322. __entry->gpr5 = kvmppc_get_gpr(vcpu, 5);
  323. __entry->gpr6 = kvmppc_get_gpr(vcpu, 6);
  324. __entry->gpr7 = kvmppc_get_gpr(vcpu, 7);
  325. ),
  326. TP_printk("VCPU %d: hcall=%s GPR4-7=0x%lx,0x%lx,0x%lx,0x%lx",
  327. __entry->vcpu_id,
  328. __print_symbolic(__entry->req, kvm_trace_symbol_hcall),
  329. __entry->gpr4, __entry->gpr5, __entry->gpr6, __entry->gpr7)
  330. );
  331. TRACE_EVENT(kvm_hcall_exit,
  332. TP_PROTO(struct kvm_vcpu *vcpu, int ret),
  333. TP_ARGS(vcpu, ret),
  334. TP_STRUCT__entry(
  335. __field(int, vcpu_id)
  336. __field(unsigned long, ret)
  337. __field(unsigned long, hcall_rc)
  338. ),
  339. TP_fast_assign(
  340. __entry->vcpu_id = vcpu->vcpu_id;
  341. __entry->ret = ret;
  342. __entry->hcall_rc = kvmppc_get_gpr(vcpu, 3);
  343. ),
  344. TP_printk("VCPU %d: ret=%s hcall_rc=%s",
  345. __entry->vcpu_id,
  346. __print_symbolic(__entry->ret, kvm_trace_symbol_kvmret),
  347. __print_symbolic(__entry->ret & RESUME_FLAG_HOST ?
  348. H_TOO_HARD : __entry->hcall_rc,
  349. kvm_trace_symbol_hcall_rc))
  350. );
  351. TRACE_EVENT(kvmppc_run_core,
  352. TP_PROTO(struct kvmppc_vcore *vc, int where),
  353. TP_ARGS(vc, where),
  354. TP_STRUCT__entry(
  355. __field(int, n_runnable)
  356. __field(int, runner_vcpu)
  357. __field(int, where)
  358. __field(pid_t, tgid)
  359. ),
  360. TP_fast_assign(
  361. __entry->runner_vcpu = vc->runner->vcpu_id;
  362. __entry->n_runnable = vc->n_runnable;
  363. __entry->where = where;
  364. __entry->tgid = current->tgid;
  365. ),
  366. TP_printk("%s runner_vcpu==%d runnable=%d tgid=%d",
  367. __entry->where ? "Exit" : "Enter",
  368. __entry->runner_vcpu, __entry->n_runnable, __entry->tgid)
  369. );
  370. TRACE_EVENT(kvmppc_vcore_blocked,
  371. TP_PROTO(struct kvmppc_vcore *vc, int where),
  372. TP_ARGS(vc, where),
  373. TP_STRUCT__entry(
  374. __field(int, n_runnable)
  375. __field(int, runner_vcpu)
  376. __field(int, where)
  377. __field(pid_t, tgid)
  378. ),
  379. TP_fast_assign(
  380. __entry->runner_vcpu = vc->runner->vcpu_id;
  381. __entry->n_runnable = vc->n_runnable;
  382. __entry->where = where;
  383. __entry->tgid = current->tgid;
  384. ),
  385. TP_printk("%s runner_vcpu=%d runnable=%d tgid=%d",
  386. __entry->where ? "Exit" : "Enter",
  387. __entry->runner_vcpu, __entry->n_runnable, __entry->tgid)
  388. );
  389. TRACE_EVENT(kvmppc_run_vcpu_enter,
  390. TP_PROTO(struct kvm_vcpu *vcpu),
  391. TP_ARGS(vcpu),
  392. TP_STRUCT__entry(
  393. __field(int, vcpu_id)
  394. __field(pid_t, tgid)
  395. ),
  396. TP_fast_assign(
  397. __entry->vcpu_id = vcpu->vcpu_id;
  398. __entry->tgid = current->tgid;
  399. ),
  400. TP_printk("VCPU %d: tgid=%d", __entry->vcpu_id, __entry->tgid)
  401. );
  402. TRACE_EVENT(kvmppc_run_vcpu_exit,
  403. TP_PROTO(struct kvm_vcpu *vcpu, struct kvm_run *run),
  404. TP_ARGS(vcpu, run),
  405. TP_STRUCT__entry(
  406. __field(int, vcpu_id)
  407. __field(int, exit)
  408. __field(int, ret)
  409. ),
  410. TP_fast_assign(
  411. __entry->vcpu_id = vcpu->vcpu_id;
  412. __entry->exit = run->exit_reason;
  413. __entry->ret = vcpu->arch.ret;
  414. ),
  415. TP_printk("VCPU %d: exit=%d, ret=%d",
  416. __entry->vcpu_id, __entry->exit, __entry->ret)
  417. );
  418. #endif /* _TRACE_KVM_HV_H */
  419. /* This part must be outside protection */
  420. #undef TRACE_INCLUDE_PATH
  421. #undef TRACE_INCLUDE_FILE
  422. #define TRACE_INCLUDE_PATH .
  423. #define TRACE_INCLUDE_FILE trace_hv
  424. #include <trace/define_trace.h>