ARC: Add perf support for ARC700 cores
Subsystems (3)
PATCH v2 1/1 ARC: Add perf support for ARC700 cores
This adds basic perf support for ARC700 cores. Most PERF_COUNT_HW* events are supported now.
---
v2:
updated comments to kernel coding standards renamed devicetree binding to snps,arc700-pmu added devicetree binding doc
Documentation/devicetree/bindings/arc/pmu.txt | 15 ++ arch/arc/boot/dts/angel4.dts | 4 + arch/arc/include/asm/perf_event.h | 204 +++++++++++++++- arch/arc/kernel/Makefile | 1 + arch/arc/kernel/perf_event.c | 322 +++++++++++++++++++++++++ 5 files changed, 545 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arc/pmu.txt create mode 100644 arch/arc/kernel/perf_event.c
Documentation/devicetree/bindings/arc/pmu.txt new file +15 -0
@@ -0,0 +1,15 @@ +* ARC Performance Monitor Unit + +The ARC 700 can be configured with a pipeline performance monitor for counting +CPU and cache events like cache misses and hits. + +Required properties: + +- compatible : should be + "snps,arc700-pmu" + +Example: + +pmu { + compatible = "snps,arc700-pmu"; +};
arch/arc/boot/dts/angel4.dts +4 -0
@@ -67,5 +67,9 @@ reg = <1>; }; }; + + arcpmu0: pmu { + compatible = "snps,arc700-pmu"; + }; }; };
arch/arc/include/asm/perf_event.h +203 -1
212 lines not on this page · raw message
arch/arc/kernel/Makefile +1 -0
@@ -19,6 +19,7 @@ obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_ARC_MISALIGN_ACCESS) += unaligned.o obj-$(CONFIG_KGDB) += kgdb.o obj-$(CONFIG_ARC_METAWARE_HLINK) += arc_hostlink.o +obj-$(CONFIG_PERF_EVENTS) += perf_event.o obj-$(CONFIG_ARC_FPU_SAVE_RESTORE) += fpu.o CFLAGS_fpu.o += -mdpfp
arch/arc/kernel/perf_event.c new file +322 -0
322 lines not on this page · raw message
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Mark Rutland
reviewerQuoted 13 lines · Mischa Jonker
This adds basic perf support for ARC700 cores. Most PERF_COUNT_HW* events are supported now.
Signed-off-by Mischa Jonker <[email protected]>Cc Vineet Gupta <[email protected]>Cc Ingo Molnar <[email protected]>Cc Peter Zijlstra <[email protected]>---
v2:
updated comments to kernel coding standards renamed devicetree binding to snps,arc700-pmu added devicetree binding doc
Quoted 8 lines
Documentation/devicetree/bindings/arc/pmu.txt | 15 ++ arch/arc/boot/dts/angel4.dts | 4 + arch/arc/include/asm/perf_event.h | 204 +++++++++++++++- arch/arc/kernel/Makefile | 1 + arch/arc/kernel/perf_event.c | 322 +++++++++++++++++++++++++ 5 files changed, 545 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arc/pmu.txt create mode 100644 arch/arc/kernel/perf_event.c
As a general note, for our own selfish reasons the device tree maintainers would prefer that binding document changes were in a separate patch from any code (though the whole series can be Cc'd to [email protected], it's oftern useful context). It makes it far easier to find the information relevant to us, manage review and so on.
Quoted 7 lines
Documentation/devicetree/bindings/arc/pmu.txt new file +0
-0
Documentation/devicetree/bindings/arc/pmu.txt line 9
Quoted 9 lines
Documentation/devicetree/bindings/arc/pmu.txt new file +9
-0@@ -0,0 +1,15 @@ +* ARC Performance Monitor Unit + +The ARC 700 can be configured with a pipeline performance monitor for counting +CPU and cache events like cache misses and hits. + +Required properties: + +- compatible : should be + "snps,arc700-pmu"
s/should be/should contain/ -- there might be a future variant that's compatible with the software-visible interface.
Is that ARC 700 a family or a specific implementation? If it's a family it may make sense to define the strings you expect for particular implementations, while still expecting "snps,arc700-pmu" to be in the compatible string list.
Are there any interrupts? Most PMUs I've seen have an interrupt for overflow/saturation.
Documentation/devicetree/bindings/arc/pmu.txt line 15
Quoted 6 lines
Documentation/devicetree/bindings/arc/pmu.txt new file +6
-0+ +Example: + +pmu { + compatible = "snps,arc700-pmu"; +};
Regardless, given it's so simple and can be extended easily in future, this looks fine to me. With the minor change to the compatible description:
Acked-by Mark Rutland <[email protected]>
Thanks,
Mark.