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

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

Issue 10832290: Dump /proc/<pid>/maps with every heap profile dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « third_party/tcmalloc/chromium/src/deep-heap-profile.h ('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/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 3577d04c92989b60bc4848ea31b70e96df744bed..ef73ff09e4774cd131b044cb8a6b84499be07ba3 100644
--- a/third_party/tcmalloc/chromium/src/deep-heap-profile.cc
+++ b/third_party/tcmalloc/chromium/src/deep-heap-profile.cc
@@ -91,8 +91,11 @@ int DeepHeapProfile::FillOrderedProfile(char buffer[], int buffer_size) {
}
// Write maps into a .maps file with using the global buffer.
- WriteMapsToFile(filename_prefix_, kProfilerBufferSize, profiler_buffer_);
+ WriteMapsToFile(filename_prefix_, 0,
Alexander Potapenko 2012/08/14 08:39:57 Why is this 0? If the process didn't call exec() y
Dai Mikurube (NOT FULLTIME) 2012/08/14 09:33:26 Data in /proc/<pid>/maps is used in this dumper "d
Alexander Potapenko 2012/08/14 09:36:47 Can you please prepend a comment to "0" so that th
+ kProfilerBufferSize, profiler_buffer_);
}
+ WriteMapsToFile(filename_prefix_, dump_count_,
Alexander Potapenko 2012/08/14 08:39:57 Are you going to write the mappings twice if most_
Dai Mikurube (NOT FULLTIME) 2012/08/14 09:33:26 Yes, I know normally "prefix.<pid>.maps" and "pref
+ kProfilerBufferSize, profiler_buffer_);
// Reset committed sizes of buckets.
ResetCommittedSize(deep_table_);
@@ -323,11 +326,18 @@ size_t DeepHeapProfile::GetCommittedSize(
// static
void DeepHeapProfile::WriteMapsToFile(const char* filename_prefix,
+ unsigned count,
int buffer_size,
char buffer[]) {
char filename[100];
- snprintf(filename, sizeof(filename),
- "%s.%05d.maps", filename_prefix, static_cast<int>(getpid()));
+ if (count > 0) {
+ snprintf(filename, sizeof(filename),
+ "%s.%05d.%04d.maps", filename_prefix, static_cast<int>(getpid()),
+ count);
+ } else {
+ snprintf(filename, sizeof(filename),
+ "%s.%05d.maps", filename_prefix, static_cast<int>(getpid()));
+ }
RawFD maps_fd = RawOpenForWriting(filename);
RAW_DCHECK(maps_fd != kIllegalRawFD, "");
« no previous file with comments | « third_party/tcmalloc/chromium/src/deep-heap-profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698