← Documents Documentation/admin-guide/perf/dwc_pcie_pmu.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Performance

Synopsys DWC PCIe PMU

DWC PCIe RAS D.E.S의 time/lane counter, SBDF naming과 bandwidth 계산을 설명합니다.

Source pathDocumentation/admin-guide/perf/dwc_pcie_pmu.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

운영 핵심

dwc_pcie_pmu.rst:1-94

Root Port SBDF로 PMU를 찾고 time-based counter 또는 group·event·lane으로 지정한 lane counter를 system-wide로 측정합니다.

관점핵심
CapabilityPCIe Root Port RAS D.E.S Vendor-Specific Extended Capability
CountersTime-based 64-bit 1개, lane event별 32-bit 1개
NamingRoot Port SBDF 기반 `dwc_rootport_{sbdf}`
Time eventRX/TX throughput, low-power LTSSM state time
Lane eventGroup·event·lane ID 지정
LimitsOverflow interrupt·sampling·per-task session 미지원

2. 영어 원문 전체

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

원문 전체 펼치기
1 ======================================================================
2 Synopsys DesignWare Cores (DWC) PCIe Performance Monitoring Unit (PMU)
3 ======================================================================
4
5 DesignWare Cores (DWC) PCIe PMU
6 ===============================
7
8 The PMU is a PCIe configuration space register block provided by each PCIe Root
9 Port in a Vendor-Specific Extended Capability named RAS D.E.S (Debug, Error
10 injection, and Statistics).
11
12 As the name indicates, the RAS DES capability supports system level
13 debugging, AER error injection, and collection of statistics. To facilitate
14 collection of statistics, Synopsys DesignWare Cores PCIe controller
15 provides the following two features:
16
17 - one 64-bit counter for Time Based Analysis (RX/TX data throughput and
18 time spent in each low-power LTSSM state) and
19 - one 32-bit counter per event for Event Counting (error and non-error
20 events for a specified lane)
21
22 Note: There is no interrupt for counter overflow.
23
24 Time Based Analysis
25 -------------------
26
27 Using this feature you can obtain information regarding RX/TX data
28 throughput and time spent in each low-power LTSSM state by the controller.
29 The PMU measures data in two categories:
30
31 - Group#0: Percentage of time the controller stays in LTSSM states.
32 - Group#1: Amount of data processed (Units of 16 bytes).
33
34 Lane Event counters
35 -------------------
36
37 Using this feature you can obtain Error and Non-Error information in
38 specific lane by the controller. The PMU event is selected by all of:
39
40 - Group i
41 - Event j within the Group i
42 - Lane k
43
44 Some of the events only exist for specific configurations.
45
46 DesignWare Cores (DWC) PCIe PMU Driver
47 =======================================
48
49 This driver adds PMU devices for each PCIe Root Port named based on the SBDF of
50 the Root Port. For example,
51
52 0001:30:03.0 PCI bridge: Device 1ded:8000 (rev 01)
53
54 the PMU device name for this Root Port is dwc_rootport_13018.
55
56 The DWC PCIe PMU driver registers a perf PMU driver, which provides
57 description of available events and configuration options in sysfs, see
58 /sys/bus/event_source/devices/dwc_rootport_{sbdf}.
59
60 The "format" directory describes format of the config fields of the
61 perf_event_attr structure. The "events" directory provides configuration
62 templates for all documented events. For example,
63 "rx_pcie_tlp_data_payload" is an equivalent of "eventid=0x21,type=0x0".
64
65 The "perf list" command shall list the available events from sysfs, e.g.::
66
67 $# perf list | grep dwc_rootport
68 <...>
69 dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/ [Kernel PMU event]
70 <...>
71 dwc_rootport_13018/rx_memory_read,lane=?/ [Kernel PMU event]
72
73 Time Based Analysis Event Usage
74 -------------------------------
75
76 Example usage of counting PCIe RX TLP data payload (Units of bytes)::
77
78 $# perf stat -a -e dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/
79
80 The average RX/TX bandwidth can be calculated using the following formula:
81
82 PCIe RX Bandwidth = rx_pcie_tlp_data_payload / Measure_Time_Window
83 PCIe TX Bandwidth = tx_pcie_tlp_data_payload / Measure_Time_Window
84
85 Lane Event Usage
86 -------------------------------
87
88 Each lane has the same event set and to avoid generating a list of hundreds
89 of events, the user need to specify the lane ID explicitly, e.g.::
90
91 $# perf stat -a -e dwc_rootport_13018/rx_memory_read,lane=4/
92
93 The driver does not support sampling, therefore "perf record" will not
94 work. Per-task (without "-a") perf sessions are not supported.
95

