[Lldb-commits] [lldb] r142993 - /lldb/trunk/test/benchmarks/startup/TestStartupDelays.py

Johnny Chen johnny.chen at apple.com
Tue Oct 25 17:35:10 PDT 2011


Author: johnny
Date: Tue Oct 25 19:35:10 2011
New Revision: 142993

URL: http://llvm.org/viewvc/llvm-project?rev=142993&view=rev
Log:
Add another metric for startup delay -- run to breakpoint, which measures the time from issuing
the run command till the first breakpoint hit.  Example:

 $ ./dotest.py -v +b -n -x '-F Driver::MainLoop()' -p TestStartupDelays.py
1: test_startup_delay (TestStartupDelays.StartupDelaysBench)
   Test start up delays creating a target and setting a breakpoint. ... 
lldb startup delay (create fresh target) benchmark: Avg: 0.124496 (Laps: 30, Total Elapsed Time: 3.734883)
lldb startup delay (set first breakpoint) benchmark: Avg: 0.220828 (Laps: 30, Total Elapsed Time: 6.624847)
lldb startup delay (run to breakpoint) benchmark: Avg: 0.478159 (Laps: 30, Total Elapsed Time: 14.344774)
ok

Modified:
    lldb/trunk/test/benchmarks/startup/TestStartupDelays.py

Modified: lldb/trunk/test/benchmarks/startup/TestStartupDelays.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/benchmarks/startup/TestStartupDelays.py?rev=142993&r1=142992&r2=142993&view=diff
==============================================================================
--- lldb/trunk/test/benchmarks/startup/TestStartupDelays.py (original)
+++ lldb/trunk/test/benchmarks/startup/TestStartupDelays.py Tue Oct 25 19:35:10 2011
@@ -15,6 +15,8 @@
         # Create self.stopwatch2 for measuring "set first breakpoint".
         # The default self.stopwatch is for "create fresh target".
         self.stopwatch2 = Stopwatch()
+        # Create self.stopwatch3 for measuring "run to breakpoint".
+        self.stopwatch3 = Stopwatch()
         if lldb.bmExecutable:
             self.exe = lldb.bmExecutable
         else:
@@ -35,6 +37,7 @@
         self.run_startup_delays_bench(self.exe, self.break_spec, self.count)
         print "lldb startup delay (create fresh target) benchmark:", self.stopwatch
         print "lldb startup delay (set first breakpoint) benchmark:", self.stopwatch2
+        print "lldb startup delay (run to breakpoint) benchmark:", self.stopwatch3
 
     def run_startup_delays_bench(self, exe, break_spec, count):
         # Set self.child_prompt, which is "(lldb) ".
@@ -63,6 +66,11 @@
                 child.sendline('breakpoint set %s' % break_spec)
                 child.expect_exact(prompt)
 
+            with self.stopwatch3:
+                # Run to the breakpoint just set.
+                child.sendline('run')
+                child.expect_exact(prompt)
+
             child.sendline('quit')
             try:
                 self.child.expect(pexpect.EOF)





More information about the lldb-commits mailing list