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