Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6794)

Unified Diff: build/android/test_runner.py

Issue 76233005: [Android] Refactor and reuse reraiser_thread thread stack dumping utility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: PrintThreadStack -> LogThreadStack Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/utils/reraiser_thread.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index ea6ef0917ba9958da2f46f297e0a3a9628700b78..46fefe943e62cd4e38ea0d2e3ea2629d78db458b 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -38,6 +38,7 @@ from pylib.uiautomator import setup as uiautomator_setup
from pylib.uiautomator import test_options as uiautomator_test_options
from pylib.utils import command_option_parser
from pylib.utils import report_results
+from pylib.utils import reraiser_thread
from pylib.utils import run_tests_helper
@@ -797,18 +798,8 @@ VALID_COMMANDS = {
def DumpThreadStacks(signal, frame):
- thread_names_map = dict(
- [(thread.ident, thread.name) for thread in threading.enumerate()])
- lines = []
- for thread_id, stack in sys._current_frames().items():
- lines.append(
- '\n# Thread: %s (%d)' % (
- thread_names_map.get(thread_id, ''), thread_id))
- for filename, lineno, name, line in traceback.extract_stack(stack):
- lines.append('File: "%s", line %d, in %s' % (filename, lineno, name))
- if line:
- lines.append(' %s' % (line.strip()))
- print '\n'.join(lines)
+ for thread in threading.enumerate():
+ reraiser_thread.LogThreadStack(thread)
def main(argv):
« no previous file with comments | « build/android/pylib/utils/reraiser_thread.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698