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

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

Issue 14823009: Add the reason in heap profiler dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 7 years, 7 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: third_party/tcmalloc/chromium/src/deep-heap-profile.cc
diff --git a/third_party/tcmalloc/chromium/src/deep-heap-profile.cc b/third_party/tcmalloc/chromium/src/deep-heap-profile.cc
index f89d8ce90e3c7d8f267aa2222be281cb9319fefa..ab57a186d5f12ddc4c5263d4b7d66458e85bf1e2 100644
--- a/third_party/tcmalloc/chromium/src/deep-heap-profile.cc
+++ b/third_party/tcmalloc/chromium/src/deep-heap-profile.cc
@@ -229,7 +229,9 @@ DeepHeapProfile::~DeepHeapProfile() {
// Global malloc() should not be used in this function.
// Use LowLevelAlloc if required.
-int DeepHeapProfile::FillOrderedProfile(char raw_buffer[], int buffer_size) {
+int DeepHeapProfile::FillOrderedProfile(char raw_buffer[],
+ int buffer_size,
+ const char* reason) {
TextBuffer buffer(raw_buffer, buffer_size);
TextBuffer global_buffer(profiler_buffer_, kProfilerBufferSize);
@@ -275,6 +277,12 @@ int DeepHeapProfile::FillOrderedProfile(char raw_buffer[], int buffer_size) {
buffer.AppendUnsignedLong(time_value, 0);
buffer.AppendChar('\n');
+ if (reason != NULL) {
+ buffer.AppendString("Reason: ", 0);
+ buffer.AppendString(reason, 0);
+ buffer.AppendChar('\n');
+ }
+
// Fill buffer with the global stats.
buffer.AppendString(kMMapListHeader, 0);

Powered by Google App Engine
This is Rietveld 408576698