From 5f67c2aa8ac51fe58c7ebd7766852c858e81a0b5 Mon Sep 17 00:00:00 2001 From: "timurrrr@chromium.org" Date: Thu, 6 Oct 2011 15:21:16 +0000 Subject: Print out the list of used Dr. Memory suppressions at the end of the run. TBR=bruening Review URL: http://codereview.chromium.org/8173003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104301 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/valgrind/drmemory_analyze.py | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'tools/valgrind/drmemory_analyze.py') diff --git a/tools/valgrind/drmemory_analyze.py b/tools/valgrind/drmemory_analyze.py index 34df08b..3a819fa 100755 --- a/tools/valgrind/drmemory_analyze.py +++ b/tools/valgrind/drmemory_analyze.py @@ -36,7 +36,7 @@ class DrMemoryAnalyze: ''' self.reports = [] - self.used_suppressions = {} + self.used_suppressions = [] for file in files: self.ParseReportFile(file) @@ -57,10 +57,9 @@ class DrMemoryAnalyze: while True: self.ReadLine() - if (self.line_ == ''): - break - if re.search("FINAL SUMMARY", self.line_): - # DrMemory has finished working. + if (self.line_ == ''): break + if re.search("FINAL SUMMARY:", self.line_): + # No more reports since this point. break tmp = [] match = re.search("^Error #[0-9]+: (.*)", self.line_) @@ -71,12 +70,34 @@ class DrMemoryAnalyze: elif self.line_.startswith("ASSERT FAILURE"): self.reports.append(self.line_.strip()) + while True: + self.ReadLine(); + if (self.line_ == ''): break + + if re.search("SUPPRESSIONS USED:", self.line_): + self.ReadLine() + while self.line_.strip() != "": + # TODO(timurrrr): use Valgrind format so the suppression dashboard + # counts used DrM suppressions too. + self.used_suppressions.append(self.line_.strip()) + self.ReadLine() + break + self.cur_fd_.close() def Report(self, check_sanity): sys.stdout.flush() #TODO(timurrrr): support positive tests / check_sanity==True + if self.used_suppressions: + print "-----------------------------------------------------" + # TODO(timurrrr): sum up the counts from different wrappers (e.g. ui_tests) + # or does it work now already? Or add the memcheck-like per-test printing. + print "Suppressions used:\n count name\n ", # , adds ' ' instead of '\n' + print "\n ".join(self.used_suppressions) + print "-----------------------------------------------------" + sys.stdout.flush() + if len(self.reports) > 0: logging.error("Found %i error reports" % len(self.reports)) for report_list in self.reports: -- cgit v1.1