llvm-project/lldb/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py

96 lines
3.3 KiB
Python
Raw Normal View History

Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
"""Disassemble lldb's Driver::MainLoop() functions comparing Xcode 4.1 vs. 4.2's gdb."""
import os, sys
import unittest2
import lldb
import pexpect
from lldbbench import *
2012-04-23 17:54:40 +00:00
class XCode41Vs42GDBDisassembly(BenchBase):
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
mydir = os.path.join("benchmarks", "disassembly")
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
def setUp(self):
BenchBase.setUp(self)
2012-04-23 17:54:40 +00:00
self.gdb_41_exe = '/Xcode41/usr/bin/gdb'
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
self.gdb_42_exe = '/Developer/usr/bin/gdb'
self.exe = self.lldbHere
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
self.function = 'Driver::MainLoop()'
self.gdb_41_avg = None
self.gdb_42_avg = None
self.count = lldb.bmIterationCount
if self.count <= 0:
self.count = 5
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
@benchmarks_test
def test_run_41_then_42(self):
"""Test disassembly on a large function with 4.1 vs. 4.2's gdb."""
print
self.run_gdb_disassembly(self.gdb_41_exe, self.exe, self.function, self.count)
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
print "4.1 gdb benchmark:", self.stopwatch
self.gdb_41_avg = self.stopwatch.avg()
self.run_gdb_disassembly(self.gdb_42_exe, self.exe, self.function, self.count)
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
print "4.2 gdb benchmark:", self.stopwatch
self.gdb_42_avg = self.stopwatch.avg()
print "gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg)
@benchmarks_test
def test_run_42_then_41(self):
"""Test disassembly on a large function with 4.1 vs. 4.2's gdb."""
print
self.run_gdb_disassembly(self.gdb_42_exe, self.exe, self.function, self.count)
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
print "4.2 gdb benchmark:", self.stopwatch
self.gdb_42_avg = self.stopwatch.avg()
self.run_gdb_disassembly(self.gdb_41_exe, self.exe, self.function, self.count)
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
print "4.1 gdb benchmark:", self.stopwatch
self.gdb_41_avg = self.stopwatch.avg()
print "gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg)
def run_gdb_disassembly(self, gdb_exe_path, exe, function, count):
# Set self.child_prompt, which is "(gdb) ".
self.child_prompt = '(gdb) '
prompt = self.child_prompt
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --nx %s' % (gdb_exe_path, exe))
Check in a customized benchmark which compares the Xcode 4.1 vs. Xcode 4.2's gdb disassembly speed on lldb's Driver::MainLoop function which is ~1190 lines of x86 assembly code. This file is not exercised during the normal test suite run, i.e., no +b option specified. So it should be ok. The following is the benchmark result on my MBP running OSX Lion: [17:38:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v +b -p TestFlintVsSlate /Volumes/data/lldb/svn/trunk/build/Debug LLDB-71 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 137008 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 137008 Last Changed Date: 2011-08-05 17:50:36 -0700 (Fri, 05 Aug 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-08-08-17_38_52' Command invoked: python ./dotest.py -v +b -p TestFlintVsSlate ---------------------------------------------------------------------- Collected 2 tests 1: test_run_41_then_42 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.1 gdb benchmark: Avg: 0.205623 (Laps: 5, Total Elapsed Time: 1.028113) 4.2 gdb benchmark: Avg: 0.201970 (Laps: 5, Total Elapsed Time: 1.009849) gdb_42_avg/gdb_41_avg: 0.982236 ok 2: test_run_42_then_41 (TestFlintVsSlateGDBDisassembly.FlintVsSlateGDBDisassembly) Test disassembly on a large function with 4.1 vs. 4.2's gdb. ... 4.2 gdb benchmark: Avg: 0.202602 (Laps: 5, Total Elapsed Time: 1.013012) 4.1 gdb benchmark: Avg: 0.204418 (Laps: 5, Total Elapsed Time: 1.022089) gdb_42_avg/gdb_41_avg: 0.991119 ok ---------------------------------------------------------------------- Ran 2 tests in 15.688s OK llvm-svn: 137092
2011-08-09 00:56:07 +00:00
child = self.child
# Turn on logging for what the child sends back.
if self.TraceOn():
child.logfile_read = sys.stdout
child.expect_exact(prompt)
child.sendline('break %s' % function)
child.expect_exact(prompt)
child.sendline('run')
child.expect_exact(prompt)
# Reset the stopwatch now.
self.stopwatch.reset()
for i in range(count):
with self.stopwatch:
# Disassemble the function.
child.sendline('disassemble')
child.expect_exact(prompt)
child.sendline('next')
child.expect_exact(prompt)
child.sendline('quit')
child.expect_exact('The program is running. Exit anyway?')
child.sendline('y')
try:
self.child.expect(pexpect.EOF)
except:
pass
if self.TraceOn():
print "gdb disassembly benchmark:", str(self.stopwatch)
self.child = None
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lambda: lldb.SBDebugger.Terminate())
unittest2.main()