| #!/bin/bash | |
| # Run args as command, but run cpuprofile and then pprof to capture test cpuprofile output | |
| pf="${BENT_BINARY}_${BENT_I}.prof" | |
| "$@" -test.cpuprofile="$pf" | |
| echo cpuprofile in `pwd`/"$pf" | |
| if [[ x`which pprof` == x"" ]] ; then | |
| go tool pprof -text -flat -nodecount=20 "$pf" | |
| else | |
| pprof -text -flat -nodecount=20 "$pf" | |
| fi |