Lines Matching +full:skip +full:- +full:power +full:- +full:up

3 # SPDX-License-Identifier: GPL-2.0
5 set -e
7 # Skip if no Intel PT
8 perf list | grep -q 'intel_pt//' || exit 2
18 temp_dir=$(mktemp -d /tmp/perf-test-intel-pt-sh.XXXXXXXXXX)
20 tmpfile="${temp_dir}/tmp-perf.data"
21 perfdatafile="${temp_dir}/test-perf.data"
22 outfile="${temp_dir}/test-out.txt"
23 errfile="${temp_dir}/test-err.txt"
31 trap - EXIT TERM INT
32 sane=$(echo "${temp_dir}" | cut -b 1-26)
33 if [ "${sane}" = "/tmp/perf-test-intel-pt-sh" ] ; then
34 echo "--- Cleaning up ---"
35 rm -f "${temp_dir}/"*
51 # Options to speed up recording: no post-processing, no build-id cache update,
53 perf record -B -N --no-bpf-event "$@"
60 perf record --no-bpf-event "$@"
64 cat << _end_of_file_ | /usr/bin/cc -o "${workload}" -xc - -pthread && have_workload=true
96 echo "Checking for CPU-wide recording on CPU $1"
97 if ! perf_record_no_decode -o "${tmpfile}" -e dummy:u -C "$1" true >/dev/null 2>&1 ; then
107 echo "--- Test system-wide sideband ---"
114 perf_record_no_decode -o "${perfdatafile}" -e intel_pt//u -C 0 -- taskset --cpu-list 1 uname
117 …mmap_cnt=$(perf script -i "${perfdatafile}" --no-itrace --show-mmap-events -C 1 2>/dev/null | grep…
119 if [ "${mmap_cnt}" -gt 0 ] ; then
130 if [ -z "${can_kernel_trace}" ] ; then
132 perf_record_no_decode -o "${tmpfile}" -e dummy:k true >/dev/null 2>&1 && can_kernel_trace=1
134 if [ ${can_kernel_trace} -eq 0 ] ; then
135 echo "SKIP: no kernel tracing"
146 echo "--- Test per-thread ${desc}recording ---"
157 cat <<- "_end_of_file_" > "${awkscript}"
160 u = s"[0-9]+"s
161 d = s"[0-9-]+"s
162 x = s"[0-9a-fA-FxX]+"s
164 set_output = "idx"u": set output fd"u"->"u
227 if (pid != -1) {
235 if (cpu != -1) {
249 print "Expected " thread_cnt " per-thread mmaps - found " n
263 …perf_record_no_decode -o "${perfdatafile}" -e intel_pt//u"${k}" -vvv --per-thread -p "${w1},${w2}"…
276 awk -v thread_cnt=4 -f "${awkscript}" "${errfile}" || return 1
284 echo "--- Test tracing self-modifying code that uses jitdump ---"
291 if [ ! -e "${jitdump_h}" ] ; then
292 echo "SKIP: Include file jitdump.h not found"
296 if [ -z "${have_jitdump_workload}" ] ; then
298 # Create a workload that uses self-modifying code and generates its own jitdump file
299 …cat <<- "_end_of_file_" | /usr/bin/cc -o "${jitdump_workload}" -I "${jitdump_incl_dir}" -xc - -pth…
336 snprintf(filename, sizeof(filename), "jit-%d.dump", getpid());
371 return -1;
383 void *addr = mmap(0, 4096, PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
398 ret = ((int (*)(void))addr)() - CHK_BYTE;
407 echo "SKIP: No jitdump workload"
413 perf_record_no_bpf -o "${tmpfile}" -e intel_pt//u "${jitdump_workload}"
414 perf inject -i "${tmpfile}" -o "${perfdatafile}" --jit
415 decode_br_cnt=$(perf script -i "${perfdatafile}" --itrace=b | wc -l)
417 decode_err_cnt=$(perf script -i "${perfdatafile}" --itrace=e-o-l | grep -ci error)
418 cd -
420 if [ "${decode_br_cnt}" -lt 1000 ] ; then
425 if [ "${decode_err_cnt}" -ne 0 ] ; then
427 perf script -i "${perfdatafile}" --itrace=e-o-l --show-mmap-events | cat
437 echo "--- Test with MTC and TSC disabled ---"
439 perf_record_no_decode -o "${perfdatafile}" -e intel_pt/mtc=0,tsc=0/u uname
441 mtc_cnt=$(perf script -i "${perfdatafile}" -D 2>/dev/null | grep -c "MTC 0x")
442 if [ "${mtc_cnt}" -ne 0 ] ; then
447 tsc_cnt=$(perf script -i "${perfdatafile}" -D 2>/dev/null | grep -c "TSC 0x")
448 if [ "${tsc_cnt}" -ne 0 ] ; then
458 echo "--- Test with branches disabled ---"
460 perf_record_no_decode -o "${perfdatafile}" -e intel_pt/branch=0/u uname
462 tnt_cnt=$(perf script -i "${perfdatafile}" -D 2>/dev/null | grep -c "TNT 0x")
463 tip_cnt=$(perf script -i "${perfdatafile}" -D 2>/dev/null | grep -c "TIP 0x")
464 fup_cnt=$(perf script -i "${perfdatafile}" -D 2>/dev/null | grep -c "FUP 0x")
465 if [ "${tnt_cnt}" -ne 0 ] || [ "${tip_cnt}" -ne 0 ] || [ "${fup_cnt}" -ne 0 ] ; then
475 echo "--- Test with/without CYC ---"
479 echo "SKIP: CYC is not supported"
483 perf_record_no_decode -o "${perfdatafile}" -e intel_pt/cyc/u uname
485 cyc_cnt=$(perf script -i "${perfdatafile}" -D 2>/dev/null | grep -c "CYC 0x")
491 perf_record_no_decode -o "${perfdatafile}" -e intel_pt//u uname
493 cyc_cnt=$(perf script -i "${perfdatafile}" -D 2>/dev/null | grep -c "CYC 0x")
494 if [ "${cyc_cnt}" -gt 0 ] ; then
504 echo "--- Test recording with sample mode ---"
506 …if ! perf_record_no_decode -o "${perfdatafile}" --aux-sample=8192 -e '{intel_pt//u,branch-misses:u…
507 echo "perf record failed with --aux-sample"
511 if perf_record_no_decode -o "${perfdatafile}" -e br_misp_retired.all_branches:u uname ; then
512 …if ! perf_record_no_decode -o "${perfdatafile}" -e '{intel_pt//,br_misp_retired.all_branches/aux-s…
513 echo "perf record failed with --aux-sample-size"
523 echo "--- Test with kernel trace ---"
526 if ! perf_record_no_decode -o "${perfdatafile}" -e intel_pt//k -m1,128 uname ; then
536 echo "--- Test virtual LBR ---"
538 libpython=$(perf version --build-options | grep python | grep -cv OFF)
540 echo "SKIP: python scripting is not supported"
563 perf_record_no_bpf -o "${perfdatafile}" --aux-sample -e '{intel_pt//,cycles}:u' uname
564 …times_val=$(perf script -i "${perfdatafile}" --itrace=L -s "${maxbrstack}" 2>/dev/null | grep "max…
566 [0-9]*) ;;
569 if [ "${times_val}" -lt 2 ] ; then
579 echo "--- Test power events ---"
580 # Check if power events are supported
583 echo "SKIP: power_event_trace is not supported"
586 if ! perf_record_no_decode -o "${perfdatafile}" -a -e intel_pt/pwr_evt/u uname ; then
596 echo "--- Test with TNT packets disabled ---"
600 echo "SKIP: tnt_disable is not supported"
603 perf_record_no_decode -o "${perfdatafile}" -e intel_pt/notnt/u uname
605 tnt_cnt=$(perf script -i "${perfdatafile}" -D | grep -c TNT)
606 if [ "${tnt_cnt}" -ne 0 ] ; then
616 echo "--- Test with event_trace ---"
620 echo "SKIP: event_trace is not supported"
623 if ! perf_record_no_decode -o "${perfdatafile}" -e intel_pt/event/u uname ; then
633 echo "--- Test with pipe mode ---"
635 if ! perf_record_no_bpf -o- -e intel_pt//u uname | perf report -q -i- --itrace=i10000 ; then
639 if ! perf_record_no_bpf -o- -e intel_pt//u uname | perf inject -b > /dev/null ; then
649 if [ "$1" -eq 2 ] ; then
653 if [ "$1" -eq 0 ] ; then
678 echo "--- Done ---"
680 if [ ${err_cnt} -gt 0 ] ; then
684 if [ ${ok_cnt} -gt 0 ] ; then