Bug 1395540 - Part 4: Fix the DMD stacks. r=njn

This runs the DMD files through the DMD stack fixer so that we end up with
usable stacks instead of just offsets into libxul.

--HG--
extra : rebase_source : 486a9e0f97e9a0b5374784c8c5986449a7c12478
This commit is contained in:
Eric Rahm 2017-09-21 14:41:44 -07:00
Родитель 8ac1b58cf5
Коммит 4ee0f7aef5
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -4,6 +4,7 @@
import fnmatch
import glob
import gzip
import json
import os
import sys
@ -116,11 +117,16 @@ class TestMemoryUsage(MarionetteTestCase):
"""
Handles moving DMD reports from the temp dir to our resultsDir.
"""
from dmd import fixStackTraces
# Move DMD files from temp dir to resultsDir.
tmpdir = tempfile.gettempdir()
tmp_files = os.listdir(tmpdir)
for f in fnmatch.filter(tmp_files, "dmd-*.json.gz"):
f = os.path.join(tmpdir, f)
self.logger.info("Fixing stacks for %s, this may take a while" % f)
isZipped = True
fixStackTraces(f, isZipped, gzip.open)
shutil.move(f, self._resultsDir)
# Also attempt to cleanup the unified memory reports.

Просмотреть файл

@ -171,6 +171,10 @@ class MachCommands(MachCommandBase):
for k, v in env_vars[arch].iteritems():
os.environ[k] = v
# Also add the bin dir to the python path so we can use dmd.py
if bin_dir not in sys.path:
sys.path.append(bin_dir)
for k, v in kwargs.iteritems():
setattr(args, k, v)