brintos

brintos / linux-shallow public Read only

0
0
Text · 2.6 KiB · 9233ea0 Raw
69 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3======================================4CXL Performance Monitoring Unit (CPMU)5======================================6 7The CXL rev 3.0 specification provides a definition of CXL Performance8Monitoring Unit in section 13.2: Performance Monitoring.9 10CXL components (e.g. Root Port, Switch Upstream Port, End Point) may have11any number of CPMU instances. CPMU capabilities are fully discoverable from12the devices. The specification provides event definitions for all CXL protocol13message types and a set of additional events for things commonly counted on14CXL devices (e.g. DRAM events).15 16CPMU driver17===========18 19The CPMU driver registers a perf PMU with the name pmu_mem<X>.<Y> on the CXL bus20representing the Yth CPMU for memX.21 22    /sys/bus/cxl/device/pmu_mem<X>.<Y>23 24The associated PMU is registered as25 26   /sys/bus/event_sources/devices/cxl_pmu_mem<X>.<Y>27 28In common with other CXL bus devices, the id has no specific meaning and the29relationship to specific CXL device should be established via the device parent30of the device on the CXL bus.31 32PMU driver provides description of available events and filter options in sysfs.33 34The "format" directory describes all formats of the config (event vendor id,35group id and mask) config1 (threshold, filter enables) and config2 (filter36parameters) fields of the perf_event_attr structure.  The "events" directory37describes all documented events show in perf list.38 39The events shown in perf list are the most fine grained events with a single40bit of the event mask set. More general events may be enable by setting41multiple mask bits in config. For example, all Device to Host Read Requests42may be captured on a single counter by setting the bits for all of43 44* d2h_req_rdcurr45* d2h_req_rdown46* d2h_req_rdshared47* d2h_req_rdany48* d2h_req_rdownnodata49 50Example of usage::51 52  $#perf list53  cxl_pmu_mem0.0/clock_ticks/                        [Kernel PMU event]54  cxl_pmu_mem0.0/d2h_req_rdshared/                   [Kernel PMU event]55  cxl_pmu_mem0.0/h2d_req_snpcur/                     [Kernel PMU event]56  cxl_pmu_mem0.0/h2d_req_snpdata/                    [Kernel PMU event]57  cxl_pmu_mem0.0/h2d_req_snpinv/                     [Kernel PMU event]58  -----------------------------------------------------------59 60  $# perf stat -a -e cxl_pmu_mem0.0/clock_ticks/ -e cxl_pmu_mem0.0/d2h_req_rdshared/61 62Vendor specific events may also be available and if so can be used via63 64  $# perf stat -a -e cxl_pmu_mem0.0/vid=VID,gid=GID,mask=MASK/65 66The driver does not support sampling so "perf record" is unsupported.67It only supports system-wide counting so attaching to a task is68unsupported.69