cleanup() { rm -rf "${stat_output}"
trap - EXIT TERM INT
}
trap_cleanup() { echo"Unexpected signal in ${FUNCNAME[1]}" cat"${stat_output}"
cleanup
exit 1
}
trap trap_cleanup EXIT TERM INT
# Event to be used in tests
event=cache-misses
if ! perf record -e "${event}:p" -a -o /dev/null sleep 0.01 > "${stat_output}" 2>&1 then echo"Missing ${event} support"
cleanup
exit 2 fi
test_with_record_tpebs() { echo"Testing with --record-tpebs" if ! perf stat -e "${event}:R" --record-tpebs -a sleep 0.01 > "${stat_output}" 2>&1 then echo"Testing with --record-tpebs [Failed perf stat]" cat"${stat_output}"
exit 1 fi
# Expected output: # $ perf stat --record-tpebs -e cache-misses:R -a sleep 0.01 # Events enabled # [ perf record: Woken up 2 times to write data ] # [ perf record: Captured and wrote 0.056 MB - ] # # Performance counter stats for 'system wide': # # 0 cache-misses:R # # 0.013963299 seconds time elapsed if ! grep "perf record""${stat_output}" then echo"Testing with --record-tpebs [Failed missing perf record]" cat"${stat_output}"
exit 1 fi if ! grep "${event}:R""${stat_output}" && ! grep "/${event}/R""${stat_output}" then echo"Testing with --record-tpebs [Failed missing event name]" cat"${stat_output}"
exit 1 fi echo"Testing with --record-tpebs [Success]"
}
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.