diff options
author | dmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-26 05:17:25 +0000 |
---|---|---|
committer | dmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-26 05:17:25 +0000 |
commit | 7ce58b29d323d6da838330661a80c67b7871734b (patch) | |
tree | 94b8367342219267b3fc3c91c82b0cbde532b784 /tools | |
parent | 75693935c15c7d02e3dc3ebe92d8d6a32f44e711 (diff) | |
download | chromium_src-7ce58b29d323d6da838330661a80c67b7871734b.zip chromium_src-7ce58b29d323d6da838330661a80c67b7871734b.tar.gz chromium_src-7ce58b29d323d6da838330661a80c67b7871734b.tar.bz2 |
Type profiler by intercepting 'new' and 'delete' expressions.
It stores mapping between object's starting addresses and their
allocated types when a build option 'clang_type_profiler=1' is
specified. It enables information like
"an object at 0x37f3c88 is an instance of std::string."
Nothing is changed when the option is not specified.
It depends on a modified version of the LLVM/Clang compiler
introduced at deps/third_party/llvm-allocated-type.
BUG=123758
TEST=build with clang_type_profiler=1 and run type_profiler_unittests and type_profiler_map_unittests manually.
Review URL: https://chromiumcodereview.appspot.com/10411047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158752 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/deep_memory_profiler/dmprof | 3 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.l0.txt | 3 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.l1.txt | 3 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.l2.txt | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/tools/deep_memory_profiler/dmprof b/tools/deep_memory_profiler/dmprof index 01cf480..77b1f31 100755 --- a/tools/deep_memory_profiler/dmprof +++ b/tools/deep_memory_profiler/dmprof @@ -550,7 +550,8 @@ class Dump(object): sum(self.counters[i] for i in removed)) if 'total-exclude-profiler' in sizes: sizes['total-exclude-profiler'] = ( - self.counters['total_committed'] - sizes['mmap-profiler']) + self.counters['total_committed'] - + (sizes['mmap-profiler'] + sizes['mmap-type-profiler'])) if 'hour' in sizes: sizes['hour'] = (self.dump_time - first_dump_time) / 60.0 / 60.0 if 'minute' in sizes: diff --git a/tools/deep_memory_profiler/policy.l0.txt b/tools/deep_memory_profiler/policy.l0.txt index 9cc2a373..bf55473 100644 --- a/tools/deep_memory_profiler/policy.l0.txt +++ b/tools/deep_memory_profiler/policy.l0.txt @@ -1,7 +1,8 @@ heap profile policy: POLICY_DEEP_2 -# Read policy.README for description of this file. +# Read README.policy for description of this file. second optional optional mmap-profiler mmap .*(ProfilerMalloc|MemoryRegionMap::).* +mmap-type-profiler mmap .*(TypeProfilerMalloc).* mmap-tcmalloc mmap .*(DoAllocWithArena|SbrkSysAllocator::Alloc|MmapSysAllocator::Alloc|LowLevelAlloc::Alloc|LowLevelAlloc::AllocWithArena).* FROM_HERE_FOR_TOTAL optional optional mustbezero optional optional diff --git a/tools/deep_memory_profiler/policy.l1.txt b/tools/deep_memory_profiler/policy.l1.txt index 606d408..ce20ce8 100644 --- a/tools/deep_memory_profiler/policy.l1.txt +++ b/tools/deep_memory_profiler/policy.l1.txt @@ -1,7 +1,8 @@ heap profile policy: POLICY_DEEP_2 -# Read policy.README for description of this file. +# Read README.policy for description of this file. second optional optional mmap-profiler mmap .*(ProfilerMalloc|MemoryRegionMap::).* +mmap-type-profiler mmap .*(TypeProfilerMalloc).* mmap-tcmalloc mmap .*(DoAllocWithArena|SbrkSysAllocator::Alloc|MmapSysAllocator::Alloc|LowLevelAlloc::Alloc|LowLevelAlloc::AllocWithArena).* FROM_HERE_FOR_TOTAL optional optional mustbezero optional optional diff --git a/tools/deep_memory_profiler/policy.l2.txt b/tools/deep_memory_profiler/policy.l2.txt index 85fa41f..9632aa7 100644 --- a/tools/deep_memory_profiler/policy.l2.txt +++ b/tools/deep_memory_profiler/policy.l2.txt @@ -1,7 +1,8 @@ heap profile policy: POLICY_DEEP_2 -# Read policy.README for description of this file. +# Read README.policy for description of this file. second optional optional mmap-profiler mmap .*(ProfilerMalloc|MemoryRegionMap::).* +mmap-type-profiler mmap .*(TypeProfilerMalloc).* mmap-tcmalloc mmap .*(DoAllocWithArena|SbrkSysAllocator::Alloc|MmapSysAllocator::Alloc|LowLevelAlloc::Alloc|LowLevelAlloc::AllocWithArena).* FROM_HERE_FOR_TOTAL optional optional mustbezero optional optional |