aboutsummaryrefslogtreecommitdiff
path: root/tests/test-json-instruction-count
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-03-29 07:44:31 -0700
committerCharles Kerr <charles.kerr@canonical.com>2012-03-29 07:44:31 -0700
commit921aacaeec41ef3b62d2c1650f9f872eea921013 (patch)
treed12db36a7cedb1d3ce93da2fab0a227d46507a74 /tests/test-json-instruction-count
parent4c0ab8af125ecdac6690bc56ab60f0059bafad9f (diff)
parent11ee75120bad73033ccd1ec1ceb919395023084e (diff)
downloadlibdbusmenu-921aacaeec41ef3b62d2c1650f9f872eea921013.tar.gz
libdbusmenu-921aacaeec41ef3b62d2c1650f9f872eea921013.tar.bz2
libdbusmenu-921aacaeec41ef3b62d2c1650f9f872eea921013.zip
merge lp:~ted/dbusmenu/instruction-count-testing to support benchmarking based on callgrind measurements h/t Chase
Diffstat (limited to 'tests/test-json-instruction-count')
-rwxr-xr-xtests/test-json-instruction-count6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test-json-instruction-count b/tests/test-json-instruction-count
new file mode 100755
index 0000000..3a4db97
--- /dev/null
+++ b/tests/test-json-instruction-count
@@ -0,0 +1,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"