요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
===========================
Subsystem Trace Points: PCI
===========================
Overview
========
The PCI tracing system provides tracepoints to monitor critical hardware events
that can impact system performance and reliability. These events normally show
up here:
/sys/kernel/tracing/events/pci
Cf. include/trace/events/pci.h for the events definitions.
Available Tracepoints
=====================
pci_hp_event
------------
Monitors PCI hotplug events including card insertion/removal and link
state changes.
::
pci_hp_event "%s slot:%s, event:%s\n"
**Event Types**:
* ``LINK_UP`` - PCIe link established
* ``LINK_DOWN`` - PCIe link lost
* ``CARD_PRESENT`` - Card detected in slot
* ``CARD_NOT_PRESENT`` - Card removed from slot
**Example Usage**::
# Enable the tracepoint
echo 1 > /sys/kernel/debug/tracing/events/pci/pci_hp_event/enable
# Monitor events (the following output is generated when a device is hotplugged)
cat /sys/kernel/debug/tracing/trace_pipe
irq/51-pciehp-88 [001] ..... 1311.177459: pci_hp_event: 0000:00:02.0 slot:10, event:CARD_PRESENT
irq/51-pciehp-88 [001] ..... 1311.177566: pci_hp_event: 0000:00:02.0 slot:10, event:LINK_UP
pcie_link_event
---------------
Monitors PCIe link speed changes and provides detailed link status information.
::
pcie_link_event "%s type:%d, reason:%d, cur_bus_speed:%d, max_bus_speed:%d, width:%u, flit_mode:%u, status:%s\n"
**Parameters**:
* ``type`` - PCIe device type (4=Root Port, etc.)
* ``reason`` - Reason for link change:
- ``0`` - Link retrain
- ``1`` - Bus enumeration
- ``2`` - Bandwidth notification enable
- ``3`` - Bandwidth notification IRQ
- ``4`` - Hotplug event
**Example Usage**::
# Enable the tracepoint
echo 1 > /sys/kernel/debug/tracing/events/pci/pcie_link_event/enable
# Monitor events (the following output is generated when a device is hotplugged)
cat /sys/kernel/debug/tracing/trace_pipe
irq/51-pciehp-88 [001] ..... 381.545386: pcie_link_event: 0000:00:02.0 type:4, reason:4, cur_bus_speed:20, max_bus_speed:23, width:1, flit_mode:0, status:DLLLA
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
PCI tracepoint 개요
1-18PCI tracing system은 system 성능과 신뢰성에 영향을 줄 수 있는 중요한 hardware event를 감시하는 tracepoint를 제공한다.
event는 보통 `/sys/kernel/tracing/events/pci` 아래에 나타나며 정의는 `include/trace/events/pci.h`에 있다. 문서는 GPL-2.0을 따른다.
hardware event가 PCI trace group으로 노출된다.
관찰 대상과 영향 영역이다.
.. SPDX-License-Identifier: GPL-2.0
===========================
Subsystem Trace Points: PCI
===========================
Overview
========
The PCI tracing system provides tracepoints to monitor critical hardware events
that can impact system performance and reliability. These events normally show
up here:
/sys/kernel/tracing/events/pci
Cf. include/trace/events/pci.h for the events definitions.
Available Tracepoints
=====================
pci_hp_event
19-46`pci_hp_event`는 card insertion/removal과 link state change를 포함한 PCI hotplug event를 감시한다. format은 device, slot, event type을 기록한다.
`LINK_UP`은 PCIe link가 성립했음을, `LINK_DOWN`은 link가 끊어졌음을 뜻한다. `CARD_PRESENT`는 slot에서 card를 감지했고 `CARD_NOT_PRESENT`는 card가 제거됐음을 뜻한다.
예시는 debugfs tracing 경로에서 tracepoint를 활성화하고 `trace_pipe`를 읽는다. device `0000:00:02.0`을 slot 10에 hotplug하면 먼저 `CARD_PRESENT`, 이어서 `LINK_UP` record가 나타난다.
hotplug 과정의 card와 link 상태를 구분한다.
card 감지 뒤 link가 올라오는 순서다.
pci_hp_event
------------
Monitors PCI hotplug events including card insertion/removal and link
state changes.
::
pci_hp_event "%s slot:%s, event:%s\n"
**Event Types**:
* ``LINK_UP`` - PCIe link established
* ``LINK_DOWN`` - PCIe link lost
* ``CARD_PRESENT`` - Card detected in slot
* ``CARD_NOT_PRESENT`` - Card removed from slot
**Example Usage**::
# Enable the tracepoint
echo 1 > /sys/kernel/debug/tracing/events/pci/pci_hp_event/enable
# Monitor events (the following output is generated when a device is hotplugged)
cat /sys/kernel/debug/tracing/trace_pipe
irq/51-pciehp-88 [001] ..... 1311.177459: pci_hp_event: 0000:00:02.0 slot:10, event:CARD_PRESENT
irq/51-pciehp-88 [001] ..... 1311.177566: pci_hp_event: 0000:00:02.0 slot:10, event:LINK_UP
pcie_link_event
47-74`pcie_link_event`는 PCIe link speed change를 감시하고 자세한 link status를 제공한다. record에는 device, type, reason, current와 maximum bus speed, width, flit mode, status가 들어간다.
`type`은 PCIe device type이며 4는 Root Port의 예다. `reason` 0은 link retrain, 1은 bus enumeration, 2는 bandwidth notification enable, 3은 bandwidth notification IRQ, 4는 hotplug event다.
예시 hotplug record는 device type 4, reason 4, current bus speed 20, maximum 23, width 1, flit mode 0, status `DLLLA`를 보여 준다.
link change가 발생한 원인을 numeric code로 나타낸다.
trace 출력의 주요 parameter다.
link change 원인과 현재 상태를 한 record에 결합한다.
pcie_link_event
---------------
Monitors PCIe link speed changes and provides detailed link status information.
::
pcie_link_event "%s type:%d, reason:%d, cur_bus_speed:%d, max_bus_speed:%d, width:%u, flit_mode:%u, status:%s\n"
**Parameters**:
* ``type`` - PCIe device type (4=Root Port, etc.)
* ``reason`` - Reason for link change:
- ``0`` - Link retrain
- ``1`` - Bus enumeration
- ``2`` - Bandwidth notification enable
- ``3`` - Bandwidth notification IRQ
- ``4`` - Hotplug event
**Example Usage**::
# Enable the tracepoint
echo 1 > /sys/kernel/debug/tracing/events/pci/pcie_link_event/enable
# Monitor events (the following output is generated when a device is hotplugged)
cat /sys/kernel/debug/tracing/trace_pipe
irq/51-pciehp-88 [001] ..... 381.545386: pcie_link_event: 0000:00:02.0 type:4, reason:4, cur_bus_speed:20, max_bus_speed:23, width:1, flit_mode:0, status:DLLLA
요약·해설
events-pci.rst:1-74PCI card hotplug와 PCIe link speed·상태 변경을 관찰하는 tracepoint와 reason code입니다.