summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-12-07 19:27:06 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-12-07 19:27:06 +0000
commit1669f67776ec0ee3ce04a0b9f554190abae52309 (patch)
treea5327ce5c6bcc32c86d6f96b854090f125ddebfe
parente87ad4625ccb3dbf7df7767df3acb27691f414ce (diff)
downloadbcm5719-llvm-1669f67776ec0ee3ce04a0b9f554190abae52309.tar.gz
bcm5719-llvm-1669f67776ec0ee3ce04a0b9f554190abae52309.zip
Modified the script to have the flexibility of specifying the gdb executable path
for use in the benchmark against lldb's disassembly speed. Note that the lldb executable path can already be specified using the LLDB_EXEC env variable. rdar://problem/7511194 llvm-svn: 146050
-rw-r--r--lldb/test/benchmarks/disassembly/TestDisassembly.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/lldb/test/benchmarks/disassembly/TestDisassembly.py b/lldb/test/benchmarks/disassembly/TestDisassembly.py
index 1ef20edce2a..d3deba254a5 100644
--- a/lldb/test/benchmarks/disassembly/TestDisassembly.py
+++ b/lldb/test/benchmarks/disassembly/TestDisassembly.py
@@ -6,12 +6,33 @@ import lldb
import pexpect
from lldbbench import *
+def is_exe(fpath):
+ """Returns true if fpath is an executable."""
+ return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
+
class DisassembleDriverMainLoop(BenchBase):
mydir = os.path.join("benchmarks", "disassembly")
def setUp(self):
+ """
+ Note that lldbExec can be specified with the LLDB_EXEC env variable (see
+ dotest.py), and gdbExec can be specified with the GDB_EXEC env variable.
+ This provides a flexibility in specifying different versions of gdb for
+ comparison purposes.
+ """
BenchBase.setUp(self)
+ # If env var GDB_EXEC is specified, use it; otherwise, use gdb in your
+ # PATH env var.
+ if "GDB_EXEC" in os.environ and is_exe(os.environ["GDB_EXEC"]):
+ self.gdbExec = os.environ["GDB_EXEC"]
+ else:
+ self.gdbExec = "gdb"
+
+ print
+ print "lldb path: %s" % self.lldbExec
+ print "gdb path: %s" % self.gdbExec
+
self.exe = self.lldbHere
self.function = 'Driver::MainLoop()'
self.lldb_avg = None
@@ -86,7 +107,7 @@ class DisassembleDriverMainLoop(BenchBase):
prompt = self.child_prompt
# So that the child gets torn down after the test.
- self.child = pexpect.spawn('gdb --nx %s' % exe)
+ self.child = pexpect.spawn('%s --nx %s' % (self.gdbExec, exe))
child = self.child
# Turn on logging for what the child sends back.
OpenPOWER on IntegriCloud