Bug 1196430 - part 7 - teach process_leak_log how to symbolicate leaked object stacks; r=mccr8

This commit is contained in:
Nathan Froyd 2015-08-26 19:41:43 -04:00
parent 956d3c942b
commit 21e096a42c
4 changed files with 19 additions and 5 deletions

View File

@ -630,7 +630,10 @@ class RefTest(object):
debuggerInfo=debuggerInfo)
mozleak.process_leak_log(self.leakLogFile,
leak_thresholds=options.leakThresholds,
log=log)
log=log,
stack_fixer=get_stack_fixer_function(options.utilityPath,
options.symbolsPath),
)
log.info("\nREFTEST INFO | runreftest.py | Running tests: end.")
finally:
self.cleanup(profileDir)

View File

@ -2248,6 +2248,8 @@ class Mochitest(MochitestUtilsMixin):
leak_thresholds=options.leakThresholds,
ignore_missing_leaks=options.ignoreMissingLeaks,
log=self.log,
stack_fixer=get_stack_fixer_function(options.utilityPath,
options.symbolsPath),
)
if self.nsprLogs:

View File

@ -19,6 +19,7 @@ from runtests import MochitestUtilsMixin
from mochitest_options import MochitestArgumentParser
from marionette import Marionette
from mozprofile import Profile, Preferences
from mozrunner.utils import get_stack_fixer_function
import mozinfo
import mozleak
@ -278,6 +279,8 @@ class B2GMochitest(MochitestUtilsMixin):
leak_thresholds=options.leakThresholds,
ignore_missing_leaks=options.ignoreMissingLeaks,
log=self.log,
stack_fixer=get_stack_fixer_function(options.utilityPath,
options.symbolsPath),
)
except KeyboardInterrupt:
self.log.info("runtests.py | Received keyboard interrupt.\n")

View File

@ -5,7 +5,10 @@
import os
import re
import sys
import mozinfo
import mozrunner.utils
def _raw_log():
import logging
@ -13,7 +16,8 @@ def _raw_log():
def process_single_leak_file(leakLogFileName, processType, leakThreshold,
ignoreMissingLeaks, log=None):
ignoreMissingLeaks, log=None,
stackFixer=None):
"""Process a single leak log.
"""
@ -44,7 +48,8 @@ def process_single_leak_file(leakLogFileName, processType, leakThreshold,
matches = lineRe.match(line)
if not matches:
# eg: the leak table header row
log.info(line.rstrip())
strippedLine = line.rstrip()
log.info(stackFixer(strippedLine) if stackFixer else strippedLine)
continue
name = matches.group("name").rstrip()
size = int(matches.group("size"))
@ -136,7 +141,8 @@ def process_single_leak_file(leakLogFileName, processType, leakThreshold,
def process_leak_log(leak_log_file, leak_thresholds=None,
ignore_missing_leaks=None, log=None):
ignore_missing_leaks=None, log=None,
stack_fixer=None):
"""Process the leak log, including separate leak logs created
by child processes.
@ -206,4 +212,4 @@ def process_leak_log(leak_log_file, leak_thresholds=None,
leakThreshold = leakThresholds.get(processType, 0)
process_single_leak_file(thisFile, processType, leakThreshold,
processType in ignoreMissingLeaks,
log=log)
log=log, stackFixer=stack_fixer)