thermal.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM thermal
  3. #if !defined(_TRACE_THERMAL_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_THERMAL_H
  5. #include <linux/thermal.h>
  6. #include <linux/tracepoint.h>
  7. TRACE_EVENT(thermal_temperature,
  8. TP_PROTO(struct thermal_zone_device *tz),
  9. TP_ARGS(tz),
  10. TP_STRUCT__entry(
  11. __string(thermal_zone, tz->type)
  12. __field(int, id)
  13. __field(int, temp_prev)
  14. __field(int, temp)
  15. ),
  16. TP_fast_assign(
  17. __assign_str(thermal_zone, tz->type);
  18. __entry->id = tz->id;
  19. __entry->temp_prev = tz->last_temperature;
  20. __entry->temp = tz->temperature;
  21. ),
  22. TP_printk("thermal_zone=%s id=%d temp_prev=%d temp=%d",
  23. __get_str(thermal_zone), __entry->id, __entry->temp_prev,
  24. __entry->temp)
  25. );
  26. TRACE_EVENT(cdev_update,
  27. TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target),
  28. TP_ARGS(cdev, target),
  29. TP_STRUCT__entry(
  30. __string(type, cdev->type)
  31. __field(unsigned long, target)
  32. ),
  33. TP_fast_assign(
  34. __assign_str(type, cdev->type);
  35. __entry->target = target;
  36. ),
  37. TP_printk("type=%s target=%lu", __get_str(type), __entry->target)
  38. );
  39. TRACE_EVENT(thermal_zone_trip,
  40. TP_PROTO(struct thermal_zone_device *tz, int trip,
  41. enum thermal_trip_type trip_type),
  42. TP_ARGS(tz, trip, trip_type),
  43. TP_STRUCT__entry(
  44. __string(thermal_zone, tz->type)
  45. __field(int, id)
  46. __field(int, trip)
  47. __field(enum thermal_trip_type, trip_type)
  48. ),
  49. TP_fast_assign(
  50. __assign_str(thermal_zone, tz->type);
  51. __entry->id = tz->id;
  52. __entry->trip = trip;
  53. __entry->trip_type = trip_type;
  54. ),
  55. TP_printk("thermal_zone=%s id=%d trip=%d trip_type=%d",
  56. __get_str(thermal_zone), __entry->id, __entry->trip,
  57. __entry->trip_type)
  58. );
  59. #endif /* _TRACE_THERMAL_H */
  60. /* This part must be outside protection */
  61. #include <trace/define_trace.h>