thermal_power_allocator.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM thermal_power_allocator
  3. #if !defined(_TRACE_THERMAL_POWER_ALLOCATOR_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_THERMAL_POWER_ALLOCATOR_H
  5. #include <linux/tracepoint.h>
  6. TRACE_EVENT(thermal_power_allocator,
  7. TP_PROTO(struct thermal_zone_device *tz, u32 *req_power,
  8. u32 total_req_power, u32 *granted_power,
  9. u32 total_granted_power, size_t num_actors,
  10. u32 power_range, u32 max_allocatable_power,
  11. int current_temp, s32 delta_temp),
  12. TP_ARGS(tz, req_power, total_req_power, granted_power,
  13. total_granted_power, num_actors, power_range,
  14. max_allocatable_power, current_temp, delta_temp),
  15. TP_STRUCT__entry(
  16. __field(int, tz_id )
  17. __dynamic_array(u32, req_power, num_actors )
  18. __field(u32, total_req_power )
  19. __dynamic_array(u32, granted_power, num_actors)
  20. __field(u32, total_granted_power )
  21. __field(size_t, num_actors )
  22. __field(u32, power_range )
  23. __field(u32, max_allocatable_power )
  24. __field(int, current_temp )
  25. __field(s32, delta_temp )
  26. ),
  27. TP_fast_assign(
  28. __entry->tz_id = tz->id;
  29. memcpy(__get_dynamic_array(req_power), req_power,
  30. num_actors * sizeof(*req_power));
  31. __entry->total_req_power = total_req_power;
  32. memcpy(__get_dynamic_array(granted_power), granted_power,
  33. num_actors * sizeof(*granted_power));
  34. __entry->total_granted_power = total_granted_power;
  35. __entry->num_actors = num_actors;
  36. __entry->power_range = power_range;
  37. __entry->max_allocatable_power = max_allocatable_power;
  38. __entry->current_temp = current_temp;
  39. __entry->delta_temp = delta_temp;
  40. ),
  41. TP_printk("thermal_zone_id=%d req_power={%s} total_req_power=%u granted_power={%s} total_granted_power=%u power_range=%u max_allocatable_power=%u current_temperature=%d delta_temperature=%d",
  42. __entry->tz_id,
  43. __print_array(__get_dynamic_array(req_power),
  44. __entry->num_actors, 4),
  45. __entry->total_req_power,
  46. __print_array(__get_dynamic_array(granted_power),
  47. __entry->num_actors, 4),
  48. __entry->total_granted_power, __entry->power_range,
  49. __entry->max_allocatable_power, __entry->current_temp,
  50. __entry->delta_temp)
  51. );
  52. TRACE_EVENT(thermal_power_allocator_pid,
  53. TP_PROTO(struct thermal_zone_device *tz, s32 err, s32 err_integral,
  54. s64 p, s64 i, s64 d, s32 output),
  55. TP_ARGS(tz, err, err_integral, p, i, d, output),
  56. TP_STRUCT__entry(
  57. __field(int, tz_id )
  58. __field(s32, err )
  59. __field(s32, err_integral)
  60. __field(s64, p )
  61. __field(s64, i )
  62. __field(s64, d )
  63. __field(s32, output )
  64. ),
  65. TP_fast_assign(
  66. __entry->tz_id = tz->id;
  67. __entry->err = err;
  68. __entry->err_integral = err_integral;
  69. __entry->p = p;
  70. __entry->i = i;
  71. __entry->d = d;
  72. __entry->output = output;
  73. ),
  74. TP_printk("thermal_zone_id=%d err=%d err_integral=%d p=%lld i=%lld d=%lld output=%d",
  75. __entry->tz_id, __entry->err, __entry->err_integral,
  76. __entry->p, __entry->i, __entry->d, __entry->output)
  77. );
  78. #endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */
  79. /* This part must be outside protection */
  80. #include <trace/define_trace.h>