← Documents Documentation/trace/events-pci.rst GitHub 원문 ↗

Linux 6.18.37 · Tracing

Subsystem Trace Points: PCI

PCI card hotplug와 PCIe link speed·상태 변경을 관찰하는 tracepoint와 reason code입니다.

Source pathDocumentation/trace/events-pci.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

events-pci.rst:1-74

PCI card hotplug와 PCIe link speed·상태 변경을 관찰하는 tracepoint와 reason code입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ===========================
4 Subsystem Trace Points: PCI
5 ===========================
6
7 Overview
8 ========
9 The PCI tracing system provides tracepoints to monitor critical hardware events
10 that can impact system performance and reliability. These events normally show
11 up here:
12
13 /sys/kernel/tracing/events/pci
14
15 Cf. include/trace/events/pci.h for the events definitions.
16
17 Available Tracepoints
18 =====================
19
20 pci_hp_event
21 ------------
22
23 Monitors PCI hotplug events including card insertion/removal and link
24 state changes.
25 ::
26
27 pci_hp_event "%s slot:%s, event:%s\n"
28
29 **Event Types**:
30
31 * ``LINK_UP`` - PCIe link established
32 * ``LINK_DOWN`` - PCIe link lost
33 * ``CARD_PRESENT`` - Card detected in slot
34 * ``CARD_NOT_PRESENT`` - Card removed from slot
35
36 **Example Usage**::
37
38 # Enable the tracepoint
39 echo 1 > /sys/kernel/debug/tracing/events/pci/pci_hp_event/enable
40
41 # Monitor events (the following output is generated when a device is hotplugged)
42 cat /sys/kernel/debug/tracing/trace_pipe
43 irq/51-pciehp-88 [001] ..... 1311.177459: pci_hp_event: 0000:00:02.0 slot:10, event:CARD_PRESENT
44
45 irq/51-pciehp-88 [001] ..... 1311.177566: pci_hp_event: 0000:00:02.0 slot:10, event:LINK_UP
46
47 pcie_link_event
48 ---------------
49
50 Monitors PCIe link speed changes and provides detailed link status information.
51 ::
52
53 pcie_link_event "%s type:%d, reason:%d, cur_bus_speed:%d, max_bus_speed:%d, width:%u, flit_mode:%u, status:%s\n"
54
55 **Parameters**:
56
57 * ``type`` - PCIe device type (4=Root Port, etc.)
58 * ``reason`` - Reason for link change:
59
60 - ``0`` - Link retrain
61 - ``1`` - Bus enumeration
62 - ``2`` - Bandwidth notification enable
63 - ``3`` - Bandwidth notification IRQ
64 - ``4`` - Hotplug event
65
66
67 **Example Usage**::
68
69 # Enable the tracepoint
70 echo 1 > /sys/kernel/debug/tracing/events/pci/pcie_link_event/enable
71
72 # Monitor events (the following output is generated when a device is hotplugged)
73 cat /sys/kernel/debug/tracing/trace_pipe
74 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
75

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

PCI tracepoint 개요

1-18

PCI tracing system은 system 성능과 신뢰성에 영향을 줄 수 있는 중요한 hardware event를 감시하는 tracepoint를 제공한다.

event는 보통 `/sys/kernel/tracing/events/pci` 아래에 나타나며 정의는 `include/trace/events/pci.h`에 있다. 문서는 GPL-2.0을 따른다.

PCI event 위치
PCI hardware eventinclude/trace/events/pci.h
Tracepoint/sys/kernel/tracing/events/pci

hardware event가 PCI trace group으로 노출된다.

PCI tracepoint 목적
대상영향
Hotplugcard insertion and removal
Link state and speedperformance and reliability

관찰 대상과 영향 영역이다.

.. 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가 나타난다.

pci_hp_event type
Type의미
LINK_UPPCIe link established
LINK_DOWNPCIe link lost
CARD_PRESENTCard detected in slot
CARD_NOT_PRESENTCard removed from slot

hotplug 과정의 card와 link 상태를 구분한다.

PCI hotplug 예시
Insert device 0000:00:02.0CARD_PRESENT at slot 10
CARD_PRESENTPCIe link training
PCIe link trainingLINK_UP

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