summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/packages/Python/lldbsuite/test/benchmarks/disassembly
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadbcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/benchmarks/disassembly')
-rw-r--r--lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py22
-rw-r--r--lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py16
-rw-r--r--lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py43
3 files changed, 57 insertions, 24 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py b/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
index 8a0c044147a..8bce4815894 100644
--- a/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
+++ b/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
@@ -3,18 +3,20 @@
from __future__ import print_function
-
-import os, sys
+import os
+import sys
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
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 = TestBase.compute_mydir(__file__)
@@ -42,7 +44,9 @@ class DisassembleDriverMainLoop(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_lldb_then_gdb(self):
"""Test disassembly on a large function with lldb vs. gdb."""
print()
@@ -54,11 +58,13 @@ class DisassembleDriverMainLoop(BenchBase):
print("lldb benchmark:", self.stopwatch)
self.run_gdb_disassembly(self.exe, self.function, self.count)
print("gdb benchmark:", self.stopwatch)
- print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg))
+ print("lldb_avg/gdb_avg: %f" % (self.lldb_avg / self.gdb_avg))
@benchmarks_test
@no_debug_info_test
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_gdb_then_lldb(self):
"""Test disassembly on a large function with lldb vs. gdb."""
print()
@@ -70,7 +76,7 @@ class DisassembleDriverMainLoop(BenchBase):
print("gdb benchmark:", self.stopwatch)
self.run_lldb_disassembly(self.exe, self.function, self.count)
print("lldb benchmark:", self.stopwatch)
- print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg))
+ print("lldb_avg/gdb_avg: %f" % (self.lldb_avg / self.gdb_avg))
def run_lldb_disassembly(self, exe, function, count):
import pexpect
@@ -79,7 +85,9 @@ class DisassembleDriverMainLoop(BenchBase):
prompt = self.child_prompt
# So that the child gets torn down after the test.
- self.child = pexpect.spawn('%s %s %s' % (lldbtest_config.lldbExec, self.lldbOption, exe))
+ self.child = pexpect.spawn(
+ '%s %s %s' %
+ (lldbtest_config.lldbExec, self.lldbOption, exe))
child = self.child
# Turn on logging for what the child sends back.
diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py b/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
index f8e3d94b657..36f23572648 100644
--- a/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
+++ b/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
@@ -5,13 +5,14 @@ inferior and traverses the stack for thread0 to arrive at frame with function
from __future__ import print_function
-
-import os, sys
+import os
+import sys
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
from lldbsuite.test.lldbtest import *
+
class AttachThenDisassemblyBench(BenchBase):
mydir = TestBase.compute_mydir(__file__)
@@ -32,10 +33,11 @@ class AttachThenDisassemblyBench(BenchBase):
def run_lldb_attach_then_disassembly(self, exe, count):
target = self.dbg.CreateTarget(exe)
- # Spawn a new process and don't display the stdout if not in TraceOn() mode.
+ # Spawn a new process and don't display the stdout if not in TraceOn()
+ # mode.
import subprocess
- popen = subprocess.Popen([exe, self.lldbOption],
- stdout = open(os.devnull, 'w') if not self.TraceOn() else None)
+ popen = subprocess.Popen([exe, self.lldbOption], stdout=open(
+ os.devnull, 'w') if not self.TraceOn() else None)
if self.TraceOn():
print("pid of spawned process: %d" % popen.pid)
@@ -51,7 +53,7 @@ class AttachThenDisassemblyBench(BenchBase):
i = 0
found = False
for f in thread0:
- #print("frame#%d %s" % (i, f.GetFunctionName()))
+ # print("frame#%d %s" % (i, f.GetFunctionName()))
if "MainLoop" in f.GetFunctionName():
found = True
thread0.SetSelectedFrame(i)
@@ -59,7 +61,7 @@ class AttachThenDisassemblyBench(BenchBase):
print("Found frame#%d for function 'MainLoop'" % i)
break
i += 1
-
+
# Reset the stopwatch now.
self.stopwatch.reset()
for i in range(count):
diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py b/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
index 618aac7eafc..fd91bb441d9 100644
--- a/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
+++ b/lldb/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
@@ -3,8 +3,8 @@
from __future__ import print_function
-
-import os, sys
+import os
+import sys
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbbench import *
@@ -12,6 +12,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import configuration
from lldbsuite.test import lldbutil
+
class XCode41Vs42GDBDisassembly(BenchBase):
mydir = TestBase.compute_mydir(__file__)
@@ -28,31 +29,53 @@ class XCode41Vs42GDBDisassembly(BenchBase):
@benchmarks_test
@no_debug_info_test
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
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)
+ self.run_gdb_disassembly(
+ self.gdb_41_exe,
+ self.exe,
+ self.function,
+ self.count)
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)
+ self.run_gdb_disassembly(
+ self.gdb_42_exe,
+ self.exe,
+ self.function,
+ self.count)
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))
+ print("gdb_42_avg/gdb_41_avg: %f" %
+ (self.gdb_42_avg / self.gdb_41_avg))
@benchmarks_test
@no_debug_info_test
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
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)
+ self.run_gdb_disassembly(
+ self.gdb_42_exe,
+ self.exe,
+ self.function,
+ self.count)
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)
+ self.run_gdb_disassembly(
+ self.gdb_41_exe,
+ self.exe,
+ self.function,
+ self.count)
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))
+ 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):
import pexpect
OpenPOWER on IntegriCloud