3. 한국어 전문 번역

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

RAS D.E.S PMU counter

1-23

`Synopsys DesignWare Cores (DWC) PCIe Performance Monitoring Unit (PMU)`는 각 PCIe Root Port가 `RAS D.E.S (Debug, Error injection, and Statistics)`라는 Vendor-Specific Extended Capability로 제공하는 PCIe configuration-space register block입니다.

RAS DES capability는 system-level debugging, AER error injection과 statistics collection을 지원합니다. DWC PCIe controller는 statistics를 위해 두 기능을 제공합니다.

기능Counter측정
Time Based Analysis64-bit counter 1개RX/TX data throughput와 low-power LTSSM state 체류 시간
Event CountingEvent별 32-bit counter 1개지정 lane의 error·non-error event

Counter overflow interrupt는 없습니다.

Time-based와 lane event

24-45

Time Based Analysis로 controller의 RX/TX data throughput과 각 low-power LTSSM state 체류 시간을 얻습니다.

Group측정
Group#0Controller가 LTSSM state에 머문 시간의 percentage
Group#1처리한 data 양, 16 bytes 단위

Lane Event counter는 특정 lane의 Error와 Non-Error 정보를 제공합니다. PMU event는 세 요소를 모두 지정해 선택합니다.

선택의미
Group `i`Event group 선택
Event `j`Group `i` 안의 event 선택
Lane `k`측정할 PCIe lane 선택

일부 event는 특정 configuration에서만 존재합니다.

SBDF naming과 sysfs event

46-72

`DesignWare Cores (DWC) PCIe PMU Driver`는 PCIe Root Port의 SBDF를 바탕으로 각 Root Port의 PMU device를 추가합니다. 다음 Root Port 예시의 PMU 이름은 `dwc_rootport_13018`입니다.

0001:30:03.0 PCI bridge: Device 1ded:8000 (rev 01)

Driver는 `/sys/bus/event_source/devices/dwc_rootport_{sbdf}`에 event와 configuration option을 설명하는 perf PMU를 등록합니다.

`format` directory는 `perf_event_attr`의 config field 형식을, `events` directory는 documented event template을 제공합니다. `rx_pcie_tlp_data_payload`는 `eventid=0x21,type=0x0`와 같습니다.

`perf list`로 sysfs의 available event를 나열합니다.

$# perf list | grep dwc_rootport
<...>
dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/        [Kernel PMU event]
<...>
dwc_rootport_13018/rx_memory_read,lane=?/               [Kernel PMU event]

RX/TX bandwidth

73-84

PCIe RX TLP data payload를 bytes 단위로 count하는 예시입니다.

$# perf stat -a -e dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/

Average RX/TX bandwidth 공식은 다음과 같습니다.

PCIe RX Bandwidth = rx_pcie_tlp_data_payload / Measure_Time_Window
PCIe TX Bandwidth = tx_pcie_tlp_data_payload / Measure_Time_Window
Metric공식
PCIe RX Bandwidth`rx_pcie_tlp_data_payload / Measure_Time_Window`
PCIe TX Bandwidth`tx_pcie_tlp_data_payload / Measure_Time_Window`

Lane 지정과 제한

85-94

Lane마다 event set이 같으므로 수백 event를 나열하는 대신 user가 lane ID를 명시합니다.

$# perf stat -a -e dwc_rootport_13018/rx_memory_read,lane=4/

Driver는 sampling을 지원하지 않아 `perf record`가 동작하지 않으며 `-a` 없는 Per-task perf session도 지원하지 않습니다.