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