Skip to contentSkip to conversation

drivers: perf: Add LLC-TAD perf counter support

PATCH Superseded Bhaskara Budiredla 1 participant 1 message May 28, 2021

Subsystems (2)

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: perf: Add LLC-TAD perf counter support

This driver adds support for Last-level cache tag-and-data unit (LLC-TAD) PMU that is featured in some of the Marvell's CN10K infrastructure silicons.

The LLC is divided into 48 slices distributed across 24 Mesh tiles in a single-socket configuration. The driver always configures the same counter for all of the TADs. The user would end up effectively reserving one of eight counters in every TAD to look across all TADs. The occurrences of events are aggregated and presented to the user at the end of an application run. The driver does not provide a way for the user to partition TADs so that different TADs are used for different applications.

The event counters are zeroed to start event counting to avoid any rollover issues. TAD perf counters are 64-bit, so it's not currently possible to overflow event counters at current mesh and core frequencies.

Each supported counter's event and formatting information is exposed to sysfs at /sys/devices/tad/. Use perf tool stat command to measure the pmu events. For instance:

perf stat -e dat_msh_in_dss,req_msh_out_any ls -al perf stat -e alloc_any,hit_any,tag_rd ls -al

---
 .../bindings/perf/marvell-cn10k-tad-pmu.txt   |  20 +
 drivers/perf/Kconfig                          |   7 +
 drivers/perf/Makefile                         |   1 +
 drivers/perf/marvell_cn10k_tad_pmu.c          | 428 ++++++++++++++++++
 4 files changed, 456 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/perf/marvell-cn10k-tad-pmu.txt
 create mode 100644 drivers/perf/marvell_cn10k_tad_pmu.c
Documentation/devicetree/bindings/perf/marvell-cn10k-tad-pmu.txt new file +20 -0
new file mode 100644
index 000000000000..8b1f753303e2
@@ -0,0 +1,20 @@
+* Marvell CN10K LLC-TAD performace monitor unit
+
+Required properties:
+- compatible: must be:
+	"marvell,cn10k-tad-pmu"
+- tad-cnt: number of tad pmu regions
+- tad-page-size: size of entire tad block
+- tad-pmu-page-size: size of one tad pmu region
+- reg: physical address and size
+
+Example:
+
+/* Actual values updated by firmware at boot time */
+tad_pmu {
+	compatible = "marvell,cn10k-tad-pmu";
+	tad-cnt = <1>;
+	tad-page-size = <0x1000>;
+	tad-pmu-page-size = <0x1000>;
+	reg = <0x87e2 0x80000000 0x0 0x1000>;
+};
drivers/perf/Kconfig +7 -0
index 77522e5efe11..73dca11f8080 100644
@@ -137,6 +137,13 @@ config ARM_DMC620_PMU
 	  Support for PMU events monitoring on the ARM DMC-620 memory
 	  controller.
 
+config MARVELL_CN10K_TAD_PMU
+	tristate "Marvell CN10K LLC-TAD PMU"
+	depends on ARM64
+	help
+	  Provides support for Last-Level cache Tag-and-data Units (LLC-TAD)
+	  performance monitors on CN10K family silicons.
+
 source "drivers/perf/hisilicon/Kconfig"
 
 endmenu
drivers/perf/Makefile +1 -0
index 5260b116c7da..2db5418d5b0a 100644
@@ -14,3 +14,4 @@ obj-$(CONFIG_THUNDERX2_PMU) += thunderx2_pmu.o
 obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o
 obj-$(CONFIG_ARM_SPE_PMU) += arm_spe_pmu.o
 obj-$(CONFIG_ARM_DMC620_PMU) += arm_dmc620_pmu.o
+obj-$(CONFIG_MARVELL_CN10K_TAD_PMU) += marvell_cn10k_tad_pmu.o
drivers/perf/marvell_cn10k_tad_pmu.c new file +428 -0

428 lines not on this page · raw message

Signature · 1 line
2.17.1