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

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

Issue 14773032: Revert 182659 "Get a filename of dumped heap profile in a V8 ext..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
« no previous file with comments | « trunk/src/third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/third_party/tcmalloc/chromium/src/heap-profiler.cc
===================================================================
--- trunk/src/third_party/tcmalloc/chromium/src/heap-profiler.cc (revision 200239)
+++ trunk/src/third_party/tcmalloc/chromium/src/heap-profiler.cc (working copy)
@@ -265,9 +265,7 @@
static void DeleteHook(const void* ptr);
// Helper for HeapProfilerDump.
-static void DumpProfileLocked(const char* reason,
- char* filename_buffer,
- size_t filename_buffer_length) {
+static void DumpProfileLocked(const char* reason) {
RAW_DCHECK(heap_lock.IsHeld(), "");
RAW_DCHECK(is_on, "");
RAW_DCHECK(!dumping, "");
@@ -277,17 +275,18 @@
dumping = true;
// Make file name
+ char file_name[1000];
dump_count++;
- snprintf(filename_buffer, filename_buffer_length, "%s.%05d.%04d%s",
+ snprintf(file_name, sizeof(file_name), "%s.%05d.%04d%s",
filename_prefix, getpid(), dump_count, HeapProfileTable::kFileExt);
// Dump the profile
- RAW_VLOG(0, "Dumping heap profile to %s (%s)", filename_buffer, reason);
+ RAW_VLOG(0, "Dumping heap profile to %s (%s)", file_name, reason);
// We must use file routines that don't access memory, since we hold
// a memory lock now.
- RawFD fd = RawOpenForWriting(filename_buffer);
+ RawFD fd = RawOpenForWriting(file_name);
if (fd == kIllegalRawFD) {
- RAW_LOG(ERROR, "Failed dumping heap profile to %s", filename_buffer);
+ RAW_LOG(ERROR, "Failed dumping heap profile to %s", file_name);
dumping = false;
return;
}
@@ -306,10 +305,10 @@
#if defined(TYPE_PROFILING)
if (FLAGS_heap_profile_type_statistics) {
- snprintf(filename_buffer, filename_buffer_length, "%s.%05d.%04d.type",
+ snprintf(file_name, sizeof(file_name), "%s.%05d.%04d.type",
filename_prefix, getpid(), dump_count);
- RAW_VLOG(0, "Dumping type statistics to %s", filename_buffer);
- heap_profile->DumpTypeStatistics(filename_buffer);
+ RAW_VLOG(0, "Dumping type statistics to %s", file_name);
+ heap_profile->DumpTypeStatistics(file_name);
}
#endif // defined(TYPE_PROFILING)
@@ -358,8 +357,7 @@
last_dump_time = current_time;
}
if (need_to_dump) {
- char filename_buffer[1000];
- DumpProfileLocked(buf, filename_buffer, sizeof(filename_buffer));
+ DumpProfileLocked(buf);
last_dump_alloc = total.alloc_size;
last_dump_free = total.free_size;
@@ -612,20 +610,10 @@
extern "C" void HeapProfilerDump(const char* reason) {
SpinLockHolder l(&heap_lock);
if (is_on && !dumping) {
- char filename_buffer[1000];
- DumpProfileLocked(reason, filename_buffer, sizeof(filename_buffer));
+ DumpProfileLocked(reason);
}
}
-extern "C" void HeapProfilerDumpWithFileName(const char* reason,
- char* dumped_filename_buffer,
- int filename_buffer_length) {
- SpinLockHolder l(&heap_lock);
- if (is_on && !dumping) {
- DumpProfileLocked(reason, dumped_filename_buffer, filename_buffer_length);
- }
-}
-
extern "C" void HeapProfilerMarkBaseline() {
SpinLockHolder l(&heap_lock);
« no previous file with comments | « trunk/src/third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698