xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/perf/qcom_l2_pmu.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun=====================================================================
2*4882a593SmuzhiyunQualcomm Technologies Level-2 Cache Performance Monitoring Unit (PMU)
3*4882a593Smuzhiyun=====================================================================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunThis driver supports the L2 cache clusters found in Qualcomm Technologies
6*4882a593SmuzhiyunCentriq SoCs. There are multiple physical L2 cache clusters, each with their
7*4882a593Smuzhiyunown PMU. Each cluster has one or more CPUs associated with it.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThere is one logical L2 PMU exposed, which aggregates the results from
10*4882a593Smuzhiyunthe physical PMUs.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunThe driver provides a description of its available events and configuration
13*4882a593Smuzhiyunoptions in sysfs, see /sys/devices/l2cache_0.
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunThe "format" directory describes the format of the events.
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunEvents can be envisioned as a 2-dimensional array. Each column represents
18*4882a593Smuzhiyuna group of events. There are 8 groups. Only one entry from each
19*4882a593Smuzhiyungroup can be in use at a time. If multiple events from the same group
20*4882a593Smuzhiyunare specified, the conflicting events cannot be counted at the same time.
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunEvents are specified as 0xCCG, where CC is 2 hex digits specifying
23*4882a593Smuzhiyunthe code (array row) and G specifies the group (column) 0-7.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunIn addition there is a cycle counter event specified by the value 0xFE
26*4882a593Smuzhiyunwhich is outside the above scheme.
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunThe driver provides a "cpumask" sysfs attribute which contains a mask
29*4882a593Smuzhiyunconsisting of one CPU per cluster which will be used to handle all the PMU
30*4882a593Smuzhiyunevents on that cluster.
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunExamples for use with perf::
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun  perf stat -e l2cache_0/config=0x001/,l2cache_0/config=0x042/ -a sleep 1
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun  perf stat -e l2cache_0/config=0xfe/ -C 2 sleep 1
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunThe driver does not support sampling, therefore "perf record" will
39*4882a593Smuzhiyunnot work. Per-task perf sessions are not supported.
40