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