Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4381)

Unified Diff: build/common.gypi

Issue 10411047: Type profiler by intercepting 'new' and 'delete' expressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflected maruel's comment. Ready for review. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index a8b5d7ec88fb962c7deee38422329c897b25b241..3803d414794bdbb0b15af7ec8d60a4120cb35136 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -253,6 +253,12 @@
# See http://clang.llvm.org/docs/ThreadSanitizer.html
'tsan%': 0,
+ # Use a modified version of Clang to intercept allocated types and sizes
+ # for allocated objects. clang_profiling_allocated_type=1 implies clang=1.
+ # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
+ # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
+ 'clang_profiling_allocated_type%': 0,
+
# Set to true to instrument the code with function call logger.
# See src/third_party/cygprofile/cyg-profile.cc for details.
'order_profiling%': 0,
@@ -585,6 +591,7 @@
'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
'asan%': '<(asan)',
'tsan%': '<(tsan)',
+ 'clang_profiling_allocated_type%': '<(clang_profiling_allocated_type)',
'order_profiling%': '<(order_profiling)',
'order_text_section%': '<(order_text_section)',
'enable_extensions%': '<(enable_extensions)',
@@ -1202,6 +1209,12 @@
'clang%': 1,
}],
+ ['OS=="linux" and clang_profiling_allocated_type==1', {
+ 'clang%': 1,
+ 'clang_use_chrome_plugins%': 0,
+ 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
+ }],
+
# On valgrind bots, override the optimizer settings so we don't inline too
# much and make the stacks harder to figure out.
#
@@ -1350,6 +1363,19 @@
],
},
'conditions': [
+ ['OS=="linux" and linux_use_tcmalloc==1 and clang_profiling_allocated_type==1', {
+ 'cflags_cc!': ['-fno-rtti'],
+ 'cflags_cc+': [
+ '-frtti',
+ '-gline-tables-only',
+ '-fintercept-allocation-functions',
+ '-include ../../base/allocator/allocated_type_profiler.h',
+ ],
+ 'defines': ['PROFILING_ALLOCATED_TYPE'],
+ 'dependencies': [
+ '<(DEPTH)/base/allocator/allocator.gyp:allocated_type_profiler',
+ ],
+ }],
['OS=="win" and "<(msbuild_toolset)"!=""', {
'msbuild_toolset': '<(msbuild_toolset)',
}],

Powered by Google App Engine
This is Rietveld 408576698