diff options
-rw-r--r-- | third_party/tcmalloc/chromium/src/base/sysinfo.cc | 5 | ||||
-rw-r--r-- | third_party/tcmalloc/chromium/src/heap-profiler.cc | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/third_party/tcmalloc/chromium/src/base/sysinfo.cc b/third_party/tcmalloc/chromium/src/base/sysinfo.cc index 7af0495..adb2072 100644 --- a/third_party/tcmalloc/chromium/src/base/sysinfo.cc +++ b/third_party/tcmalloc/chromium/src/base/sysinfo.cc @@ -176,6 +176,9 @@ const char* GetenvBeforeMain(const char* name) { // in their first character! If that assumption is violated, we'll // still get a profile, but one with an unexpected name. // TODO(csilvers): set an envvar instead when we can do it reliably. +// +// In Chromium this hack is intentionally disabled, because the path is not +// re-initialized upon fork. bool GetUniquePathFromEnv(const char* env_name, char* path) { char* envval = getenv(env_name); if (envval == NULL || *envval == '\0') @@ -185,7 +188,9 @@ bool GetUniquePathFromEnv(const char* env_name, char* path) { envval[0] & 127, envval+1, (unsigned int)(getpid())); } else { snprintf(path, PATH_MAX, "%s", envval); +#if 0 envval[0] |= 128; // set high bit for kids to see +#endif } return true; } diff --git a/third_party/tcmalloc/chromium/src/heap-profiler.cc b/third_party/tcmalloc/chromium/src/heap-profiler.cc index 3055f4ce..d40d4ea 100644 --- a/third_party/tcmalloc/chromium/src/heap-profiler.cc +++ b/third_party/tcmalloc/chromium/src/heap-profiler.cc @@ -258,8 +258,8 @@ static void DumpProfileLocked(const char* reason) { // Make file name char file_name[1000]; dump_count++; - snprintf(file_name, sizeof(file_name), "%s.%04d%s", - filename_prefix, dump_count, HeapProfileTable::kFileExt); + 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)", file_name, reason); |