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

Linux 6.18.37 · Administration / Performance

ARM Cache Coherent Network

CCN-504 XP·device event encoding, watchpoint comparator와 event 처리 CPU를 설명합니다.

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

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

1. 요약·해설

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

운영 핵심

arm-ccn.rst:1-61

Event 종류에 맞는 node·XP·bus·VC·watchpoint parameter를 지정하고 `cpumask` CPU에서 system-wide로 측정합니다.

관점핵심
FabricCCN-504 ring bus, 11 XPs, XP당 최대 2 device port
Sysfs`/sys/bus/event_source/devices/ccn*`
Encoding`config`, `config1`, `config2`
Watchpoint`event=0xfe`와 comparator mask
CPU`cpumask`의 단일 CPU가 전체 CCN event 처리
LimitsSampling과 per-task session 미지원

2. 영어 원문 전체

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

원문 전체 펼치기
1 ==========================
2 ARM Cache Coherent Network
3 ==========================
4
5 CCN-504 is a ring-bus interconnect consisting of 11 crosspoints
6 (XPs), with each crosspoint supporting up to two device ports,
7 so nodes (devices) 0 and 1 are connected to crosspoint 0,
8 nodes 2 and 3 to crosspoint 1 etc.
9
10 PMU (perf) driver
11 -----------------
12
13 The CCN driver registers a perf PMU driver, which provides
14 description of available events and configuration options
15 in sysfs, see /sys/bus/event_source/devices/ccn*.
16
17 The "format" directory describes format of the config, config1
18 and config2 fields of the perf_event_attr structure. The "events"
19 directory provides configuration templates for all documented
20 events, that can be used with perf tool. For example "xp_valid_flit"
21 is an equivalent of "type=0x8,event=0x4". Other parameters must be
22 explicitly specified.
23
24 For events originating from device, "node" defines its index.
25
26 Crosspoint PMU events require "xp" (index), "bus" (bus number)
27 and "vc" (virtual channel ID).
28
29 Crosspoint watchpoint-based events (special "event" value 0xfe)
30 require "xp" and "vc" as above plus "port" (device port index),
31 "dir" (transmit/receive direction), comparator values ("cmp_l"
32 and "cmp_h") and "mask", being index of the comparator mask.
33
34 Masks are defined separately from the event description
35 (due to limited number of the config values) in the "cmp_mask"
36 directory, with first 8 configurable by user and additional
37 4 hardcoded for the most frequent use cases.
38
39 Cycle counter is described by a "type" value 0xff and does
40 not require any other settings.
41
42 The driver also provides a "cpumask" sysfs attribute, which contains
43 a single CPU ID, of the processor which will be used to handle all
44 the CCN PMU events. It is recommended that the user space tools
45 request the events on this processor (if not, the perf_event->cpu value
46 will be overwritten anyway). In case of this processor being offlined,
47 the events are migrated to another one and the attribute is updated.
48
49 Example of perf tool use::
50
51 / # perf list | grep ccn
52 ccn/cycles/ [Kernel PMU event]
53 <...>
54 ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/ [Kernel PMU event]
55 <...>
56
57 / # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
58 sleep 1
59
60 The driver does not support sampling, therefore "perf record" will
61 not work. Per-task (without "-a") perf sessions are not supported.
62

3. 한국어 전문 번역

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

CCN-504 ring topology

1-9

`ARM Cache Coherent Network`의 CCN-504는 `11 crosspoints (XPs)`로 구성된 ring-bus interconnect이며 각 XP는 최대 두 device port를 지원합니다.

따라서 node(device) 0·1은 crosspoint 0에, node 2·3은 crosspoint 1에 연결되는 방식으로 index가 배치됩니다.

PMU event와 watchpoint encoding

10-40

CCN driver는 사용 가능한 event와 configuration option을 sysfs `/sys/bus/event_source/devices/ccn*`에 설명하는 perf PMU driver를 등록합니다.

`format` directory는 `perf_event_attr` structure의 `config`, `config1`, `config2` field 형식을 설명합니다. `events` directory는 문서화된 event의 perf configuration template을 제공합니다.

Event 종류Parameter의미
Device event`node`Device node index
Crosspoint event`xp`Crosspoint index
Crosspoint event`bus`Bus number
Crosspoint event`vc`Virtual channel ID
Watchpoint `event=0xfe``port`Device port index
Watchpoint `event=0xfe``dir`Transmit/receive direction
Watchpoint `event=0xfe``cmp_l`, `cmp_h`Comparator values
Watchpoint `event=0xfe``mask``cmp_mask` comparator-mask index
Cycle counter`type=0xff`다른 setting 불필요
Event template`xp_valid_flit``type=0x8,event=0x4`와 동일

Device-origin event에는 `node`를 지정합니다. Crosspoint event에는 `xp`, `bus`, `vc`가 필요합니다.

Special `event` 값 `0xfe`인 crosspoint watchpoint는 `xp`, `vc`와 함께 `port`, `dir`, comparator `cmp_l`·`cmp_h`, comparator-mask index인 `mask`가 필요합니다.

Mask는 config value 수가 제한돼 event description과 별도로 `cmp_mask` directory에 정의됩니다. 처음 8개는 user가 구성할 수 있고 추가 4개는 자주 쓰는 use case용으로 hardcoded됩니다.

Cycle counter는 `type=0xff`이며 다른 설정이 필요하지 않습니다.

Event 처리 CPU와 migration

41-48

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

User-space tool은 이 processor에서 event를 요청하는 것이 좋습니다. 다른 CPU를 지정해도 `perf_event->cpu` 값이 덮어써집니다. 해당 processor가 offline되면 event를 다른 CPU로 migrate하고 attribute를 갱신합니다.

Perf 예시와 제한

49-61

`perf list`에서 cycle과 `xp_valid_flit` template을 확인하고 XP·port·virtual channel·direction을 지정해 system-wide count합니다.

/ # perf list | grep ccn
  ccn/cycles/                                        [Kernel PMU event]
<...>
  ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/          [Kernel PMU event]
<...>

/ # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
                                                                       sleep 1

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