blob: 93cce07261204fa2cefe40280e2582acef06ecc4 [file] [log] [blame]
#!/bin/bash
# Run args as command, but run cpuprofile and then pprof to capture test cpuprofile output
if [ -n "${BENT_PGO}" ] ; then
pf="${BENT_PGO}/${BENT_BENCH}.prof"
mkdir -p ${BENT_PGO}
else
pf="${BENT_PROFILES}/${BENT_BINARY}_${BENT_I}.prof"
mkdir -p ${BENT_PROFILES}
fi
"$@" -test.cpuprofile="$pf"
echo cpuprofile in "$pf"
if [[ x`which pprof` == x"" ]] ; then
go tool pprof -text -flat -nodecount=20 "$pf"
else
pprof -text -flat -nodecount=20 "$pf"
fi