0001 ==========================
0002 ARM Cache Coherent Network
0003 ==========================
0004
0005 CCN-504 is a ring-bus interconnect consisting of 11 crosspoints
0006 (XPs), with each crosspoint supporting up to two device ports,
0007 so nodes (devices) 0 and 1 are connected to crosspoint 0,
0008 nodes 2 and 3 to crosspoint 1 etc.
0009
0010 PMU (perf) driver
0011 -----------------
0012
0013 The CCN driver registers a perf PMU driver, which provides
0014 description of available events and configuration options
0015 in sysfs, see /sys/bus/event_source/devices/ccn*.
0016
0017 The "format" directory describes format of the config, config1
0018 and config2 fields of the perf_event_attr structure. The "events"
0019 directory provides configuration templates for all documented
0020 events, that can be used with perf tool. For example "xp_valid_flit"
0021 is an equivalent of "type=0x8,event=0x4". Other parameters must be
0022 explicitly specified.
0023
0024 For events originating from device, "node" defines its index.
0025
0026 Crosspoint PMU events require "xp" (index), "bus" (bus number)
0027 and "vc" (virtual channel ID).
0028
0029 Crosspoint watchpoint-based events (special "event" value 0xfe)
0030 require "xp" and "vc" as above plus "port" (device port index),
0031 "dir" (transmit/receive direction), comparator values ("cmp_l"
0032 and "cmp_h") and "mask", being index of the comparator mask.
0033
0034 Masks are defined separately from the event description
0035 (due to limited number of the config values) in the "cmp_mask"
0036 directory, with first 8 configurable by user and additional
0037 4 hardcoded for the most frequent use cases.
0038
0039 Cycle counter is described by a "type" value 0xff and does
0040 not require any other settings.
0041
0042 The driver also provides a "cpumask" sysfs attribute, which contains
0043 a single CPU ID, of the processor which will be used to handle all
0044 the CCN PMU events. It is recommended that the user space tools
0045 request the events on this processor (if not, the perf_event->cpu value
0046 will be overwritten anyway). In case of this processor being offlined,
0047 the events are migrated to another one and the attribute is updated.
0048
0049 Example of perf tool use::
0050
0051 / # perf list | grep ccn
0052 ccn/cycles/ [Kernel PMU event]
0053 <...>
0054 ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/ [Kernel PMU event]
0055 <...>
0056
0057 / # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
0058 sleep 1
0059
0060 The driver does not support sampling, therefore "perf record" will
0061 not work. Per-task (without "-a") perf sessions are not supported.