trace.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
  2. #define _TRACE_KVM_H
  3. #include <linux/tracepoint.h>
  4. #undef TRACE_SYSTEM
  5. #define TRACE_SYSTEM kvm
  6. #define TRACE_INCLUDE_PATH .
  7. #define TRACE_INCLUDE_FILE trace
  8. /*
  9. * Tracepoint for guest mode entry.
  10. */
  11. TRACE_EVENT(kvm_ppc_instr,
  12. TP_PROTO(unsigned int inst, unsigned long _pc, unsigned int emulate),
  13. TP_ARGS(inst, _pc, emulate),
  14. TP_STRUCT__entry(
  15. __field( unsigned int, inst )
  16. __field( unsigned long, pc )
  17. __field( unsigned int, emulate )
  18. ),
  19. TP_fast_assign(
  20. __entry->inst = inst;
  21. __entry->pc = _pc;
  22. __entry->emulate = emulate;
  23. ),
  24. TP_printk("inst %u pc 0x%lx emulate %u\n",
  25. __entry->inst, __entry->pc, __entry->emulate)
  26. );
  27. TRACE_EVENT(kvm_stlb_inval,
  28. TP_PROTO(unsigned int stlb_index),
  29. TP_ARGS(stlb_index),
  30. TP_STRUCT__entry(
  31. __field( unsigned int, stlb_index )
  32. ),
  33. TP_fast_assign(
  34. __entry->stlb_index = stlb_index;
  35. ),
  36. TP_printk("stlb_index %u", __entry->stlb_index)
  37. );
  38. TRACE_EVENT(kvm_stlb_write,
  39. TP_PROTO(unsigned int victim, unsigned int tid, unsigned int word0,
  40. unsigned int word1, unsigned int word2),
  41. TP_ARGS(victim, tid, word0, word1, word2),
  42. TP_STRUCT__entry(
  43. __field( unsigned int, victim )
  44. __field( unsigned int, tid )
  45. __field( unsigned int, word0 )
  46. __field( unsigned int, word1 )
  47. __field( unsigned int, word2 )
  48. ),
  49. TP_fast_assign(
  50. __entry->victim = victim;
  51. __entry->tid = tid;
  52. __entry->word0 = word0;
  53. __entry->word1 = word1;
  54. __entry->word2 = word2;
  55. ),
  56. TP_printk("victim %u tid %u w0 %u w1 %u w2 %u",
  57. __entry->victim, __entry->tid, __entry->word0,
  58. __entry->word1, __entry->word2)
  59. );
  60. TRACE_EVENT(kvm_gtlb_write,
  61. TP_PROTO(unsigned int gtlb_index, unsigned int tid, unsigned int word0,
  62. unsigned int word1, unsigned int word2),
  63. TP_ARGS(gtlb_index, tid, word0, word1, word2),
  64. TP_STRUCT__entry(
  65. __field( unsigned int, gtlb_index )
  66. __field( unsigned int, tid )
  67. __field( unsigned int, word0 )
  68. __field( unsigned int, word1 )
  69. __field( unsigned int, word2 )
  70. ),
  71. TP_fast_assign(
  72. __entry->gtlb_index = gtlb_index;
  73. __entry->tid = tid;
  74. __entry->word0 = word0;
  75. __entry->word1 = word1;
  76. __entry->word2 = word2;
  77. ),
  78. TP_printk("gtlb_index %u tid %u w0 %u w1 %u w2 %u",
  79. __entry->gtlb_index, __entry->tid, __entry->word0,
  80. __entry->word1, __entry->word2)
  81. );
  82. TRACE_EVENT(kvm_check_requests,
  83. TP_PROTO(struct kvm_vcpu *vcpu),
  84. TP_ARGS(vcpu),
  85. TP_STRUCT__entry(
  86. __field( __u32, cpu_nr )
  87. __field( __u32, requests )
  88. ),
  89. TP_fast_assign(
  90. __entry->cpu_nr = vcpu->vcpu_id;
  91. __entry->requests = vcpu->requests;
  92. ),
  93. TP_printk("vcpu=%x requests=%x",
  94. __entry->cpu_nr, __entry->requests)
  95. );
  96. #endif /* _TRACE_KVM_H */
  97. /* This part must be outside protection */
  98. #include <trace/define_trace.h>