This patch adds two testings for 'perf report' command.
The first testing is a general report testing with branch samples, the second testing is to 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.
Signed-off-by: Leo Yan leo.yan@linaro.org --- ...etm.sh => record+script+report_arm_cs_etm.sh} | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) rename tools/perf/tests/shell/{record+script_arm_cs_etm.sh => record+script+report_arm_cs_etm.sh} (79%)
diff --git a/tools/perf/tests/shell/record+script_arm_cs_etm.sh b/tools/perf/tests/shell/record+script+report_arm_cs_etm.sh similarity index 79% rename from tools/perf/tests/shell/record+script_arm_cs_etm.sh rename to tools/perf/tests/shell/record+script+report_arm_cs_etm.sh index 108604984867..ea053ed4bbb1 100755 --- a/tools/perf/tests/shell/record+script_arm_cs_etm.sh +++ b/tools/perf/tests/shell/record+script+report_arm_cs_etm.sh @@ -31,6 +31,18 @@ perf_script_branch_samples() { egrep " +touch +[0-9]+ .* +branches: +" }
+perf_report_branch_samples() { + echo "Looking at perf.data file for reporting branch samples:" + perf report --stdio -i ${perfdata} | \ + egrep " +[0-9]+.[0-9]+% +[0-9]+.[0-9]+% +touch " +} + +perf_report_instruction_samples() { + echo "Looking at perf.data file for instruction samples:" + perf report --itrace=i1000i --stdio -i ${perfdata} | \ + egrep " +[0-9]+.[0-9]+% +touch" +} + arm_cs_iterate_devices() { for dev in $1/out:*; do
@@ -50,7 +62,9 @@ arm_cs_iterate_devices() { # Only test if the output device is ETR/ETB/ETF if [ $? -eq 0 ]; then record_touch_file $device_name $2 && - perf_script_branch_samples + perf_script_branch_samples && + perf_report_branch_samples && + perf_report_instruction_samples
err=$?