Index: base/allocator/allocator.gyp |
diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp |
index b85dd516dca2e20ba71e584b15e3b12272bc15c5..41940d7c12f744d7ada13a46aec4f571ffdedf7d 100644 |
--- a/base/allocator/allocator.gyp |
+++ b/base/allocator/allocator.gyp |
@@ -8,6 +8,19 @@ |
'tcmalloc_dir': '../../third_party/tcmalloc/chromium', |
'use_vtable_verify%': 0, |
}, |
+ 'target_defaults': { |
+ 'conditions': [ |
+ ['OS=="linux" and clang_profiling_allocated_type==1', { |
+ 'dependencies!': [ |
+ 'allocated_type_profiler', |
+ ], |
+ 'cflags_cc!': [ |
+ '-fintercept-allocation-functions', |
+ '-include ../../base/allocator/allocated_type_profiler.h', |
+ ], |
+ }], |
+ ], |
+ }, |
'targets': [ |
{ |
'target_name': 'allocator', |
@@ -303,6 +316,11 @@ |
}, |
}, |
'conditions': [ |
+ ['OS=="linux" and clang_profiling_allocated_type==1', { |
+ 'dependencies': [ |
+ 'allocated_type_profiler_tcmalloc', |
+ ], |
+ }], |
['OS=="win"', { |
'defines': [ |
'PERFTOOLS_DLL_DECL=', |
@@ -541,5 +559,40 @@ |
}, |
], |
}], |
+ ['OS=="linux" and clang_profiling_allocated_type==1', { |
+ 'targets': [ |
+ { |
+ 'target_name': 'allocated_type_profiler', |
+ 'type': 'static_library', |
+ 'include_dirs': [ |
+ '.', |
+ '<(tcmalloc_dir)/src/base', |
+ '<(tcmalloc_dir)/src', |
+ '../..', |
+ ], |
+ 'sources': [ |
+ 'allocated_type_profiler.cc', |
+ 'allocated_type_profiler.h', |
+ 'allocated_type_profiler_control.h', |
+ ], |
+ }, |
+ { |
+ 'target_name': 'allocated_type_profiler_tcmalloc', |
+ 'type': 'static_library', |
+ 'include_dirs': [ |
+ '.', |
+ '<(tcmalloc_dir)/src/base', |
+ '<(tcmalloc_dir)/src', |
+ '../..', |
+ ], |
+ 'sources': [ |
+ 'allocated_type_profiler_tcmalloc.cc', |
+ 'allocated_type_profiler_tcmalloc.h', |
+ '<(tcmalloc_dir)/src/allocated_type_map.cc', |
+ '<(tcmalloc_dir)/src/gperftools/allocated_type_map.h', |
+ ], |
+ }, |
+ ], |
+ }], |
], |
} |