aboutsummaryrefslogtreecommitdiff
path: root/tests/test-json-instruction-count
blob: 3a4db97e1493f061ff36b913bc38d5263de8ab88 (plain)
1
2
3
4
5
6
#!/bin/sh

COMMAND=$@
INSTRUCTIONS=`valgrind --tool=callgrind --callgrind-out-file=/dev/null --instr-atstart=no --collect-atstart=no --combine-dumps=yes $COMMAND 2>&1 > /dev/null | grep refs | grep I | tail --lines=1 | cut -d ":" -f 2 | sed -e 's/^[ \t]*//'`

echo "Instructions needed to execute '$COMMAND': $INSTRUCTIONS"