blob: 2ef318962e292bd08368a719a460fc61ebd9cb0b [file] [log] [blame]
Changbin Du47e073d2018-02-17 13:39:44 +08001=============================
2Subsystem Trace Points: power
3=============================
Jean Pihet4b95f132011-01-05 19:49:02 +01004
5The power tracing system captures events related to power transitions
6within the kernel. Broadly speaking there are three major subheadings:
7
Changbin Du47e073d2018-02-17 13:39:44 +08008 - Power state switch which reports events related to suspend (S-states),
9 cpuidle (C-states) and cpufreq (P-states)
10 - System clock related changes
11 - Power domains related changes and transitions
Jean Pihet4b95f132011-01-05 19:49:02 +010012
13This document describes what each of the tracepoints is and why they
14might be useful.
15
16Cf. include/trace/events/power.h for the events definitions.
17
181. Power state switch events
19============================
20
Paul Gortmaker43720bd2013-01-11 13:43:45 +0100211.1 Trace API
Jean Pihet4b95f132011-01-05 19:49:02 +010022-----------------
23
24A 'cpu' event class gathers the CPU-related events: cpuidle and
25cpufreq.
Changbin Du47e073d2018-02-17 13:39:44 +080026::
Jean Pihet4b95f132011-01-05 19:49:02 +010027
Changbin Du47e073d2018-02-17 13:39:44 +080028 cpu_idle "state=%lu cpu_id=%lu"
29 cpu_frequency "state=%lu cpu_id=%lu"
Ruchi Kandoi601b2182018-07-24 10:35:44 -070030 cpu_frequency_limits "min=%lu max=%lu cpu_id=%lu"
Jean Pihet4b95f132011-01-05 19:49:02 +010031
32A suspend event is used to indicate the system going in and out of the
33suspend mode:
Changbin Du47e073d2018-02-17 13:39:44 +080034::
Jean Pihet4b95f132011-01-05 19:49:02 +010035
Changbin Du47e073d2018-02-17 13:39:44 +080036 machine_suspend "state=%lu"
Jean Pihet4b95f132011-01-05 19:49:02 +010037
38
39Note: the value of '-1' or '4294967295' for state means an exit from the current state,
40i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
41enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
42means that the system exits the previous idle state.
43
44The event which has 'state=4294967295' in the trace is very important to the user
45space tools which are using it to detect the end of the current state, and so to
46correctly draw the states diagrams and to calculate accurate statistics etc.
47
Jean Pihet4b95f132011-01-05 19:49:02 +0100482. Clocks events
49================
50The clock events are used for clock enable/disable and for
51clock rate change.
Changbin Du47e073d2018-02-17 13:39:44 +080052::
Jean Pihet4b95f132011-01-05 19:49:02 +010053
Changbin Du47e073d2018-02-17 13:39:44 +080054 clock_enable "%s state=%lu cpu_id=%lu"
55 clock_disable "%s state=%lu cpu_id=%lu"
56 clock_set_rate "%s state=%lu cpu_id=%lu"
Jean Pihet4b95f132011-01-05 19:49:02 +010057
58The first parameter gives the clock name (e.g. "gpio1_iclk").
59The second parameter is '1' for enable, '0' for disable, the target
60clock rate for set_rate.
61
623. Power domains events
63=======================
64The power domain events are used for power domains transitions
Changbin Du47e073d2018-02-17 13:39:44 +080065::
Jean Pihet4b95f132011-01-05 19:49:02 +010066
Changbin Du47e073d2018-02-17 13:39:44 +080067 power_domain_target "%s state=%lu cpu_id=%lu"
Jean Pihet4b95f132011-01-05 19:49:02 +010068
69The first parameter gives the power domain name (e.g. "mpu_pwrdm").
70The second parameter is the power domain target state.
71
Saharaf5ce1572013-06-21 11:12:31 +0900724. PM QoS events
73================
74The PM QoS events are used for QoS add/update/remove request and for
75target/flags update.
Changbin Du47e073d2018-02-17 13:39:44 +080076::
Saharaf5ce1572013-06-21 11:12:31 +090077
Changbin Du47e073d2018-02-17 13:39:44 +080078 pm_qos_add_request "pm_qos_class=%s value=%d"
79 pm_qos_update_request "pm_qos_class=%s value=%d"
80 pm_qos_remove_request "pm_qos_class=%s value=%d"
81 pm_qos_update_request_timeout "pm_qos_class=%s value=%d, timeout_us=%ld"
Saharaf5ce1572013-06-21 11:12:31 +090082
83The first parameter gives the QoS class name (e.g. "CPU_DMA_LATENCY").
84The second parameter is value to be added/updated/removed.
85The third parameter is timeout value in usec.
Changbin Du47e073d2018-02-17 13:39:44 +080086::
Saharaf5ce1572013-06-21 11:12:31 +090087
Changbin Du47e073d2018-02-17 13:39:44 +080088 pm_qos_update_target "action=%s prev_value=%d curr_value=%d"
89 pm_qos_update_flags "action=%s prev_value=0x%x curr_value=0x%x"
Saharaf5ce1572013-06-21 11:12:31 +090090
91The first parameter gives the QoS action name (e.g. "ADD_REQ").
92The second parameter is the previous QoS value.
93The third parameter is the current QoS value to update.
94
95And, there are also events used for device PM QoS add/update/remove request.
Changbin Du47e073d2018-02-17 13:39:44 +080096::
Saharaf5ce1572013-06-21 11:12:31 +090097
Changbin Du47e073d2018-02-17 13:39:44 +080098 dev_pm_qos_add_request "device=%s type=%s new_value=%d"
99 dev_pm_qos_update_request "device=%s type=%s new_value=%d"
100 dev_pm_qos_remove_request "device=%s type=%s new_value=%d"
Saharaf5ce1572013-06-21 11:12:31 +0900101
102The first parameter gives the device name which tries to add/update/remove
103QoS requests.
Rafael J. Wysockib02f6692014-02-11 00:35:23 +0100104The second parameter gives the request type (e.g. "DEV_PM_QOS_RESUME_LATENCY").
Saharaf5ce1572013-06-21 11:12:31 +0900105The third parameter is value to be added/updated/removed.