Commit 52749908 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[logging] Add process id to filename when logging per isolate.

When logging with --logfile-per-isolate, we use isolate addresses
to disambiguate. However, it often happens that the isolate addresses
are identical for different renderers, so we corrupt the log files.

This CL adds pid to the log filename when --logfile-per-isolate is on.

Bug: v8:8674
Change-Id: Id664b17d4dbaad2d805379dbe17ecbe08e4ae1f4
Reviewed-on: https://chromium-review.googlesource.com/c/1405853Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58746}
parent 9a149afc
...@@ -1869,10 +1869,12 @@ void Logger::LogAllMaps() { ...@@ -1869,10 +1869,12 @@ void Logger::LogAllMaps() {
static void AddIsolateIdIfNeeded(std::ostream& os, // NOLINT static void AddIsolateIdIfNeeded(std::ostream& os, // NOLINT
Isolate* isolate) { Isolate* isolate) {
if (FLAG_logfile_per_isolate) os << "isolate-" << isolate << "-"; if (FLAG_logfile_per_isolate) {
os << "isolate-" << isolate << "-" << base::OS::GetCurrentProcessId()
<< "-";
}
} }
static void PrepareLogFileName(std::ostream& os, // NOLINT static void PrepareLogFileName(std::ostream& os, // NOLINT
Isolate* isolate, const char* file_name) { Isolate* isolate, const char* file_name) {
int dir_separator_count = 0; int dir_separator_count = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment