ARC: Add perf support for ARC700 cores
Subsystems (3)
v3 cover ARC: Add perf support for ARC700 cores
Hi all,
Please find v3 of my attempt to add support for perf for ARC700 PMU's. If possible, it would be nice to get some feedback on the implementation from non-ARC/Synopsys people familiar with the perf subsystem in Linux.
Thanks,
Mischa
v3:
split devicetree binding doc into separate patch updated devicetree binding doc according to review comments
v2:
updated comments to kernel coding standards renamed devicetree binding to snps,arc700-pmu added devicetree binding doc
Mischa Jonker (2):
ARC: Add perf support for ARC700 cores
ARC: Add documentation on DT binding for ARC700 PMU
Documentation/devicetree/bindings/arc/pmu.txt | 24 ++ 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, 554 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arc/pmu.txt create mode 100644 arch/arc/kernel/perf_event.c
Signature · 1 line
1.7.9.5
PATCH v3 1/2 ARC: Add perf support for ARC700 cores
This adds basic perf support for ARC700 cores. Most PERF_COUNT_HW* events are supported now.
--- 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 +++++++++++++++++++++++++++++++++++++ 4 files changed, 530 insertions(+), 1 deletion(-) create mode 100644 arch/arc/kernel/perf_event.c
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 · 1 line
1.7.9.5
Quoted 2 lines · Mischa Jonker
This adds basic perf support for ARC700 cores. Most PERF_COUNT_HW* events are supported now.
I don't see anything particularly weird, but then I don't know/have the hardware so I suppose you know what you're doing :-)
Quoted 7 lines · Peter Zijlstra
Quoted 2 lines · Mischa Jonker
This adds basic perf support for ARC700 cores. Most PERF_COUNT_HW* events are supported now.
I don't see anything particularly weird, but then I don't know/have the hardware so I suppose you know what you're doing :-)
Acked-by Peter Zijlstra <[email protected]>
Thanks Peter.
This is now queued for next batch for arc 3.13-rc1 changes since we've been using this internally for quite some time now.
-Vineet
PATCH v3 2/2 ARC: Add documentation on DT binding for ARC700 PMU
In reply to Mischa Jonker--- Documentation/devicetree/bindings/arc/pmu.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/arc/pmu.txt
Documentation/devicetree/bindings/arc/pmu.txt new file +24 -0
@@ -0,0 +1,24 @@ +* 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. + +Note that: + * ARC 700 refers to a family of ARC processor cores; + - There is only one type of PMU available for the whole family; + - The PMU may support different sets of events; supported events are probed + at boot time, as required by the reference manual. + + * The ARC 700 PMU does not support interrupts; although HW events may be + counted, the HW events themselves cannot serve as a trigger for a sample. + +Required properties: + +- compatible : should contain + "snps,arc700-pmu" + +Example: + +pmu { + compatible = "snps,arc700-pmu"; +};
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
Peter Zijlstra
maintainerQuoted 5 lines · Mischa Jonker
Hi all,
Please find v3 of my attempt to add support for perf for ARC700 PMU's. If possible, it would be nice to get some feedback on the implementation from non-ARC/Synopsys people familiar with the perf subsystem in Linux.
Anything in particular you wanted feedback on? It looks like a fairly straight fwd thingy.
Peter Zijlstra
maintainerQuoted 9 lines · Peter Zijlstra
Quoted 5 lines · Mischa Jonker
Hi all,
Please find v3 of my attempt to add support for perf for ARC700 PMU's. If possible, it would be nice to get some feedback on the implementation from non-ARC/Synopsys people familiar with the perf subsystem in Linux.
Anything in particular you wanted feedback on? It looks like a fairly straight fwd thingy.
Ah, so its one of those that cannot sample; you might want to fail when we try and create a sampling event.
Also, you could consider running an (hr)timer to periodically update the events so that you don't miss a hardware counter wrap around -- if that is a distinct possibility.
Quoted 2 lines
Ah, so its one of those that cannot sample; you might want to fail when we try and create a sampling event.
Good suggestion, I'll create a separate patch for that!
Quoted 3 lines
Also, you could consider running an (hr)timer to periodically update the events so that you don't miss a hardware counter wrap around -- if that is a distinct possibility.
It's a theoretical possibility: the counters are 48 bits. Unlikely to happen during application development/performance analysis on an embedded core.
Thanks,
Mischa
Hi Peter,
Quoted 7 lines
Quoted 3 lines
Please find v3 of my attempt to add support for perf for ARC700 PMU's. If possible, it would be nice to get some feedback on the implementation from non-ARC/Synopsys people familiar with the perf
subsystem in Linux.
Anything in particular you wanted feedback on? It looks like a fairly straight fwd thingy.
This may just be my lack of experience with kernel etiquette; the patch works OK for us, but it would be a bit strange if Vineet would just apply it without any discussion on the mailing list. So thanks for having taken the time to look at it!
Mischa