power.h 858 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _TRACE_POWER_H
  2. #define _TRACE_POWER_H
  3. #include <linux/ktime.h>
  4. enum {
  5. POWER_NONE = 0,
  6. POWER_CSTATE = 1,
  7. POWER_PSTATE = 2,
  8. };
  9. struct power_trace {
  10. #ifdef CONFIG_POWER_TRACER
  11. ktime_t stamp;
  12. ktime_t end;
  13. int type;
  14. int state;
  15. #endif
  16. };
  17. #ifdef CONFIG_POWER_TRACER
  18. extern void trace_power_start(struct power_trace *it, unsigned int type,
  19. unsigned int state);
  20. extern void trace_power_mark(struct power_trace *it, unsigned int type,
  21. unsigned int state);
  22. extern void trace_power_end(struct power_trace *it);
  23. #else
  24. static inline void trace_power_start(struct power_trace *it, unsigned int type,
  25. unsigned int state) { }
  26. static inline void trace_power_mark(struct power_trace *it, unsigned int type,
  27. unsigned int state) { }
  28. static inline void trace_power_end(struct power_trace *it) { }
  29. #endif
  30. #endif /* _TRACE_POWER_H */