1 #!/bin/bash 2 # test Intel TPEBS counting mode 3 # SPDX-License-Identifier: GPL-2.0 4 5 set -e 6 grep -q GenuineIntel /proc/cpuinfo || { echo Skipping non-Intel; exit 2; } 7 8 # Use this event for testing because it should exist in all platforms 9 event=cache-misses:R 10 11 # Without this cmd option, default value or zero is returned 12 echo "Testing without --record-tpebs" 13 result=$(perf stat -e "$event" true 2>&1) 14 [[ "$result" =~ $event ]] || exit 1 15 16 # In platforms that do not support TPEBS, it should execute without error. 17 echo "Testing with --record-tpebs" 18 result=$(perf stat -e "$event" --record-tpebs -a sleep 0.01 2>&1) 19 [[ "$result" =~ "perf record" && "$result" =~ $event ]] || exit 1
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.