#!/bin/bash # Check Arm CoreSight trace data recording and synthesized samples (exclusive)
# Uses the 'perf record' to record trace data with Arm CoreSight sinks; # then verify if there have any branch samples and instruction samples # are generated by CoreSight with 'perf script' and 'perf report' # commands.
# SPDX-License-Identifier: GPL-2.0 # Leo Yan <leo.yan@linaro.org>, 2020
perf_report_branch_samples() { echo"Looking at perf.data file for reporting branch samples:"
# Below is an example of the branch samples reporting: # 73.04% 73.04% touch libc-2.27.so [.] _dl_addr # 7.71% 7.71% touch libc-2.27.so [.] getenv # 2.59% 2.59% touch ld-2.27.so [.] strcmp
perf report --stdio -i ${perfdata} 2>&1 | \
grep -E " +[0-9]+\.[0-9]+% +[0-9]+\.[0-9]+% +$1 " > /dev/null 2>&1
}
perf_report_instruction_samples() { echo"Looking at perf.data file for instruction samples:"
# Below is an example of the instruction samples reporting: # 68.12% touch libc-2.27.so [.] _dl_addr # 5.80% touch libc-2.27.so [.] getenv # 4.35% touch ld-2.27.so [.] _dl_fixup
perf report --itrace=i20i --stdio -i ${perfdata} 2>&1 | \
grep -E " +[0-9]+\.[0-9]+% +$1" > /dev/null 2>&1
}
arm_cs_report() { if [ $2 != 0 ]; then echo"$1: FAIL"
glb_err=$2 else echo"$1: PASS" fi
}
is_device_sink() { # If the node of "enable_sink" is existed under the device path, this # means the device is a sink device. Need to exclude 'tpiu' since it # cannot support perf PMU. echo"$1" | grep -E -q -v "tpiu"
err=$?
arm_cs_report "CoreSight path testing (CPU$2 -> $device_name)" $err fi
arm_cs_iterate_devices $dev $2 done
}
arm_cs_etm_traverse_path_test() { # Iterate for every ETM device for dev in /sys/bus/event_source/devices/cs_etm/cpu*; do # Canonicalize the path
dev=`readlink -f $dev`
# Find the ETM device belonging to which CPU
cpu=`cat $dev/cpu`
# Use depth-first search (DFS) to iterate outputs
arm_cs_iterate_devices $dev $cpu done
}
arm_cs_etm_system_wide_test() { echo"Recording trace with system wide mode"
perf record -o ${perfdata} -e cs_etm// -a -- ls > /dev/null 2>&1
# System-wide mode should include perf samples so test for that # instead of ls
perf_script_branch_samples perf &&
perf_report_branch_samples perf &&
perf_report_instruction_samples perf
err=$?
arm_cs_report "CoreSight system wide testing" $err
}
# Test all combinations of per-thread, system-wide and normal mode with # and without timestamps
arm_cs_etm_basic_test -e cs_etm/timestamp=0/ --per-thread
arm_cs_etm_basic_test -e cs_etm/timestamp=1/ --per-thread
arm_cs_etm_basic_test -e cs_etm/timestamp=0/ -a
arm_cs_etm_basic_test -e cs_etm/timestamp=1/ -a
arm_cs_etm_basic_test -e cs_etm/timestamp=0/
arm_cs_etm_basic_test -e cs_etm/timestamp=1/
exit $glb_err
Messung V0.5
¤ Dauer der Verarbeitung: 0.21 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.