perf: Add Arm Network-on-Chip PMU driver
Subsystems (4)
Robin Murphy
maintainerv4 cover perf: Add Arm Network-on-Chip PMU driver
v3: https://lore.kernel.org/linux-arm-kernel/[email protected]/
OK, hopefully these really are the final trivial tweaks :)
Thanks,
Robin.
Robin Murphy (3):
dt-bindings/perf: Add Arm NI-700 PMU
perf: Add driver for Arm NI-700 interconnect PMU
MAINTAINERS: List Arm interconnect PMUs as supported
Documentation/admin-guide/perf/arm-ni.rst | 17 + Documentation/admin-guide/perf/index.rst | 1 + .../devicetree/bindings/perf/arm,ni.yaml | 30 + MAINTAINERS | 11 + drivers/perf/Kconfig | 7 + drivers/perf/Makefile | 1 + drivers/perf/arm-ni.c | 781 ++++++++++++++++++ 7 files changed, 848 insertions(+) create mode 100644 Documentation/admin-guide/perf/arm-ni.rst create mode 100644 Documentation/devicetree/bindings/perf/arm,ni.yaml create mode 100644 drivers/perf/arm-ni.c
Signature · 1 line
2.39.2.101.g768bb238c484.dirty
Robin Murphy
maintainerPATCH v4 1/3 dt-bindings/perf: Add Arm NI-700 PMU
Add an initial binding for the Arm NI-700 interconnect PMU. As with the Arm CMN family, there are already future NI products on the roadmap, so the overall binding is named generically just in case any non-discoverable incompatibility between generations crops up.
---
v4: No change
.../devicetree/bindings/perf/arm,ni.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/perf/arm,ni.yaml
Documentation/devicetree/bindings/perf/arm,ni.yaml new file +30 -0
@@ -0,0 +1,30 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/perf/arm,ni.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Arm NI (Network-on-Chip Interconnect) Performance Monitors + +maintainers: + - Robin Murphy <[email protected]> + +properties: + compatible: + const: arm,ni-700 + + reg: + items: + - description: Complete configuration register space + + interrupts: + minItems: 1 + maxItems: 32 + description: Overflow interrupts, one per clock domain, in order of domain ID + +required: + - compatible + - reg + - interrupts + +additionalProperties: false
Signature · 1 line
2.39.2.101.g768bb238c484.dirty
Robin Murphy
maintainerPATCH v4 2/3 perf: Add driver for Arm NI-700 interconnect PMU
In reply to Robin MurphyThe Arm NI-700 Network-on-Chip Interconnect has a relatively straightforward design with a hierarchy of voltage, power, and clock domains, where each clock domain then contains a number of interface units and a PMU which can monitor events thereon. As such, it begets a relatively straightforward driver to interface those PMUs with perf.
Even more so than with arm-cmn, users will require detailed knowledge of the wider system topology in order to meaningfully analyse anything, since the interconnect itself cannot know what lies beyond the boundary of each inscrutably-numbered interface. Given that, for now they are also expected to refer to the NI-700 documentation for the relevant event IDs to provide as well. An identifier is implemented so we can come back and add jevents if anyone really wants to.
---
v2:
- Add basic usage documentation
- Use __counted_by attribute
- Make group validation logic clearer (and drop PMU type check which perf_event_open() already takes care of)
- Add retry limit to arm_ni_read_ccnt()
v3:
- Fix group leader validation and make the naming clearer
- Drop NUMA_NO_NODE check for CPU online (the only way that could actually pass both other migration conditions is if the NUMA info is so messed up that it's not worth worrying about anyway)
v4:
- Fix documentation typo
- Clean up cpuhp state on probe failure
- Avoid needless cpu_online calls on cpuhp registration
- Improve format attr printing
--- Documentation/admin-guide/perf/arm-ni.rst | 17 + Documentation/admin-guide/perf/index.rst | 1 + drivers/perf/Kconfig | 7 + drivers/perf/Makefile | 1 + drivers/perf/arm-ni.c | 781 ++++++++++++++++++++++ 5 files changed, 807 insertions(+) create mode 100644 Documentation/admin-guide/perf/arm-ni.rst create mode 100644 drivers/perf/arm-ni.c
Documentation/admin-guide/perf/arm-ni.rst new file +17 -0
@@ -0,0 +1,17 @@ +==================================== +Arm Network-on Chip Interconnect PMU +==================================== + +NI-700 and friends implement a distinct PMU for each clock domain within the +interconnect. Correspondingly, the driver exposes multiple PMU devices named +arm_ni_<x>_cd_<y>, where <x> is an (arbitrary) instance identifier and <y> is +the clock domain ID within that particular instance. If multiple NI instances +exist within a system, the PMU devices can be correlated with the underlying +hardware instance via sysfs parentage. + +Each PMU exposes base event aliases for the interface types present in its clock +domain. These require qualifying with the "eventid" and "nodeid" parameters +to specify the event code to count and the interface at which to count it +(per the configured hardware ID as reflected in the xxNI_NODE_INFO register). +The exception is the "cycles" alias for the PMU cycle counter, which is encoded +with the PMU node type and needs no further qualification.
Documentation/admin-guide/perf/index.rst +1 -0
@@ -16,6 +16,7 @@ Performance monitor support starfive_starlink_pmu arm-ccn arm-cmn + arm-ni xgene-pmu arm_dsu_pmu thunderx2-pmu
drivers/perf/Kconfig +7 -0
@@ -48,6 +48,13 @@ config ARM_CMN Support for PMU events monitoring on the Arm CMN-600 Coherent Mesh Network interconnect. +config ARM_NI + tristate "Arm NI-700 PMU support" + depends on ARM64 || COMPILE_TEST + help + Support for PMU events monitoring on the Arm NI-700 Network-on-Chip + interconnect and family. + config ARM_PMU depends on ARM || ARM64 bool "ARM PMU framework"
drivers/perf/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_ARM_CCI_PMU) += arm-cci.o obj-$(CONFIG_ARM_CCN) += arm-ccn.o obj-$(CONFIG_ARM_CMN) += arm-cmn.o obj-$(CONFIG_ARM_DSU_PMU) += arm_dsu_pmu.o +obj-$(CONFIG_ARM_NI) += arm-ni.o obj-$(CONFIG_ARM_PMU) += arm_pmu.o arm_pmu_platform.o obj-$(CONFIG_ARM_PMU_ACPI) += arm_pmu_acpi.o obj-$(CONFIG_ARM_PMUV3) += arm_pmuv3.o
drivers/perf/arm-ni.c new file +781 -0
781 lines not on this page · raw message
Signature · 1 line
2.39.2.101.g768bb238c484.dirty
Robin Murphy
maintainerPATCH v4 3/3 MAINTAINERS: List Arm interconnect PMUs as supported
In reply to Robin MurphyWhatever I may or may not have hoped for, looking after these drivers seems to have firmly stuck as one of the responsibilities of the job Arm pays me for, and I would still like to be aware of any other patches, so make it official.
---
v4: No change
MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
@@ -1737,6 +1737,17 @@ F: drivers/mtd/maps/physmap-versatile.* F: drivers/power/reset/arm-versatile-reboot.c F: drivers/soc/versatile/ +ARM INTERCONNECT PMU DRIVERS +M: Robin Murphy <[email protected]> +S: Supported +F: Documentation/admin-guide/perf/arm-cmn.rst +F: Documentation/admin-guide/perf/arm-ni.rst +F: Documentation/devicetree/bindings/perf/arm,cmn.yaml +F: Documentation/devicetree/bindings/perf/arm,ni.yaml +F: drivers/perf/arm-cmn.c +F: drivers/perf/arm-ni.c +F: tools/perf/pmu-events/arch/arm64/arm/cmn/ + ARM KOMEDA DRM-KMS DRIVER M: Liviu Dudau <[email protected]> S: Supported
Signature · 1 line
2.39.2.101.g768bb238c484.dirty
Quoted 8 lines · Robin Murphy
v3: https://lore.kernel.org/linux-arm-kernel/[email protected]/
OK, hopefully these really are the final trivial tweaks :)
Thanks,
Robin.[...]
Applied to will (for-next/perf), thanks!
[1/3] dt-bindings/perf: Add Arm NI-700 PMU
https://git.kernel.org/will/c/abbe74dd105b [2/3] perf: Add driver for Arm NI-700 interconnect PMU https://git.kernel.org/will/c/4d5a7680f2b4 [3/3] MAINTAINERS: List Arm interconnect PMUs as supported https://git.kernel.org/will/c/91df34ef2d88
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev