Hi all,
On Tue, May 28, 2019 at 07:11:39PM +0800, Leo Yan wrote:
We need a simple method to test Perf with Arm CoreSight drivers, this could be used for smoke testing when new patch is coming for perf or CoreSight drivers, and we also can use the test to confirm if the CoreSight has been enabled successfully on new platforms.
This patch introduces the shell script test_arm_coresight.sh which is under the 'pert test' framework. Simply to say, the testing rationale is source oriented testing, it traverses every source (now only refers to ETM device) and test its all possible sinks. To search the complete paths from one specific source to its sinks, this patch relies on the sysfs '/sys/bus/coresight/devices/devX/out:Y' for depth-first search (DFS) for iteration connected device nodes, if the output device is detected as one of ETR, ETF, or ETB types then it will test trace data recording and decoding for this PMU device.
The script runs three output testings for every trace data:
- Test branch samples dumping with 'perf script' command;
- Test branch samples reporting with 'perf report' command;
- Use option '--itrace=i1000i' to insert synthesized instructions events and the script will check if perf can output the percentage value successfully based on the instruction samples.
If any device fails for the testing, the test will report failure and directly exit with error. This test will be only applied on the platform with PMU event 'cs_etm//', otherwise will skip the testing.
Below is detailed usage for it:
# cd $linux/tools/perf -> This is important so can use shell script # perf test list
[...] 61: Check Arm CoreSight trace data recording and branch samples 62: Check open filename arg using perf trace + vfs_getname 63: Zstd perf.data compression/decompression 64: Add vfs_getname probe to get syscall args filenames
# perf test 61
61: Check Arm CoreSight trace data recording and branch samples: Ok
Signed-off-by: Leo Yan leo.yan@linaro.org
Since Suzuki has sent out device connection via sysfs patches [1], thus I applied this patch on top of dependent patches (Suzuki's device connection via sysfs patches + APCI binding patches).
Uploaded the whole things on git server [2] in case you want to know the whole context and test this patch. Any suggestion or comment is appreciate :)
Thanks, Leo Yan
[1] https://archive.armlinux.org.uk/lurker/message/20190530.164454.064a07af.en.h... [2] https://git.linaro.org/people/leo.yan/linux-coresight.git/log/?h=coresight_p...