cpufreq_interactive.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM cpufreq_interactive
  3. #if !defined(_TRACE_CPUFREQ_INTERACTIVE_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_CPUFREQ_INTERACTIVE_H
  5. #include <linux/tracepoint.h>
  6. DECLARE_EVENT_CLASS(set,
  7. TP_PROTO(u32 cpu_id, unsigned long targfreq,
  8. unsigned long actualfreq),
  9. TP_ARGS(cpu_id, targfreq, actualfreq),
  10. TP_STRUCT__entry(
  11. __field( u32, cpu_id )
  12. __field(unsigned long, targfreq )
  13. __field(unsigned long, actualfreq )
  14. ),
  15. TP_fast_assign(
  16. __entry->cpu_id = (u32) cpu_id;
  17. __entry->targfreq = targfreq;
  18. __entry->actualfreq = actualfreq;
  19. ),
  20. TP_printk("cpu=%u targ=%lu actual=%lu",
  21. __entry->cpu_id, __entry->targfreq,
  22. __entry->actualfreq)
  23. );
  24. DEFINE_EVENT(set, cpufreq_interactive_setspeed,
  25. TP_PROTO(u32 cpu_id, unsigned long targfreq,
  26. unsigned long actualfreq),
  27. TP_ARGS(cpu_id, targfreq, actualfreq)
  28. );
  29. DECLARE_EVENT_CLASS(loadeval,
  30. TP_PROTO(unsigned long cpu_id, unsigned long load,
  31. unsigned long curtarg, unsigned long curactual,
  32. unsigned long newtarg),
  33. TP_ARGS(cpu_id, load, curtarg, curactual, newtarg),
  34. TP_STRUCT__entry(
  35. __field(unsigned long, cpu_id )
  36. __field(unsigned long, load )
  37. __field(unsigned long, curtarg )
  38. __field(unsigned long, curactual )
  39. __field(unsigned long, newtarg )
  40. ),
  41. TP_fast_assign(
  42. __entry->cpu_id = cpu_id;
  43. __entry->load = load;
  44. __entry->curtarg = curtarg;
  45. __entry->curactual = curactual;
  46. __entry->newtarg = newtarg;
  47. ),
  48. TP_printk("cpu=%lu load=%lu cur=%lu actual=%lu targ=%lu",
  49. __entry->cpu_id, __entry->load, __entry->curtarg,
  50. __entry->curactual, __entry->newtarg)
  51. );
  52. DEFINE_EVENT(loadeval, cpufreq_interactive_target,
  53. TP_PROTO(unsigned long cpu_id, unsigned long load,
  54. unsigned long curtarg, unsigned long curactual,
  55. unsigned long newtarg),
  56. TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
  57. );
  58. DEFINE_EVENT(loadeval, cpufreq_interactive_already,
  59. TP_PROTO(unsigned long cpu_id, unsigned long load,
  60. unsigned long curtarg, unsigned long curactual,
  61. unsigned long newtarg),
  62. TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
  63. );
  64. DEFINE_EVENT(loadeval, cpufreq_interactive_notyet,
  65. TP_PROTO(unsigned long cpu_id, unsigned long load,
  66. unsigned long curtarg, unsigned long curactual,
  67. unsigned long newtarg),
  68. TP_ARGS(cpu_id, load, curtarg, curactual, newtarg)
  69. );
  70. TRACE_EVENT(cpufreq_interactive_boost,
  71. TP_PROTO(const char *s),
  72. TP_ARGS(s),
  73. TP_STRUCT__entry(
  74. __string(s, s)
  75. ),
  76. TP_fast_assign(
  77. __assign_str(s, s);
  78. ),
  79. TP_printk("%s", __get_str(s))
  80. );
  81. TRACE_EVENT(cpufreq_interactive_unboost,
  82. TP_PROTO(const char *s),
  83. TP_ARGS(s),
  84. TP_STRUCT__entry(
  85. __string(s, s)
  86. ),
  87. TP_fast_assign(
  88. __assign_str(s, s);
  89. ),
  90. TP_printk("%s", __get_str(s))
  91. );
  92. TRACE_EVENT(cpufreq_interactive_load_change,
  93. TP_PROTO(unsigned long cpu_id),
  94. TP_ARGS(cpu_id),
  95. TP_STRUCT__entry(
  96. __field(unsigned long, cpu_id)
  97. ),
  98. TP_fast_assign(
  99. __entry->cpu_id = cpu_id;
  100. ),
  101. TP_printk("re-evaluate for cpu=%lu", __entry->cpu_id)
  102. );
  103. TRACE_EVENT(cpufreq_interactive_cpuload,
  104. TP_PROTO(unsigned long cpu_id, unsigned int load,
  105. unsigned int new_task_pct, unsigned int prev,
  106. unsigned int predicted),
  107. TP_ARGS(cpu_id, load, new_task_pct, prev, predicted),
  108. TP_STRUCT__entry(
  109. __field(unsigned long, cpu_id)
  110. __field(unsigned int, load)
  111. __field(unsigned int, new_task_pct)
  112. __field(unsigned int, prev)
  113. __field(unsigned int, predicted)
  114. ),
  115. TP_fast_assign(
  116. __entry->cpu_id = cpu_id;
  117. __entry->load = load;
  118. __entry->new_task_pct = new_task_pct;
  119. __entry->prev = prev;
  120. __entry->predicted = predicted;
  121. ),
  122. TP_printk("cpu=%lu load=%u new_task_pct=%u prev=%u predicted=%u",
  123. __entry->cpu_id, __entry->load, __entry->new_task_pct,
  124. __entry->prev, __entry->predicted)
  125. );
  126. #endif /* _TRACE_CPUFREQ_INTERACTIVE_H */
  127. /* This part must be outside protection */
  128. #include <trace/define_trace.h>