events-power.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. =============================
  2. Subsystem Trace Points: power
  3. =============================
  4. The power tracing system captures events related to power transitions
  5. within the kernel. Broadly speaking there are three major subheadings:
  6. - Power state switch which reports events related to suspend (S-states),
  7. cpuidle (C-states) and cpufreq (P-states)
  8. - System clock related changes
  9. - Power domains related changes and transitions
  10. This document describes what each of the tracepoints is and why they
  11. might be useful.
  12. Cf. include/trace/events/power.h for the events definitions.
  13. 1. Power state switch events
  14. ============================
  15. 1.1 Trace API
  16. -----------------
  17. A 'cpu' event class gathers the CPU-related events: cpuidle and
  18. cpufreq.
  19. ::
  20. cpu_idle "state=%lu cpu_id=%lu"
  21. cpu_frequency "state=%lu cpu_id=%lu"
  22. cpu_frequency_limits "min=%lu max=%lu cpu_id=%lu"
  23. A suspend event is used to indicate the system going in and out of the
  24. suspend mode:
  25. ::
  26. machine_suspend "state=%lu"
  27. Note: the value of '-1' or '4294967295' for state means an exit from the current state,
  28. i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
  29. enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
  30. means that the system exits the previous idle state.
  31. The event which has 'state=4294967295' in the trace is very important to the user
  32. space tools which are using it to detect the end of the current state, and so to
  33. correctly draw the states diagrams and to calculate accurate statistics etc.
  34. 2. Clocks events
  35. ================
  36. The clock events are used for clock enable/disable and for
  37. clock rate change.
  38. ::
  39. clock_enable "%s state=%lu cpu_id=%lu"
  40. clock_disable "%s state=%lu cpu_id=%lu"
  41. clock_set_rate "%s state=%lu cpu_id=%lu"
  42. The first parameter gives the clock name (e.g. "gpio1_iclk").
  43. The second parameter is '1' for enable, '0' for disable, the target
  44. clock rate for set_rate.
  45. 3. Power domains events
  46. =======================
  47. The power domain events are used for power domains transitions
  48. ::
  49. power_domain_target "%s state=%lu cpu_id=%lu"
  50. The first parameter gives the power domain name (e.g. "mpu_pwrdm").
  51. The second parameter is the power domain target state.
  52. 4. PM QoS events
  53. ================
  54. The PM QoS events are used for QoS add/update/remove request and for
  55. target/flags update.
  56. ::
  57. pm_qos_update_target "action=%s prev_value=%d curr_value=%d"
  58. pm_qos_update_flags "action=%s prev_value=0x%x curr_value=0x%x"
  59. The first parameter gives the QoS action name (e.g. "ADD_REQ").
  60. The second parameter is the previous QoS value.
  61. The third parameter is the current QoS value to update.
  62. There are also events used for device PM QoS add/update/remove request.
  63. ::
  64. dev_pm_qos_add_request "device=%s type=%s new_value=%d"
  65. dev_pm_qos_update_request "device=%s type=%s new_value=%d"
  66. dev_pm_qos_remove_request "device=%s type=%s new_value=%d"
  67. The first parameter gives the device name which tries to add/update/remove
  68. QoS requests.
  69. The second parameter gives the request type (e.g. "DEV_PM_QOS_RESUME_LATENCY").
  70. The third parameter is value to be added/updated/removed.
  71. And, there are events used for CPU latency QoS add/update/remove request.
  72. ::
  73. pm_qos_add_request "value=%d"
  74. pm_qos_update_request "value=%d"
  75. pm_qos_remove_request "value=%d"
  76. The parameter is the value to be added/updated/removed.