docs: perf: Add description for StarFive's StarLink PMU
authorJi Sheng Teoh <jisheng.teoh@starfivetech.com>
Thu, 29 Feb 2024 07:27:19 +0000 (15:27 +0800)
committerWill Deacon <will@kernel.org>
Mon, 4 Mar 2024 14:19:48 +0000 (14:19 +0000)
StarFive StarLink PMU support monitoring L3 memory system PMU events.
Add documentation to describe StarFive StarLink PMU support and it's
usage.

Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
Link: https://lore.kernel.org/r/20240229072720.3987876-4-jisheng.teoh@starfivetech.com
Signed-off-by: Will Deacon <will@kernel.org>
Documentation/admin-guide/perf/index.rst
Documentation/admin-guide/perf/starfive_starlink_pmu.rst [new file with mode: 0644]

index f4a4513c526f05abef622ccc654a532008d9b5f7..7eb3dcd6f4da6776c14b230d67b6be6609817a02 100644 (file)
@@ -13,6 +13,7 @@ Performance monitor support
    imx-ddr
    qcom_l2_pmu
    qcom_l3_pmu
+   starfive_starlink_pmu
    arm-ccn
    arm-cmn
    xgene-pmu
diff --git a/Documentation/admin-guide/perf/starfive_starlink_pmu.rst b/Documentation/admin-guide/perf/starfive_starlink_pmu.rst
new file mode 100644 (file)
index 0000000..2932ddb
--- /dev/null
@@ -0,0 +1,46 @@
+================================================
+StarFive StarLink Performance Monitor Unit (PMU)
+================================================
+
+StarFive StarLink Performance Monitor Unit (PMU) exists within the
+StarLink Coherent Network on Chip (CNoC) that connects multiple CPU
+clusters with an L3 memory system.
+
+The uncore PMU supports overflow interrupt, up to 16 programmable 64bit
+event counters, and an independent 64bit cycle counter.
+The PMU can only be accessed via Memory Mapped I/O and are common to the
+cores connected to the same PMU.
+
+Driver exposes supported PMU events in sysfs "events" directory under::
+
+  /sys/bus/event_source/devices/starfive_starlink_pmu/events/
+
+Driver exposes cpu used to handle PMU events in sysfs "cpumask" directory
+under::
+
+  /sys/bus/event_source/devices/starfive_starlink_pmu/cpumask/
+
+Driver describes the format of config (event ID) in sysfs "format" directory
+under::
+
+  /sys/bus/event_source/devices/starfive_starlink_pmu/format/
+
+Example of perf usage::
+
+       $ perf list
+
+       starfive_starlink_pmu/cycles/                      [Kernel PMU event]
+       starfive_starlink_pmu/read_hit/                    [Kernel PMU event]
+       starfive_starlink_pmu/read_miss/                   [Kernel PMU event]
+       starfive_starlink_pmu/read_request/                [Kernel PMU event]
+       starfive_starlink_pmu/release_request/             [Kernel PMU event]
+       starfive_starlink_pmu/write_hit/                   [Kernel PMU event]
+       starfive_starlink_pmu/write_miss/                  [Kernel PMU event]
+       starfive_starlink_pmu/write_request/               [Kernel PMU event]
+       starfive_starlink_pmu/writeback/                   [Kernel PMU event]
+
+
+       $ perf stat -a -e /starfive_starlink_pmu/cycles/ sleep 1
+
+Sampling is not supported. As a result, "perf record" is not supported.
+Attaching to a task is not supported, only system-wide counting is supported.