# set PERF_EXEC_PATH to find scripts in the source directory
perfdir=$(dirname "$0")/../.. if [ -e "$perfdir/scripts/python/Perf-Trace-Util" ]; then export PERF_EXEC_PATH=$perfdir fi
# Disable lsan to avoid warnings about python memory leaks. export ASAN_OPTIONS=detect_leaks=0
trap_cleanup() {
cleanup
exit 1
}
trap trap_cleanup exit term int
report() { if [ "$1" = 0 ]; then echo"PASS: \"$2\"" else echo"FAIL: \"$2\" Error message: \"$3\""
err=1 fi
}
check_exec_0() { if [ $? != 0 ]; then
report 1 "invocation of $1 command failed" fi
}
find_str_or_fail() {
grep -q "$1""$2" if [ "$?" != 0 ]; then
report 1 "$3""Failed to find required string:'${1}'." else
report 0 "$3" fi
}
# check if perf is compiled with libtraceevent support
skip_no_probe_record_support() {
perf check feature -q libtraceevent && return 0
return 2
}
prepare_perf_data() { # 1s should be sufficient to catch at least some switches
perf record -e sched:sched_switch -a -- sleep 1 > /dev/null 2>&1 # check if perf data file got created in above step. if [ ! -e "perf.data" ]; then
printf "FAIL: perf record failed to create \"perf.data\" \n"
return 1 fi
}
# check standard inkvokation with no arguments
test_basic() {
out="$tmpdir/perf.out"
perf script report task-analyzer > "$out"
check_exec_0 "perf script report task-analyzer"
find_str_or_fail "Comm""$out""${FUNCNAME[0]}"
}
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.