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

Unified Diff: third_party/tcmalloc/chromium/src/heap-profiler.cc

Issue 10830113: Dump type statistics of malloc'ed objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed Created 8 years, 2 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
« no previous file with comments | « third_party/tcmalloc/chromium/src/heap-profile-table.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/heap-profiler.cc
diff --git a/third_party/tcmalloc/chromium/src/heap-profiler.cc b/third_party/tcmalloc/chromium/src/heap-profiler.cc
index 1c5fcf088e297739303d400da5f3d198bff7087b..04704f26050ecffce71085b6c6c69157872ff481 100644
--- a/third_party/tcmalloc/chromium/src/heap-profiler.cc
+++ b/third_party/tcmalloc/chromium/src/heap-profiler.cc
@@ -125,6 +125,11 @@ DEFINE_bool(only_mmap_profile,
DEFINE_bool(deep_heap_profile,
EnvToBool("DEEP_HEAP_PROFILE", false),
"If heap-profiling is on, profile deeper (only on Linux)");
+#if defined(TYPE_PROFILING)
+DEFINE_bool(heap_profile_type_statistics,
+ EnvToBool("HEAP_PROFILE_TYPE_STATISTICS", false),
+ "If heap-profiling is on, dump type statistics.");
+#endif // defined(TYPE_PROFILING)
//----------------------------------------------------------------------
@@ -305,6 +310,15 @@ static void DumpProfileLocked(const char* reason) {
RawWrite(fd, profile, strlen(profile));
RawClose(fd);
+#if defined(TYPE_PROFILING)
+ if (FLAGS_heap_profile_type_statistics) {
+ snprintf(file_name, sizeof(file_name), "%s.%05d.%04d.type",
+ filename_prefix, getpid(), dump_count);
+ RAW_VLOG(0, "Dumping type statistics to %s", file_name);
+ heap_profile->DumpTypeStatistics(file_name);
+ }
+#endif // defined(TYPE_PROFILING)
+
dumping = false;
}
« no previous file with comments | « third_party/tcmalloc/chromium/src/heap-profile-table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698