[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / lldb / packages / Python / lldbsuite / test / bench.py
bloba9661b6d022529f308a03b30da5b26789850c6e6
1 #!/usr/bin/env python
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'.
7 You need to hand edit 'benches' to modify/change the command lines passed to the
8 test driver.
10 Use the following to get only the benchmark results in your terminal output:
12 ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
13 """
15 from __future__ import print_function
16 from __future__ import absolute_import
18 import os
19 from optparse import OptionParser
21 # dotest.py invocation with no '-e exe-path' uses lldb as the inferior program,
22 # unless there is a mentioning of custom executable program.
23 benches = [
24 # Measure startup delays creating a target, setting a breakpoint, and run
25 # to breakpoint stop.
26 './dotest.py -v +b %E %X -n -p TestStartupDelays.py',
28 # Measure 'frame variable' response after stopping at a breakpoint.
29 './dotest.py -v +b %E %X -n -p TestFrameVariableResponse.py',
31 # Measure stepping speed after stopping at a breakpoint.
32 './dotest.py -v +b %E %X -n -p TestSteppingSpeed.py',
34 # Measure expression cmd response with a simple custom executable program.
35 './dotest.py +b -n -p TestExpressionCmd.py',
37 # Attach to a spawned process then run disassembly benchmarks.
38 './dotest.py -v +b -n %E -p TestDoAttachThenDisassembly.py'
42 def main():
43 """Read the items from 'benches' and run the command line one by one."""
44 parser = OptionParser(usage="""\
45 %prog [options]
46 Run the standard benchmarks defined in the list named 'benches'.\
47 """)
48 parser.add_option('-e', '--executable',
49 type='string', action='store',
50 dest='exe',
51 help='The target program launched by lldb.')
52 parser.add_option('-x', '--breakpoint-spec',
53 type='string', action='store',
54 dest='break_spec',
55 help='The lldb breakpoint spec for the target program.')
57 # Parses the options, if any.
58 opts, args = parser.parse_args()
60 print("Starting bench runner....")
62 for item in benches:
63 command = item.replace('%E',
64 '-e "%s"' % opts.exe if opts.exe else '')
65 command = command.replace('%X', '-x "%s"' %
66 opts.break_spec if opts.break_spec else '')
67 print("Running %s" % (command))
68 os.system(command)
70 print("Bench runner done.")
72 if __name__ == '__main__':
73 main()