Johnny Chen | b8da426 | 2011-10-22 00:57:05 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | """ |
| 4 | A simple bench runner which delegates to the ./dotest.py test driver to run the |
| 5 | benchmarks defined in the list named 'benches'. |
| 6 | |
| 7 | You need to hand edit 'benches' to modify/change the command lines passed to the |
| 8 | test driver. |
| 9 | |
| 10 | Use the following to get only the benchmark results in your terminal output: |
| 11 | |
| 12 | ./bench.py 2>&1 | grep -P '^lldb.*benchmark:' |
| 13 | """ |
| 14 | |
| 15 | import os, sys |
| 16 | import re |
| 17 | |
| 18 | # dotest.py invocation with no '-e exe-path' uses lldb as the inferior program, |
| 19 | # unless there is a mentioning of custom executable program. |
| 20 | benches = [ |
| 21 | # Measure startup delays creating a target and setting a breakpoint at main. |
| 22 | './dotest.py -v +b -n -p TestStartupDelays.py', |
| 23 | |
| 24 | # Measure 'frame variable' response after stopping at Driver::MainLoop(). |
| 25 | './dotest.py -v +b -x "-F Driver::MainLoop()" -n -p TestFrameVariableResponse.py', |
| 26 | |
| 27 | # Measure stepping speed after stopping at Driver::MainLoop(). |
| 28 | './dotest.py -v +b -x "-F Driver::MainLoop()" -n -p TestSteppingSpeed.py', |
| 29 | |
| 30 | # Measure expression cmd response with a simple custom executable program. |
| 31 | './dotest.py +b -n -p TestExpressionCmd.py', |
| 32 | |
| 33 | # Attach to a spawned lldb process then run disassembly benchmarks. |
| 34 | './dotest.py -v +b -n -p TestDoAttachThenDisassembly.py' |
| 35 | ] |
| 36 | |
| 37 | def main(): |
| 38 | """Read the items from 'benches' and run the command line one by one.""" |
| 39 | print "Starting bench runner...." |
| 40 | |
| 41 | for command in benches: |
| 42 | print "Running %s" % (command) |
| 43 | os.system(command) |
| 44 | |
| 45 | print "Bench runner done." |
| 46 | |
| 47 | if __name__ == '__main__': |
| 48 | main() |