events-power.txt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 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. 2. Clocks events
  30. ================
  31. The clock events are used for clock enable/disable and for
  32. clock rate change.
  33. clock_enable "%s state=%lu cpu_id=%lu"
  34. clock_disable "%s state=%lu cpu_id=%lu"
  35. clock_set_rate "%s state=%lu cpu_id=%lu"
  36. The first parameter gives the clock name (e.g. "gpio1_iclk").
  37. The second parameter is '1' for enable, '0' for disable, the target
  38. clock rate for set_rate.
  39. 3. Power domains events
  40. =======================
  41. The power domain events are used for power domains transitions
  42. power_domain_target "%s state=%lu cpu_id=%lu"
  43. The first parameter gives the power domain name (e.g. "mpu_pwrdm").
  44. The second parameter is the power domain target state.
  45. 4. PM QoS events
  46. ================
  47. The PM QoS events are used for QoS add/update/remove request and for
  48. target/flags update.
  49. pm_qos_add_request "pm_qos_class=%s value=%d"
  50. pm_qos_update_request "pm_qos_class=%s value=%d"
  51. pm_qos_remove_request "pm_qos_class=%s value=%d"
  52. pm_qos_update_request_timeout "pm_qos_class=%s value=%d, timeout_us=%ld"
  53. The first parameter gives the QoS class name (e.g. "CPU_DMA_LATENCY").
  54. The second parameter is value to be added/updated/removed.
  55. The third parameter is timeout value in usec.
  56. pm_qos_update_target "action=%s prev_value=%d curr_value=%d"
  57. pm_qos_update_flags "action=%s prev_value=0x%x curr_value=0x%x"
  58. The first parameter gives the QoS action name (e.g. "ADD_REQ").
  59. The second parameter is the previous QoS value.
  60. The third parameter is the current QoS value to update.
  61. And, there are also events used for device PM QoS add/update/remove request.
  62. dev_pm_qos_add_request "device=%s type=%s new_value=%d"
  63. dev_pm_qos_update_request "device=%s type=%s new_value=%d"
  64. dev_pm_qos_remove_request "device=%s type=%s new_value=%d"
  65. The first parameter gives the device name which tries to add/update/remove
  66. QoS requests.
  67. The second parameter gives the request type (e.g. "DEV_PM_QOS_RESUME_LATENCY").
  68. The third parameter is value to be added/updated/removed.