This patch set tries to add support Arm CoreSight testing with perf tool. Since the testings might be very diverse according to different requirements, to keep the testing as simple as possible from the start point, I'd like to define the testings to fulfil below duties:
- Sanity testing for integration perf tool with CoreSight tracing; - Trace source oriented testing, it needs to test for every source and iterate the paths from the source to its possible sinks; - Test with 'perf script' for branch samples; - Test with 'perf report' for branch samples and synthesized instruction samples.
Before started this work, we need a reliable and simple method to help us to analysis every possible path from one specific source to its output sinks. Suzuki has one the patch [1] which creates sysfs in/out nodes in CoreSight device folders, based on this it's convenient to use depth-first search (DFS) to traverse the paths from ETM to its connected sink devices.
Patch 0001 introduces shell script, which based on sysfs in/out nodes to find every feasible path from one CPU to one sink, then we can specify the sink in perf record command and use taskset command to bind task to the target CPU. Use this way it can very if the target CPU can generate trace data and output to the specific sink successfully or not, below is the iteration flow in Juno board:
Recording trace with path: CPU0 => 20010000.etf Recording trace with path: CPU0 => 20070000.etr Recording trace with path: CPU1 => 20010000.etf Recording trace with path: CPU1 => 20070000.etr Recording trace with path: CPU2 => 20010000.etf Recording trace with path: CPU2 => 20070000.etr Recording trace with path: CPU3 => 20010000.etf Recording trace with path: CPU3 => 20070000.etr Recording trace with path: CPU4 => 20010000.etf Recording trace with path: CPU4 => 20070000.etr Recording trace with path: CPU5 => 20010000.etf Recording trace with path: CPU5 => 20070000.etr
Patch 0002 adds two testings for 'perf report', one is the general testing and the second is testing with option '-itrace'.
I verified this patch set on Juno board, the code is based on CoreSight next branch, and applied Suzuki's the patch set 'coresight: Support for ACPI bindings' (have applied the total 36 patches) [2].
[1] https://archive.armlinux.org.uk/lurker/message/20190415.160419.bed67191.en.h... [2] https://archive.armlinux.org.uk/lurker/message/20190415.160343.cdd208bb.en.h...
Leo Yan (2): perf test: Introduce script for Arm CoreSight testing perf test: Add 'perf report' testing for Arm CoreSight
.../shell/record+script+report_arm_cs_etm.sh | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 tools/perf/tests/shell/record+script+report_arm_cs_etm.sh