Commit | Line | Data |
---|---|---|
47e073d2 CD |
1 | ============================= |
2 | Subsystem Trace Points: power | |
3 | ============================= | |
4b95f135 JP |
4 | |
5 | The power tracing system captures events related to power transitions | |
6 | within the kernel. Broadly speaking there are three major subheadings: | |
7 | ||
47e073d2 CD |
8 | - 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 | |
4b95f135 JP |
12 | |
13 | This document describes what each of the tracepoints is and why they | |
14 | might be useful. | |
15 | ||
16 | Cf. include/trace/events/power.h for the events definitions. | |
17 | ||
18 | 1. Power state switch events | |
19 | ============================ | |
20 | ||
43720bd6 | 21 | 1.1 Trace API |
4b95f135 JP |
22 | ----------------- |
23 | ||
24 | A 'cpu' event class gathers the CPU-related events: cpuidle and | |
25 | cpufreq. | |
47e073d2 | 26 | :: |
4b95f135 | 27 | |
47e073d2 CD |
28 | cpu_idle "state=%lu cpu_id=%lu" |
29 | cpu_frequency "state=%lu cpu_id=%lu" | |
4b95f135 JP |
30 | |
31 | A suspend event is used to indicate the system going in and out of the | |
32 | suspend mode: | |
47e073d2 | 33 | :: |
4b95f135 | 34 | |
47e073d2 | 35 | machine_suspend "state=%lu" |
4b95f135 JP |
36 | |
37 | ||
38 | Note: the value of '-1' or '4294967295' for state means an exit from the current state, | |
39 | i.e. trace_cpu_idle(4, smp_processor_id()) means that the system | |
40 | enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()) | |
41 | means that the system exits the previous idle state. | |
42 | ||
43 | The event which has 'state=4294967295' in the trace is very important to the user | |
44 | space tools which are using it to detect the end of the current state, and so to | |
45 | correctly draw the states diagrams and to calculate accurate statistics etc. | |
46 | ||
4b95f135 JP |
47 | 2. Clocks events |
48 | ================ | |
49 | The clock events are used for clock enable/disable and for | |
50 | clock rate change. | |
47e073d2 | 51 | :: |
4b95f135 | 52 | |
47e073d2 CD |
53 | clock_enable "%s state=%lu cpu_id=%lu" |
54 | clock_disable "%s state=%lu cpu_id=%lu" | |
55 | clock_set_rate "%s state=%lu cpu_id=%lu" | |
4b95f135 JP |
56 | |
57 | The first parameter gives the clock name (e.g. "gpio1_iclk"). | |
58 | The second parameter is '1' for enable, '0' for disable, the target | |
59 | clock rate for set_rate. | |
60 | ||
61 | 3. Power domains events | |
62 | ======================= | |
63 | The power domain events are used for power domains transitions | |
47e073d2 | 64 | :: |
4b95f135 | 65 | |
47e073d2 | 66 | power_domain_target "%s state=%lu cpu_id=%lu" |
4b95f135 JP |
67 | |
68 | The first parameter gives the power domain name (e.g. "mpu_pwrdm"). | |
69 | The second parameter is the power domain target state. | |
70 | ||
f5ce1572 S |
71 | 4. PM QoS events |
72 | ================ | |
73 | The PM QoS events are used for QoS add/update/remove request and for | |
74 | target/flags update. | |
47e073d2 | 75 | :: |
f5ce1572 | 76 | |
47e073d2 CD |
77 | pm_qos_add_request "pm_qos_class=%s value=%d" |
78 | pm_qos_update_request "pm_qos_class=%s value=%d" | |
79 | pm_qos_remove_request "pm_qos_class=%s value=%d" | |
80 | pm_qos_update_request_timeout "pm_qos_class=%s value=%d, timeout_us=%ld" | |
f5ce1572 S |
81 | |
82 | The first parameter gives the QoS class name (e.g. "CPU_DMA_LATENCY"). | |
83 | The second parameter is value to be added/updated/removed. | |
84 | The third parameter is timeout value in usec. | |
47e073d2 | 85 | :: |
f5ce1572 | 86 | |
47e073d2 CD |
87 | pm_qos_update_target "action=%s prev_value=%d curr_value=%d" |
88 | pm_qos_update_flags "action=%s prev_value=0x%x curr_value=0x%x" | |
f5ce1572 S |
89 | |
90 | The first parameter gives the QoS action name (e.g. "ADD_REQ"). | |
91 | The second parameter is the previous QoS value. | |
92 | The third parameter is the current QoS value to update. | |
93 | ||
94 | And, there are also events used for device PM QoS add/update/remove request. | |
47e073d2 | 95 | :: |
f5ce1572 | 96 | |
47e073d2 CD |
97 | dev_pm_qos_add_request "device=%s type=%s new_value=%d" |
98 | dev_pm_qos_update_request "device=%s type=%s new_value=%d" | |
99 | dev_pm_qos_remove_request "device=%s type=%s new_value=%d" | |
f5ce1572 S |
100 | |
101 | The first parameter gives the device name which tries to add/update/remove | |
102 | QoS requests. | |
b02f6695 | 103 | The second parameter gives the request type (e.g. "DEV_PM_QOS_RESUME_LATENCY"). |
f5ce1572 | 104 | The third parameter is value to be added/updated/removed. |