On 5 April 2018 at 10:21, Kim Phillips kim.phillips@arm.com wrote:
On Thu, 5 Apr 2018 04:48:26 +0100 Wookey wookey@wookware.org wrote:
What version of linux should I expect to contain a version of perf that knows about libopencsd?
It looks like commit aa6292f4845e7 "perf tools: Integrating the CoreSight decoding library" went into 4.16, judging by git tag --contains output.
Debian is currently at 4.15.11. Is that new enough? It contains a tools/perf/arch/arm/util/cs-etm.c and tools/include/linux/coresight-pmu.h
but if I build perf (with make VF=1 -C tools/perf ) then Auto-detecting system features: does not mention libopencsd.
but then make it doesn't try on x86?
s/make/maybe/? No, it should. Perf is designed such that perf *record* code that gets built is platform-specific, i.e., if the target is x86, include the code to record from Intel PMUs such as BTS and PT (Processor Trace, their Coresight equivalent).
However, perf *report* code (i.e., including any arch-specific decoder libraries), gets built on all arches. So whilst we can decode Arm SPE, Coresight on x86, the x86 guys can also decode a perf.data file with intel-pt (processor-trace) on an Arm based machine.
Anyway, to answer your question, you'd need a 4.16 based kernel tree to get the perf that does things libopencsd.
some clue about whether to expect this to work with 4.15.11, or if I need a newer mainline, or if that is not sufficient, and I still need the perf-opencsd-master mentioned in the HOWTO would be useful. Or perhaps https://github.com/Linaro/perf-opencsd is the place to go?
Also how does the enabling machinery work?
You definitely need a 4.16 mainline kernel - prior to that there was no support for CS trace decoding. With a 4.16 kernel simply install the libopencsd package and recompile the perf tools with option VF=1. I have tested this on my side yesterday and things should just work. Let me know if it is not the case.
As for "Documentation/trace/coresight.txt", 4.16 is a little weird as the Perf tools maintainer unexpectedly picked up patches that were destined for my tree. To avoid a merge conflict at higher levels I held back on a documentation patch that would detail the perf integration. I will submit those in the 4.17 cycle.
IIRC the github/Linaro trees were updated, but they're not on my radar. Upstream Documentation/trace/coresight.txt doesn't specify how to explicitly enable. Perhaps this is a catch-22 situation?
In any case, 4.15 is too old.
I can't enable this in debian until a) its in the debian mainline kernel packages and b) libopencsd is uploaded, but I can mess with it locally and get bugs filed to make it work in due course.
OK, yes, Coresight decoding went in v4.16.
BTW, is this debian decoder library package going to be available for both x86 and Arm debians? I'd like to be able to do both perf record and report on the Arm target, if at all possible.
Kim _______________________________________________ CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight