blob: 634fb182c2c75e175cd1da0d616fd7fa54bdec04 [file] [log] [blame]
Johnny Chenb8da4262011-10-22 00:57:05 +00001#!/usr/bin/env python
2
3"""
4A simple bench runner which delegates to the ./dotest.py test driver to run the
5benchmarks defined in the list named 'benches'.
6
7You need to hand edit 'benches' to modify/change the command lines passed to the
8test driver.
9
10Use the following to get only the benchmark results in your terminal output:
11
12 ./bench.py 2>&1 | grep -P '^lldb.*benchmark:'
13"""
14
15import os, sys
16import 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.
20benches = [
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
37def 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
47if __name__ == '__main__':
48 main()