Changeset 124579 in webkit


Ignore:
Timestamp:
Aug 3, 2012 1:04:39 AM (12 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: clang plugin for checking native memory instrumentation coverage.
https://bugs.webkit.org/show_bug.cgi?id=92650

Reviewed by Yury Semikhatsky.

This is the clang plugin for checking native memory instrumentation coverage.
The idea: InspectorMemoryAgent traverses through instrumented objects and collects pointers and their sizes and types.
It is doing that with help of reportMemoryUsage function that needs to be implemented in each, significant
from native memory footprint point of view, WebCore class.
This plugin checks that the list of class members is matching with the list of members reported in reportMemoryUsage function
and makes a warning for the each member that needs to be reported.

  • clang/ReportMemoryUsagePlugin/CMakeLists.txt: Added.
  • clang/ReportMemoryUsagePlugin/Makefile: Added.
  • clang/ReportMemoryUsagePlugin/ReportMemoryUsage.cpp: Added.

(clang):
(AddMemberCallVisitor):
(clang::AddMemberCallVisitor::VisitCallExpr):
(clang::AddMemberCallVisitor::instrumentedMembers):
(ReportMemoryUsageVisitor):
(clang::ReportMemoryUsageVisitor::ReportMemoryUsageVisitor):
(clang::ReportMemoryUsageVisitor::VisitCXXMethodDecl):
(clang::ReportMemoryUsageVisitor::emitWarning):
(clang::ReportMemoryUsageVisitor::findInstrumentationMethod):
(clang::ReportMemoryUsageVisitor::needsToBeInstrumented):
(clang::ReportMemoryUsageVisitor::CheckMembersCoverage):
(ReportMemoryUsageConsumer):
(clang::ReportMemoryUsageConsumer::ReportMemoryUsageConsumer):
(clang::ReportMemoryUsageConsumer::HandleTranslationUnit):
(ReportMemoryUsageAction):
(clang::ReportMemoryUsageAction::CreateASTConsumer):
(clang::ReportMemoryUsageAction::ParseArgs):

  • clang/ReportMemoryUsagePlugin/tests/Source/WebCore/Test.cpp: Added.

(aNamespace):
(MemoryInstrumentation):
(MemoryClassInfo):
(aNamespace::MemoryClassInfo::MemoryClassInfo):
(aNamespace::MemoryClassInfo::addMember):
(aNamespace::MemoryClassInfo::addInstrumentedMember):
(OwnPtr):
(aNamespace::OwnPtr::OwnPtr):
(RefPtr):
(aNamespace::RefPtr::RefPtr):
(Vector):
(String):
(NotInstrumentedClass):
(InstrumentedClass):
(aNamespace::InstrumentedClass::reportMemoryUsage):
(InstrumentedChildClass):
(aNamespace::InstrumentedChildClass::reportMemoryUsage):
(InstrumentedChildChildClass):
(InstrumentedChildChildClass::reportMemoryUsage):
(main):

Location:
trunk/Tools
Files:
9 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r124569 r124579  
     12012-08-03  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: clang plugin for checking native memory instrumentation coverage.
     4        https://bugs.webkit.org/show_bug.cgi?id=92650
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        This is the clang plugin for checking native memory instrumentation coverage.
     9        The idea: InspectorMemoryAgent traverses through instrumented objects and collects pointers and their sizes and types.
     10        It is doing that with help of reportMemoryUsage function that needs to be implemented in each, significant
     11        from native memory footprint point of view, WebCore class.
     12        This plugin checks that the list of class members is matching with the list of members reported in reportMemoryUsage function
     13        and makes a warning for the each member that needs to be reported.
     14
     15        * clang/ReportMemoryUsagePlugin/CMakeLists.txt: Added.
     16        * clang/ReportMemoryUsagePlugin/Makefile: Added.
     17        * clang/ReportMemoryUsagePlugin/ReportMemoryUsage.cpp: Added.
     18        (clang):
     19        (AddMemberCallVisitor):
     20        (clang::AddMemberCallVisitor::VisitCallExpr):
     21        (clang::AddMemberCallVisitor::instrumentedMembers):
     22        (ReportMemoryUsageVisitor):
     23        (clang::ReportMemoryUsageVisitor::ReportMemoryUsageVisitor):
     24        (clang::ReportMemoryUsageVisitor::VisitCXXMethodDecl):
     25        (clang::ReportMemoryUsageVisitor::emitWarning):
     26        (clang::ReportMemoryUsageVisitor::findInstrumentationMethod):
     27        (clang::ReportMemoryUsageVisitor::needsToBeInstrumented):
     28        (clang::ReportMemoryUsageVisitor::CheckMembersCoverage):
     29        (ReportMemoryUsageConsumer):
     30        (clang::ReportMemoryUsageConsumer::ReportMemoryUsageConsumer):
     31        (clang::ReportMemoryUsageConsumer::HandleTranslationUnit):
     32        (ReportMemoryUsageAction):
     33        (clang::ReportMemoryUsageAction::CreateASTConsumer):
     34        (clang::ReportMemoryUsageAction::ParseArgs):
     35        * clang/ReportMemoryUsagePlugin/tests/Source/WebCore/Test.cpp: Added.
     36        (aNamespace):
     37        (MemoryInstrumentation):
     38        (MemoryClassInfo):
     39        (aNamespace::MemoryClassInfo::MemoryClassInfo):
     40        (aNamespace::MemoryClassInfo::addMember):
     41        (aNamespace::MemoryClassInfo::addInstrumentedMember):
     42        (OwnPtr):
     43        (aNamespace::OwnPtr::OwnPtr):
     44        (RefPtr):
     45        (aNamespace::RefPtr::RefPtr):
     46        (Vector):
     47        (String):
     48        (NotInstrumentedClass):
     49        (InstrumentedClass):
     50        (aNamespace::InstrumentedClass::reportMemoryUsage):
     51        (InstrumentedChildClass):
     52        (aNamespace::InstrumentedChildClass::reportMemoryUsage):
     53        (InstrumentedChildChildClass):
     54        (InstrumentedChildChildClass::reportMemoryUsage):
     55        (main):
     56
    1572012-08-03  Joone Hur  <joone.hur@intel.com>
    258
Note: See TracChangeset for help on using the changeset viewer.