xref: /linux/Documentation/admin-guide/perf/arm-ccn.rst (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
159809fe8SMauro Carvalho Chehab==========================
259809fe8SMauro Carvalho ChehabARM Cache Coherent Network
359809fe8SMauro Carvalho Chehab==========================
459809fe8SMauro Carvalho Chehab
559809fe8SMauro Carvalho ChehabCCN-504 is a ring-bus interconnect consisting of 11 crosspoints
659809fe8SMauro Carvalho Chehab(XPs), with each crosspoint supporting up to two device ports,
759809fe8SMauro Carvalho Chehabso nodes (devices) 0 and 1 are connected to crosspoint 0,
859809fe8SMauro Carvalho Chehabnodes 2 and 3 to crosspoint 1 etc.
959809fe8SMauro Carvalho Chehab
1059809fe8SMauro Carvalho ChehabPMU (perf) driver
1159809fe8SMauro Carvalho Chehab-----------------
1259809fe8SMauro Carvalho Chehab
1359809fe8SMauro Carvalho ChehabThe CCN driver registers a perf PMU driver, which provides
1459809fe8SMauro Carvalho Chehabdescription of available events and configuration options
1559809fe8SMauro Carvalho Chehabin sysfs, see /sys/bus/event_source/devices/ccn*.
1659809fe8SMauro Carvalho Chehab
1759809fe8SMauro Carvalho ChehabThe "format" directory describes format of the config, config1
1859809fe8SMauro Carvalho Chehaband config2 fields of the perf_event_attr structure. The "events"
1959809fe8SMauro Carvalho Chehabdirectory provides configuration templates for all documented
2059809fe8SMauro Carvalho Chehabevents, that can be used with perf tool. For example "xp_valid_flit"
2159809fe8SMauro Carvalho Chehabis an equivalent of "type=0x8,event=0x4". Other parameters must be
2259809fe8SMauro Carvalho Chehabexplicitly specified.
2359809fe8SMauro Carvalho Chehab
2459809fe8SMauro Carvalho ChehabFor events originating from device, "node" defines its index.
2559809fe8SMauro Carvalho Chehab
2659809fe8SMauro Carvalho ChehabCrosspoint PMU events require "xp" (index), "bus" (bus number)
2759809fe8SMauro Carvalho Chehaband "vc" (virtual channel ID).
2859809fe8SMauro Carvalho Chehab
2959809fe8SMauro Carvalho ChehabCrosspoint watchpoint-based events (special "event" value 0xfe)
30*251c99bbSRandy Dunlaprequire "xp" and "vc" as above plus "port" (device port index),
3159809fe8SMauro Carvalho Chehab"dir" (transmit/receive direction), comparator values ("cmp_l"
3259809fe8SMauro Carvalho Chehaband "cmp_h") and "mask", being index of the comparator mask.
3359809fe8SMauro Carvalho Chehab
3459809fe8SMauro Carvalho ChehabMasks are defined separately from the event description
3559809fe8SMauro Carvalho Chehab(due to limited number of the config values) in the "cmp_mask"
3659809fe8SMauro Carvalho Chehabdirectory, with first 8 configurable by user and additional
3759809fe8SMauro Carvalho Chehab4 hardcoded for the most frequent use cases.
3859809fe8SMauro Carvalho Chehab
3959809fe8SMauro Carvalho ChehabCycle counter is described by a "type" value 0xff and does
4059809fe8SMauro Carvalho Chehabnot require any other settings.
4159809fe8SMauro Carvalho Chehab
4259809fe8SMauro Carvalho ChehabThe driver also provides a "cpumask" sysfs attribute, which contains
4359809fe8SMauro Carvalho Chehaba single CPU ID, of the processor which will be used to handle all
4459809fe8SMauro Carvalho Chehabthe CCN PMU events. It is recommended that the user space tools
4559809fe8SMauro Carvalho Chehabrequest the events on this processor (if not, the perf_event->cpu value
4659809fe8SMauro Carvalho Chehabwill be overwritten anyway). In case of this processor being offlined,
4759809fe8SMauro Carvalho Chehabthe events are migrated to another one and the attribute is updated.
4859809fe8SMauro Carvalho Chehab
4959809fe8SMauro Carvalho ChehabExample of perf tool use::
5059809fe8SMauro Carvalho Chehab
5159809fe8SMauro Carvalho Chehab  / # perf list | grep ccn
5259809fe8SMauro Carvalho Chehab    ccn/cycles/                                        [Kernel PMU event]
5359809fe8SMauro Carvalho Chehab  <...>
5459809fe8SMauro Carvalho Chehab    ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/          [Kernel PMU event]
5559809fe8SMauro Carvalho Chehab  <...>
5659809fe8SMauro Carvalho Chehab
5759809fe8SMauro Carvalho Chehab  / # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
5859809fe8SMauro Carvalho Chehab                                                                         sleep 1
5959809fe8SMauro Carvalho Chehab
6059809fe8SMauro Carvalho ChehabThe driver does not support sampling, therefore "perf record" will
6159809fe8SMauro Carvalho Chehabnot work. Per-task (without "-a") perf sessions are not supported.
62