On Wed, 4 Oct 2017 14:50:50 -0600 Mathieu Poirier mathieu.poirier@linaro.org wrote:
On 22 September 2017 at 03:03, Tor Jeremiassen tor@ti.com wrote:
Hi,
This patchset adds support for user space decoding of CoreSight traces [1] of the ARM architecture. Kernel support for configuring CoreSight tracers and collect the hardware trace data in the auxtrace section of the perf.data file is already integrated [2]. The user space implementation mirrors to a large degree that of the Intel Processor Trace (PT) [3] implementation, except that the decoder library itself is separate from the perf tool sources, and is built and maintained as a separate open source project [4]. Instead, this patch set includes the necessary code and build settings to interfaces to the decoder library. This approach was chosen as the decoder library has uses outside the perf toolset and on non-linux platforms.
The decoder library interface code in this patch set only supports ETMv4 trace decoding, though the library itself supports a broader range. Future patches will add support for more versions of the ARM ETM trace encoding. The trace decoder library used with this patch set is the most recent version with tag v0.7.3
This patch set, instead of being based on commits in my private branch, has been applied to a new copy of the perf-opencsd-master branch of [4] and pushed to [5] with the same perf-opencsd-master branch name.
Changes since last revision:
Given this is the second time it is sent out to the new audience on coresight@lists.linaro.org, I am resetting the version number to 2 to avoid confusion with previous mailings with a more restricted audience.
Two additional commits have been added to the patches in this patch set to be fully compatible with the most recent version of the decoder library. The previous patch set assumed an older version.
[1] https://lwn.net/Articles/626463 [2] https://github.com/torvalds/linux/tree/master/drivers/hwtracing/coresight [3] https://lwn.net/Articles/648154 [4] https://github.com/Linaro/OpenCSD [5] https://github.com/tor-jeremiassen/OpenCSD
Tor Jeremiassen (23): perf tools: Add initial hooks for decoding coresight traces perf tools: Add processing of coresight metadata perf tools: Add coresight trace decoder library interface perf tools: Add data block processing function perf tools: Add channel context item to track packet sources perf tools: Add etmv4i packet printing capability perf tools: Add decoder new and free perf tools: Add trace packet print for dump_trace option perf tools: Add code to process the auxtrace perf event perf tools: Add function to read data from dsos perf tools: Add mapping from cpu to cs_etm_queue perf tools: Add functions to allocate and free queues perf tools: Add functions to setup and initialize queues perf tools: Add functions to allocate and free queues perf tools: Add function to get trace data from aux buffer perf tools: Add function to run the trace decoder and process samples perf tools: Add functions to process queues and run the trace decoder perf tools: Add perf event processing perf tools: Add processing of queues when events are flushed perf tools: Add synth_events and supporting functions perf tools: Add function to clear the decoder packet buffer perf tools: Add functions for full etmv4i packet decode MAINTAINERS: Adding entry for CoreSight trace decoding
MAINTAINERS | 3 +- tools/perf/Makefile.config | 26 + tools/perf/util/Build | 6 + tools/perf/util/auxtrace.c | 2 + tools/perf/util/cs-etm-decoder/Build | 2 + tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 581 +++++++++++ tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 138 +++ tools/perf/util/cs-etm.c | 1180 +++++++++++++++++++++++ tools/perf/util/cs-etm.h | 50 + 9 files changed, 1987 insertions(+), 1 deletion(-) create mode 100644 tools/perf/util/cs-etm-decoder/Build create mode 100644 tools/perf/util/cs-etm-decoder/cs-etm-decoder.c create mode 100644 tools/perf/util/cs-etm-decoder/cs-etm-decoder.h create mode 100644 tools/perf/util/cs-etm.c
I am done reviewing this set. Since doing iterations is time consuming I have decided to make modifications and pushed a branch here [1]. If you agree with my changes we can start from there on our next iteration. What I changed in the patches will be sent out for each patch as a normal review.
Other than the code to fix in 13/23 I don't have anything else to add. We just need to re-arrange the cover letter to point to the new gitHub repo (that I'll finish fixing this afternoon).
User space decoding works but I wasn't successful with kernel traces - have you had issues on your side?
Lastly you will also notice that on [1] I squashed my extra patches related to scripts into yours. I also moved the patches what were between:
2bd6bf03f4c1 Linux 4.14-rc1 and 4a1cc6997ed3 perf tools: Add initial hooks for decoding coresight traces
to the top. That way we get a better idea of what's really left to address.
Thanks, Mathieu
[1]. https://git.linaro.org/people/mathieu.poirier/coresight.git perf-opencsd-master-tor
Hi, was just wondering what the status with upstreaming this patchset is?
v4.15-rc2 is out now, so it is a good time to post it - even if it may not be in tip-top shape - so we can get feedback from the upstream maintainers about the external decoder library approach.
Let me know if there's anything I can do to help.
Thanks,
Kim