요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=============================
Subsystem Trace Points: power
=============================
The power tracing system captures events related to power transitions
within the kernel. Broadly speaking there are three major subheadings:
- Power state switch which reports events related to suspend (S-states),
cpuidle (C-states) and cpufreq (P-states)
- System clock related changes
- Power domains related changes and transitions
This document describes what each of the tracepoints is and why they
might be useful.
Cf. include/trace/events/power.h for the events definitions.
1. Power state switch events
============================
1.1 Trace API
-----------------
A 'cpu' event class gathers the CPU-related events: cpuidle and
cpufreq.
::
cpu_idle "state=%lu cpu_id=%lu"
cpu_frequency "state=%lu cpu_id=%lu"
cpu_frequency_limits "min=%lu max=%lu cpu_id=%lu"
A suspend event is used to indicate the system going in and out of the
suspend mode:
::
machine_suspend "state=%lu"
Note: the value of '-1' or '4294967295' for state means an exit from the current state,
i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
means that the system exits the previous idle state.
The event which has 'state=4294967295' in the trace is very important to the user
space tools which are using it to detect the end of the current state, and so to
correctly draw the states diagrams and to calculate accurate statistics etc.
2. Clocks events
================
The clock events are used for clock enable/disable and for
clock rate change.
::
clock_enable "%s state=%lu cpu_id=%lu"
clock_disable "%s state=%lu cpu_id=%lu"
clock_set_rate "%s state=%lu cpu_id=%lu"
The first parameter gives the clock name (e.g. "gpio1_iclk").
The second parameter is '1' for enable, '0' for disable, the target
clock rate for set_rate.
3. Power domains events
=======================
The power domain events are used for power domains transitions
::
power_domain_target "%s state=%lu cpu_id=%lu"
The first parameter gives the power domain name (e.g. "mpu_pwrdm").
The second parameter is the power domain target state.
4. PM QoS events
================
The PM QoS events are used for QoS add/update/remove request and for
target/flags update.
::
pm_qos_update_target "action=%s prev_value=%d curr_value=%d"
pm_qos_update_flags "action=%s prev_value=0x%x curr_value=0x%x"
The first parameter gives the QoS action name (e.g. "ADD_REQ").
The second parameter is the previous QoS value.
The third parameter is the current QoS value to update.
There are also events used for device PM QoS add/update/remove request.
::
dev_pm_qos_add_request "device=%s type=%s new_value=%d"
dev_pm_qos_update_request "device=%s type=%s new_value=%d"
dev_pm_qos_remove_request "device=%s type=%s new_value=%d"
The first parameter gives the device name which tries to add/update/remove
QoS requests.
The second parameter gives the request type (e.g. "DEV_PM_QOS_RESUME_LATENCY").
The third parameter is value to be added/updated/removed.
And, there are events used for CPU latency QoS add/update/remove request.
::
pm_qos_add_request "value=%d"
pm_qos_update_request "value=%d"
pm_qos_remove_request "value=%d"
The parameter is the value to be added/updated/removed.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Power tracepoint 범주
1-17power tracing system은 kernel 내부의 power transition 관련 event를 캡처한다. 이 문서는 각 tracepoint와 활용 이유를 설명하며 event 정의는 `include/trace/events/power.h`에 있다.
큰 범주는 suspend S-state, cpuidle C-state, cpufreq P-state를 포함한 power state switch, system clock change, power domain change와 transition이다. 뒤에는 PM QoS event도 설명한다.
system 전력 상태와 제약 변경을 네 영역으로 정리한다.
CPU에서 device QoS까지 여러 계층의 transition을 기록한다.
=============================
Subsystem Trace Points: power
=============================
The power tracing system captures events related to power transitions
within the kernel. Broadly speaking there are three major subheadings:
- Power state switch which reports events related to suspend (S-states),
cpuidle (C-states) and cpufreq (P-states)
- System clock related changes
- Power domains related changes and transitions
This document describes what each of the tracepoints is and why they
might be useful.
Cf. include/trace/events/power.h for the events definitions.
CPU와 suspend state event
18-47`cpu` event class는 cpuidle과 cpufreq 관련 event를 모은다. `cpu_idle`은 state와 cpu_id, `cpu_frequency`는 frequency state와 cpu_id, `cpu_frequency_limits`는 min, max, cpu_id를 기록한다.
`machine_suspend` event는 system이 suspend mode에 들어가고 나오는 것을 state 값으로 표시한다.
state가 `-1` 또는 unsigned 표현 `4294967295`이면 현재 state에서 빠져나왔다는 뜻이다. `trace_cpu_idle(4, cpu)`는 idle state 4 진입이고 `trace_cpu_idle(PWR_EVENT_EXIT, cpu)`는 이전 idle state 종료다.
`state=4294967295` event는 user-space tool이 현재 state 종료 시점을 감지하는 데 매우 중요하다. 이를 사용해야 state diagram을 정확히 그리고 올바른 통계를 계산할 수 있다.
CPU state와 frequency 관련 field를 구분한다.
진입 event와 PWR_EVENT_EXIT가 한 상태의 구간을 닫는다.
1. Power state switch events
============================
1.1 Trace API
-----------------
A 'cpu' event class gathers the CPU-related events: cpuidle and
cpufreq.
::
cpu_idle "state=%lu cpu_id=%lu"
cpu_frequency "state=%lu cpu_id=%lu"
cpu_frequency_limits "min=%lu max=%lu cpu_id=%lu"
A suspend event is used to indicate the system going in and out of the
suspend mode:
::
machine_suspend "state=%lu"
Note: the value of '-1' or '4294967295' for state means an exit from the current state,
i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
means that the system exits the previous idle state.
The event which has 'state=4294967295' in the trace is very important to the user
space tools which are using it to detect the end of the current state, and so to
correctly draw the states diagrams and to calculate accurate statistics etc.
Clock과 power domain event
48-71clock event는 clock enable, disable, rate change를 기록한다. `clock_enable`, `clock_disable`, `clock_set_rate` 모두 clock name, state, cpu_id를 제공한다.
첫 parameter는 `gpio1_iclk` 같은 clock name이다. 두 번째 parameter는 enable이면 1, disable이면 0이고 `set_rate`에서는 target clock rate다.
`power_domain_target`은 power domain transition을 기록한다. 첫 parameter는 `mpu_pwrdm` 같은 domain name이고 두 번째는 target state다.
같은 state field가 event 종류에 따라 다른 의미를 갖는다.
domain name과 목표 상태를 CPU context와 함께 기록한다.
2. Clocks events
================
The clock events are used for clock enable/disable and for
clock rate change.
::
clock_enable "%s state=%lu cpu_id=%lu"
clock_disable "%s state=%lu cpu_id=%lu"
clock_set_rate "%s state=%lu cpu_id=%lu"
The first parameter gives the clock name (e.g. "gpio1_iclk").
The second parameter is '1' for enable, '0' for disable, the target
clock rate for set_rate.
3. Power domains events
=======================
The power domain events are used for power domains transitions
::
power_domain_target "%s state=%lu cpu_id=%lu"
The first parameter gives the power domain name (e.g. "mpu_pwrdm").
The second parameter is the power domain target state.
PM QoS와 device·CPU latency request
72-104PM QoS event는 QoS request의 add, update, remove와 target 또는 flags update를 기록한다.
`pm_qos_update_target`과 `pm_qos_update_flags`는 action name, previous value, current value를 제공한다. action은 `ADD_REQ` 같은 이름이며 flags는 16진수로 표시된다.
device PM QoS에는 `dev_pm_qos_add_request`, `dev_pm_qos_update_request`, `dev_pm_qos_remove_request`가 있다. parameter는 요청을 조작하는 device name, `DEV_PM_QOS_RESUME_LATENCY` 같은 request type, 추가·갱신·제거할 value다.
CPU latency QoS에는 `pm_qos_add_request`, `pm_qos_update_request`, `pm_qos_remove_request`가 있고 parameter 하나로 추가·갱신·제거할 value를 기록한다.
system target, device request, CPU latency request를 구분한다.
request가 추가되고 변경된 뒤 제거되는 과정을 event로 남긴다.
device request event의 세 parameter다.
4. PM QoS events
================
The PM QoS events are used for QoS add/update/remove request and for
target/flags update.
::
pm_qos_update_target "action=%s prev_value=%d curr_value=%d"
pm_qos_update_flags "action=%s prev_value=0x%x curr_value=0x%x"
The first parameter gives the QoS action name (e.g. "ADD_REQ").
The second parameter is the previous QoS value.
The third parameter is the current QoS value to update.
There are also events used for device PM QoS add/update/remove request.
::
dev_pm_qos_add_request "device=%s type=%s new_value=%d"
dev_pm_qos_update_request "device=%s type=%s new_value=%d"
dev_pm_qos_remove_request "device=%s type=%s new_value=%d"
The first parameter gives the device name which tries to add/update/remove
QoS requests.
The second parameter gives the request type (e.g. "DEV_PM_QOS_RESUME_LATENCY").
The third parameter is value to be added/updated/removed.
And, there are events used for CPU latency QoS add/update/remove request.
::
pm_qos_add_request "value=%d"
pm_qos_update_request "value=%d"
pm_qos_remove_request "value=%d"
The parameter is the value to be added/updated/removed.
요약·해설
events-power.rst:1-104CPU power state, clock, power domain과 PM QoS request transition을 기록하는 power subsystem tracepoint입니다.