Chromium Code Reviews| 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, ""); |