diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-26 18:12:45 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-26 18:12:45 +0000 |
commit | 2c2eed3469532e2b0f7c705a858da8cdfecbb609 (patch) | |
tree | 4ff6f4d8278c3fc3fdcf5531a748063b2b5ad1ae /tools | |
parent | a37f1a7d7c5b1df7266613847c09dace68eb7c12 (diff) | |
download | chromium_src-2c2eed3469532e2b0f7c705a858da8cdfecbb609.zip chromium_src-2c2eed3469532e2b0f7c705a858da8cdfecbb609.tar.gz chromium_src-2c2eed3469532e2b0f7c705a858da8cdfecbb609.tar.bz2 |
Valgrind: Improve the presubmit check for memcheck suppressions.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3038023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/heapcheck/suppressions.txt | 34 | ||||
-rwxr-xr-x | tools/valgrind/memcheck/PRESUBMIT.py | 32 | ||||
-rw-r--r-- | tools/valgrind/memcheck/suppressions.txt | 33 |
3 files changed, 58 insertions, 41 deletions
diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt index ac07700..7d43cb0 100644 --- a/tools/heapcheck/suppressions.txt +++ b/tools/heapcheck/suppressions.txt @@ -418,7 +418,39 @@ fun:::RunTest_EnsureTaskDeletion* fun:MessageLoopTest_*EnsureTaskDeletion_*::TestBody } - +{ + Bug_45263_ForMisterStatistics + Heapcheck:Leak + ... + fun:LinearHistogram::FactoryGet + fun:ClientSocketPoolHistograms + fun:HttpNetworkSession + fun:net::HttpNetworkLayer::GetSession + fun:net::HttpNetworkLayer::CreateTransaction + fun:net::HttpCache::Transaction::DoSendRequest + fun:net::HttpCache::Transaction::DoLoop + fun:net::HttpCache::Transaction::Start + fun:URLRequestHttpJob::StartTransaction + fun:URLRequestHttpJob::OnCanGetCookiesCompleted + fun:URLRequestHttpJob::AddCookieHeaderAndStart + fun:URLRequestHttpJob::Start + fun:URLRequest::StartJob + fun:URLRequest::Start + fun:HTTPTestServer::StartGETRequest + fun:void DispatchToFunction + fun:RunnableFunction::Run + fun:MessageLoop::RunTask + fun:MessageLoop::DeferOrRunPendingTask + fun:MessageLoop::DoWork + fun:base::MessagePumpLibevent::Run + fun:MessageLoop::RunInternal + fun:MessageLoop::RunHandler + fun:MessageLoop::Run + fun:base::Thread::Run + fun:base::Thread::ThreadMain + fun:ThreadFunc + fun:start_thread +} { bug_46571_a Heapcheck:Leak diff --git a/tools/valgrind/memcheck/PRESUBMIT.py b/tools/valgrind/memcheck/PRESUBMIT.py index dd9861c..b026139 100755 --- a/tools/valgrind/memcheck/PRESUBMIT.py +++ b/tools/valgrind/memcheck/PRESUBMIT.py @@ -1,4 +1,4 @@ -# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -8,14 +8,32 @@ for more details on the presubmit API built into gcl. """ def CheckChange(input_api, output_api): - """Checks that the user didn't paste 'Suppression:' into the file""" - keyword = 'Suppression:' + """Checks the memcheck suppressions files for bad data.""" + errors = [] + skip_next_line = False + func_re = input_api.re.compile('[a-z_.]+\(.+\)$') for f, line_num, line in input_api.RightHandSideLines(lambda x: x.LocalPath().endswith('.txt')): - if keyword in line: - text = '"%s" must not be included; %s line %s' % ( - keyword, f.LocalPath(), line_num) - return [output_api.PresubmitError(text)] + line = line.lstrip() + if line.startswith('#') or not line: + continue + + if skip_next_line: + skip_next_line = False + continue + if (line.startswith('fun:') or line.startswith('obj:') or + line.startswith('Memcheck:') or line == '}' or + line == '...'): + continue + if func_re.match(line): + continue + if line == '{': + skip_next_line = True + continue + errors.append('"%s" is probably wrong: %s line %s' % (line, f.LocalPath(), + line_num)) + if errors: + return [output_api.PresubmitError('\n'.join(errors))] return [] def CheckChangeOnUpload(input_api, output_api): diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index 8b136b1..f7792af 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt @@ -3037,39 +3037,6 @@ fun:main } { - Bug_45263_ForMisterStatistics - Heapcheck:Leak - ... - fun:LinearHistogram::FactoryGet - fun:ClientSocketPoolHistograms - fun:HttpNetworkSession - fun:net::HttpNetworkLayer::GetSession - fun:net::HttpNetworkLayer::CreateTransaction - fun:net::HttpCache::Transaction::DoSendRequest - fun:net::HttpCache::Transaction::DoLoop - fun:net::HttpCache::Transaction::Start - fun:URLRequestHttpJob::StartTransaction - fun:URLRequestHttpJob::OnCanGetCookiesCompleted - fun:URLRequestHttpJob::AddCookieHeaderAndStart - fun:URLRequestHttpJob::Start - fun:URLRequest::StartJob - fun:URLRequest::Start - fun:HTTPTestServer::StartGETRequest - fun:void DispatchToFunction - fun:RunnableFunction::Run - fun:MessageLoop::RunTask - fun:MessageLoop::DeferOrRunPendingTask - fun:MessageLoop::DoWork - fun:base::MessagePumpLibevent::Run - fun:MessageLoop::RunInternal - fun:MessageLoop::RunHandler - fun:MessageLoop::Run - fun:base::Thread::Run - fun:base::Thread::ThreadMain - fun:ThreadFunc - fun:start_thread -} -{ Bug_45301_UnknownOwner Memcheck:Leak fun:_Znw* |