On Mon, 6 May 2019 at 03:41, Leo Yan leo.yan@linaro.org wrote:
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%)
Wouldn't it be better to just name the script "test_arm_coresight.sh" so that we can make any changes we want to it without having to rethink the name every time?
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 "
Please document the the 'egrep' is looking for with an example of the 'report' output.
+}
+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"
Same here. You should also consider merging the patches together.
I tested this and things work quite well.
Thanks, Mathieu
+}
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=$?
-- 2.17.1