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

Linux 6.18.37 · Administration / Performance

APM X-Gene SoC PMU

X-Gene system device PMU, event alias와 agent ID filtering을 설명합니다.

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

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

1. 요약·해설

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

운영 요약

xgene-pmu.rst:1-49

장치별 PMU event를 system-wide로 측정하고, 특정 CPU나 I/O bridge의 요청만 분리할 때 `config1` agent mask를 적용합니다.

관점핵심
PMUL3 cache, I/O bridge, memory controller bridge, memory controller
구조각 system device PMU는 독립적
모델ARM core PMU와 느슨하게 같은 구조
공유 자원Top-level interrupt 및 status CSR 영역
Driver`xgene-pmu`가 여러 perf PMU driver를 등록
Filter`config1`의 agent ID bit mask
제한Sampling, `perf record`, `-a` 없는 per-task session 미지원

2. 영어 원문 전체

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

원문 전체 펼치기
1 ================================================
2 APM X-Gene SoC Performance Monitoring Unit (PMU)
3 ================================================
4
5 X-Gene SoC PMU consists of various independent system device PMUs such as
6 L3 cache(s), I/O bridge(s), memory controller bridge(s) and memory
7 controller(s). These PMU devices are loosely architected to follow the
8 same model as the PMU for ARM cores. The PMUs share the same top level
9 interrupt and status CSR region.
10
11 PMU (perf) driver
12 -----------------
13
14 The xgene-pmu driver registers several perf PMU drivers. Each of the perf
15 driver provides description of its available events and configuration options
16 in sysfs, see /sys/bus/event_source/devices/<l3cX/iobX/mcbX/mcX>/.
17
18 The "format" directory describes format of the config (event ID),
19 config1 (agent ID) fields of the perf_event_attr structure. The "events"
20 directory provides configuration templates for all supported event types that
21 can be used with perf tool. For example, "l3c0/bank-fifo-full/" is an
22 equivalent of "l3c0/config=0x0b/".
23
24 Most of the SoC PMU has a specific list of agent ID used for monitoring
25 performance of a specific datapath. For example, agents of a L3 cache can be
26 a specific CPU or an I/O bridge. Each PMU has a set of 2 registers capable of
27 masking the agents from which the request come from. If the bit with
28 the bit number corresponding to the agent is set, the event is counted only if
29 it is caused by a request from that agent. Each agent ID bit is inversely mapped
30 to a corresponding bit in "config1" field. By default, the event will be
31 counted for all agent requests (config1 = 0x0). For all the supported agents of
32 each PMU, please refer to APM X-Gene User Manual.
33
34 Each perf driver also provides a "cpumask" sysfs attribute, which contains a
35 single CPU ID of the processor which will be used to handle all the PMU events.
36
37 Example for perf tool use::
38
39 / # perf list | grep -e l3c -e iob -e mcb -e mc
40 l3c0/ackq-full/ [Kernel PMU event]
41 <...>
42 mcb1/mcb-csw-stall/ [Kernel PMU event]
43
44 / # perf stat -a -e l3c0/read-miss/,mcb1/csw-write-request/ sleep 1
45
46 / # perf stat -a -e l3c0/read-miss,config1=0xfffffffffffffffe/ sleep 1
47
48 The driver does not support sampling, therefore "perf record" will
49 not work. Per-task (without "-a") perf sessions are not supported.
50

3. 한국어 전문 번역

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

독립 system device PMU

1-9

X-Gene SoC PMU는 L3 cache, I/O bridge, memory controller bridge, memory controller의 여러 독립 system device PMU로 구성됩니다.

이 PMU들은 ARM core PMU와 느슨하게 같은 모델을 따르며, top-level interrupt와 status CSR 영역을 공유합니다.

장치 종류Sysfs 이름
L3 cache`l3cX`
I/O bridge`iobX`
Memory controller bridge`mcbX`
Memory controller`mcX`
공통 sysfs`/sys/bus/event_source/devices/<l3cX/iobX/mcbX/mcX>/`

X-Gene perf driver와 event alias

10-22

`xgene-pmu` driver는 여러 perf PMU driver를 등록합니다. 각 driver는 `/sys/bus/event_source/devices/<l3cX/iobX/mcbX/mcX>/` 아래에서 event와 설정 option을 설명합니다.

`format` directory는 `perf_event_attr` 구조체의 `config`(event ID)와 `config1`(agent ID) field 형식을 설명합니다. `events` directory는 perf가 사용할 수 있는 모든 지원 event type의 template을 제공합니다.

예를 들어 alias `l3c0/bank-fifo-full/`은 raw 설정 `l3c0/config=0x0b/`과 같습니다.

Sysfs 항목의미
`format``config` event ID와 `config1` agent ID의 배치
`events`Perf가 사용할 수 있는 지원 event template
Alias`l3c0/bank-fifo-full/` = `l3c0/config=0x0b/`
`cpumask`모든 PMU event를 처리하는 단일 CPU ID

Agent ID 요청 filter

23-35

대부분의 SoC PMU에는 특정 datapath의 성능을 감시하기 위한 agent ID 목록이 있습니다. 예를 들어 L3 cache의 agent는 특정 CPU나 I/O bridge일 수 있습니다.

각 PMU에는 요청을 보낸 agent를 mask하는 register 두 개가 있습니다. Agent에 해당하는 bit를 설정하면 그 agent의 요청이 일으킨 event만 셉니다.

각 agent ID bit는 `config1`의 대응 bit에 반대로 매핑됩니다. 기본 `config1 = 0x0`에서는 모든 agent 요청을 셉니다. PMU별 지원 agent는 APM X-Gene User Manual을 참조해야 합니다.

각 perf driver의 `cpumask` sysfs attribute에는 모든 PMU event를 처리할 processor의 단일 CPU ID가 들어 있습니다.

항목동작
Agent특정 CPU 또는 I/O bridge처럼 datapath 요청을 만든 주체
Mask registerPMU마다 agent 요청을 거를 수 있는 register 2개
Set bit해당 agent가 만든 요청일 때만 event를 count
기본값`config1 = 0x0`, 모든 agent 요청을 count

Perf discovery, 측정과 제한

36-49

첫 명령은 L3C, IOB, MCB, MC event alias를 검색합니다. 출력 예시는 `l3c0/ackq-full/`에서 `mcb1/mcb-csw-stall/`까지 일부를 생략해 보여 줍니다.

/ # perf list | grep -e l3c -e iob -e mcb -e mc
  l3c0/ackq-full/                                    [Kernel PMU event]
<...>
  mcb1/mcb-csw-stall/                                [Kernel PMU event]

다음 명령은 L3 read miss와 MCB cross-switch write request를 system-wide로 함께 측정합니다.

/ # perf stat -a -e l3c0/read-miss/,mcb1/csw-write-request/ sleep 1

마지막 명령은 `config1=0xfffffffffffffffe`로 agent filter를 지정해 L3 read miss를 측정합니다.

/ # perf stat -a -e l3c0/read-miss,config1=0xfffffffffffffffe/ sleep 1

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