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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/desktop_browser_backend.py

Issue 320693002: Revert of Telemetry: Last ditch effort to dump symbols on tab crashes if none are found (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/desktop_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_backend.py b/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_backend.py
index a689941404c091f67d813f55915220b2ea1d5687..a9f1fa5186fb77ce75404fedea93784470515878 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_backend.py
@@ -262,47 +262,31 @@
logging.warning('minidump_stackwalk binary not found.')
return None
+ symbols = glob.glob(os.path.join(self._browser_directory, '*.breakpad*'))
+ if not symbols:
+ logging.warning('No breakpad symbols found.')
+ return None
+
with open(minidump, 'rb') as infile:
minidump += '.stripped'
with open(minidump, 'wb') as outfile:
outfile.write(''.join(infile.read().partition('MDMP')[1:]))
symbols_path = os.path.join(self._tmp_minidump_dir, 'symbols')
-
- symbols = glob.glob(os.path.join(self._browser_directory, '*.breakpad*'))
- if symbols:
- for symbol in sorted(symbols, key=os.path.getmtime, reverse=True):
- if not os.path.isfile(symbol):
+ for symbol in sorted(symbols, key=os.path.getmtime, reverse=True):
+ if not os.path.isfile(symbol):
+ continue
+ with open(symbol, 'r') as f:
+ fields = f.readline().split()
+ if not fields:
continue
- with open(symbol, 'r') as f:
- fields = f.readline().split()
- if not fields:
- continue
- sha = fields[3]
- binary = ' '.join(fields[4:])
- symbol_path = os.path.join(symbols_path, binary, sha)
- if os.path.exists(symbol_path):
- continue
- os.makedirs(symbol_path)
- shutil.copyfile(symbol, os.path.join(symbol_path, binary + '.sym'))
- else:
- logging.info('Dumping breakpad symbols')
- generate_breakpad_symbols_path = os.path.join(
- util.GetChromiumSrcDir(), "components", "breakpad",
- "tools", "generate_breakpad_symbols.py")
- cmd = [
- sys.executable,
- generate_breakpad_symbols_path,
- '--binary=%s' % self._executable,
- '--symbols-dir=%s' % symbols_path,
- '--build-dir=%s' % self._browser_directory,
- ]
-
- try:
- subprocess.check_output(cmd, stderr=open(os.devnull, 'w'))
- except subprocess.CalledProcessError:
- logging.warning('Failed to execute "%s"' % ' '.join(cmd))
- return None
+ sha = fields[3]
+ binary = ' '.join(fields[4:])
+ symbol_path = os.path.join(symbols_path, binary, sha)
+ if os.path.exists(symbol_path):
+ continue
+ os.makedirs(symbol_path)
+ shutil.copyfile(symbol, os.path.join(symbol_path, binary + '.sym'))
return subprocess.check_output([stackwalk, minidump, symbols_path],
stderr=open(os.devnull, 'w'))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698