trace.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #if !defined(_TRACE_ARM_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
  2. #define _TRACE_ARM_KVM_H
  3. #include <linux/tracepoint.h>
  4. #undef TRACE_SYSTEM
  5. #define TRACE_SYSTEM kvm
  6. /* Architecturally implementation defined CP15 register access */
  7. TRACE_EVENT(kvm_emulate_cp15_imp,
  8. TP_PROTO(unsigned long Op1, unsigned long Rt1, unsigned long CRn,
  9. unsigned long CRm, unsigned long Op2, bool is_write),
  10. TP_ARGS(Op1, Rt1, CRn, CRm, Op2, is_write),
  11. TP_STRUCT__entry(
  12. __field( unsigned int, Op1 )
  13. __field( unsigned int, Rt1 )
  14. __field( unsigned int, CRn )
  15. __field( unsigned int, CRm )
  16. __field( unsigned int, Op2 )
  17. __field( bool, is_write )
  18. ),
  19. TP_fast_assign(
  20. __entry->is_write = is_write;
  21. __entry->Op1 = Op1;
  22. __entry->Rt1 = Rt1;
  23. __entry->CRn = CRn;
  24. __entry->CRm = CRm;
  25. __entry->Op2 = Op2;
  26. ),
  27. TP_printk("Implementation defined CP15: %s\tp15, %u, r%u, c%u, c%u, %u",
  28. (__entry->is_write) ? "mcr" : "mrc",
  29. __entry->Op1, __entry->Rt1, __entry->CRn,
  30. __entry->CRm, __entry->Op2)
  31. );
  32. TRACE_EVENT(kvm_wfx,
  33. TP_PROTO(unsigned long vcpu_pc, bool is_wfe),
  34. TP_ARGS(vcpu_pc, is_wfe),
  35. TP_STRUCT__entry(
  36. __field( unsigned long, vcpu_pc )
  37. __field( bool, is_wfe )
  38. ),
  39. TP_fast_assign(
  40. __entry->vcpu_pc = vcpu_pc;
  41. __entry->is_wfe = is_wfe;
  42. ),
  43. TP_printk("guest executed wf%c at: 0x%08lx",
  44. __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc)
  45. );
  46. TRACE_EVENT(kvm_hvc,
  47. TP_PROTO(unsigned long vcpu_pc, unsigned long r0, unsigned long imm),
  48. TP_ARGS(vcpu_pc, r0, imm),
  49. TP_STRUCT__entry(
  50. __field( unsigned long, vcpu_pc )
  51. __field( unsigned long, r0 )
  52. __field( unsigned long, imm )
  53. ),
  54. TP_fast_assign(
  55. __entry->vcpu_pc = vcpu_pc;
  56. __entry->r0 = r0;
  57. __entry->imm = imm;
  58. ),
  59. TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx",
  60. __entry->vcpu_pc, __entry->r0, __entry->imm)
  61. );
  62. #endif /* _TRACE_ARM_KVM_H */
  63. #undef TRACE_INCLUDE_PATH
  64. #define TRACE_INCLUDE_PATH .
  65. #undef TRACE_INCLUDE_FILE
  66. #define TRACE_INCLUDE_FILE trace
  67. /* This part must be outside protection */
  68. #include <trace/define_trace.h>