events-power.txt 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Subsystem Trace Points: power
  2. The power tracing system captures events related to power transitions
  3. within the kernel. Broadly speaking there are three major subheadings:
  4. o Power state switch which reports events related to suspend (S-states),
  5. cpuidle (C-states) and cpufreq (P-states)
  6. o System clock related changes
  7. o Power domains related changes and transitions
  8. This document describes what each of the tracepoints is and why they
  9. might be useful.
  10. Cf. include/trace/events/power.h for the events definitions.
  11. 1. Power state switch events
  12. ============================
  13. 1.1 New trace API
  14. -----------------
  15. A 'cpu' event class gathers the CPU-related events: cpuidle and
  16. cpufreq.
  17. cpu_idle "state=%lu cpu_id=%lu"
  18. cpu_frequency "state=%lu cpu_id=%lu"
  19. A suspend event is used to indicate the system going in and out of the
  20. suspend mode:
  21. machine_suspend "state=%lu"
  22. Note: the value of '-1' or '4294967295' for state means an exit from the current state,
  23. i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
  24. enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
  25. means that the system exits the previous idle state.
  26. The event which has 'state=4294967295' in the trace is very important to the user
  27. space tools which are using it to detect the end of the current state, and so to
  28. correctly draw the states diagrams and to calculate accurate statistics etc.
  29. 1.2 DEPRECATED trace API
  30. ------------------------
  31. A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of
  32. 'y' has been created. This allows the legacy trace power API to be used conjointly
  33. with the new trace API.
  34. The Kconfig option, the old trace API (in include/trace/events/power.h) and the
  35. old trace points will disappear in a future release (namely 2.6.41).
  36. power_start "type=%lu state=%lu cpu_id=%lu"
  37. power_frequency "type=%lu state=%lu cpu_id=%lu"
  38. power_end "cpu_id=%lu"
  39. The 'type' parameter takes one of those macros:
  40. . POWER_NONE = 0,
  41. . POWER_CSTATE = 1, /* C-State */
  42. . POWER_PSTATE = 2, /* Frequency change or DVFS */
  43. The 'state' parameter is set depending on the type:
  44. . Target C-state for type=POWER_CSTATE,
  45. . Target frequency for type=POWER_PSTATE,
  46. power_end is used to indicate the exit of a state, corresponding to the latest
  47. power_start event.
  48. 2. Clocks events
  49. ================
  50. The clock events are used for clock enable/disable and for
  51. clock rate change.
  52. clock_enable "%s state=%lu cpu_id=%lu"
  53. clock_disable "%s state=%lu cpu_id=%lu"
  54. clock_set_rate "%s state=%lu cpu_id=%lu"
  55. The first parameter gives the clock name (e.g. "gpio1_iclk").
  56. The second parameter is '1' for enable, '0' for disable, the target
  57. clock rate for set_rate.
  58. 3. Power domains events
  59. =======================
  60. The power domain events are used for power domains transitions
  61. power_domain_target "%s state=%lu cpu_id=%lu"
  62. The first parameter gives the power domain name (e.g. "mpu_pwrdm").
  63. The second parameter is the power domain target state.