#!/bin/sh # perf stat metrics (shadow stat) test # SPDX-License-Identifier: GPL-2.0 set -e # skip if system-wide mode is forbidden perf stat -a true > /dev/null 2>&1 || exit 2 test_global_aggr() { local cyc perf stat -a --no-big-num -e cycles,instructions sleep 1 2>&1 | \ grep -e cycles -e instructions | \ while read num evt hash ipc rest do # skip not counted events if [[ $num == "&1 | \ grep ^CPU | \ while read cpu num evt hash ipc rest do # skip not counted events if [[ $num == "