cpuhp.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM cpuhp
  3. #if !defined(_TRACE_CPUHP_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_CPUHP_H
  5. #include <linux/tracepoint.h>
  6. TRACE_EVENT(cpuhp_enter,
  7. TP_PROTO(unsigned int cpu,
  8. int target,
  9. int idx,
  10. int (*fun)(unsigned int)),
  11. TP_ARGS(cpu, target, idx, fun),
  12. TP_STRUCT__entry(
  13. __field( unsigned int, cpu )
  14. __field( int, target )
  15. __field( int, idx )
  16. __field( void *, fun )
  17. ),
  18. TP_fast_assign(
  19. __entry->cpu = cpu;
  20. __entry->target = target;
  21. __entry->idx = idx;
  22. __entry->fun = fun;
  23. ),
  24. TP_printk("cpu: %04u target: %3d step: %3d (%pf)",
  25. __entry->cpu, __entry->target, __entry->idx, __entry->fun)
  26. );
  27. TRACE_EVENT(cpuhp_multi_enter,
  28. TP_PROTO(unsigned int cpu,
  29. int target,
  30. int idx,
  31. int (*fun)(unsigned int, struct hlist_node *),
  32. struct hlist_node *node),
  33. TP_ARGS(cpu, target, idx, fun, node),
  34. TP_STRUCT__entry(
  35. __field( unsigned int, cpu )
  36. __field( int, target )
  37. __field( int, idx )
  38. __field( void *, fun )
  39. ),
  40. TP_fast_assign(
  41. __entry->cpu = cpu;
  42. __entry->target = target;
  43. __entry->idx = idx;
  44. __entry->fun = fun;
  45. ),
  46. TP_printk("cpu: %04u target: %3d step: %3d (%pf)",
  47. __entry->cpu, __entry->target, __entry->idx, __entry->fun)
  48. );
  49. TRACE_EVENT(cpuhp_exit,
  50. TP_PROTO(unsigned int cpu,
  51. int state,
  52. int idx,
  53. int ret),
  54. TP_ARGS(cpu, state, idx, ret),
  55. TP_STRUCT__entry(
  56. __field( unsigned int, cpu )
  57. __field( int, state )
  58. __field( int, idx )
  59. __field( int, ret )
  60. ),
  61. TP_fast_assign(
  62. __entry->cpu = cpu;
  63. __entry->state = state;
  64. __entry->idx = idx;
  65. __entry->ret = ret;
  66. ),
  67. TP_printk(" cpu: %04u state: %3d step: %3d ret: %d",
  68. __entry->cpu, __entry->state, __entry->idx, __entry->ret)
  69. );
  70. TRACE_EVENT(cpuhp_latency,
  71. TP_PROTO(unsigned int cpu, unsigned int state,
  72. u64 start_time, int ret),
  73. TP_ARGS(cpu, state, start_time, ret),
  74. TP_STRUCT__entry(
  75. __field(unsigned int, cpu)
  76. __field(unsigned int, state)
  77. __field(u64, time)
  78. __field(int, ret)
  79. ),
  80. TP_fast_assign(
  81. __entry->cpu = cpu;
  82. __entry->state = state;
  83. __entry->time = div64_u64(sched_clock() - start_time, 1000);
  84. __entry->ret = ret;
  85. ),
  86. TP_printk(" cpu:%d state:%s latency:%llu USEC ret: %d",
  87. __entry->cpu, __entry->state ? "online" : "offline",
  88. __entry->time, __entry->ret)
  89. );
  90. #endif
  91. /* This part must be outside protection */
  92. #include <trace/define_trace.h>