From ecebfae96f64e206178f1e56f6f6da1951f90ad7 Mon Sep 17 00:00:00 2001 From: ofrobots Date: Tue, 7 Jun 2016 06:28:21 -0700 Subject: [PATCH] deps: backport 2bcbe2f from V8 upstream Excessive buffering of perf map files in V8 could cause profiles to be missing symbols at times. Original commit message: switch perf and ll_prof loggers to line buffering BUG=v8:5015 R=jarin@chromium.org,yangguo@chromium.org Review-Url: https://codereview.chromium.org/2041243002 Cr-Commit-Position: refs/heads/master@{#36788} PR-URL: https://github.com/nodejs/node/pull/7814 Reviewed-By: bnoordhuis - Ben Noordhuis --- deps/v8z/include/v8-version.h | 2 +- deps/v8z/src/log.cc | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/deps/v8z/include/v8-version.h b/deps/v8z/include/v8-version.h index 06846eece12a..bf70f6dcdd13 100644 --- a/deps/v8z/include/v8-version.h +++ b/deps/v8z/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 4 #define V8_MINOR_VERSION 5 #define V8_BUILD_NUMBER 103 -#define V8_PATCH_LEVEL 41 +#define V8_PATCH_LEVEL 42 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8z/src/log.cc b/deps/v8z/src/log.cc index a9795b484621..d4804a3b4931 100644 --- a/deps/v8z/src/log.cc +++ b/deps/v8z/src/log.cc @@ -250,10 +250,6 @@ class PerfBasicLogger : public CodeEventLogger { static const char kFilenameFormatString[]; static const int kFilenameBufferPadding; - // File buffer size of the low-level log. We don't use the default to - // minimize the associated overhead. - static const int kLogBufferSize = 2 * MB; - FILE* perf_output_handle_; }; @@ -274,7 +270,7 @@ PerfBasicLogger::PerfBasicLogger() perf_output_handle_ = base::OS::FOpen(perf_dump_name.start(), base::OS::LogFileOpenMode); CHECK_NOT_NULL(perf_output_handle_); - setvbuf(perf_output_handle_, NULL, _IOFBF, kLogBufferSize); + setvbuf(perf_output_handle_, NULL, _IOLBF, 0); } @@ -361,10 +357,6 @@ class LowLevelLogger : public CodeEventLogger { // Extension added to V8 log file name to get the low-level log name. static const char kLogExt[]; - // File buffer size of the low-level log. We don't use the default to - // minimize the associated overhead. - static const int kLogBufferSize = 2 * MB; - void LogCodeInfo(); void LogWriteBytes(const char* bytes, int size); @@ -389,7 +381,7 @@ LowLevelLogger::LowLevelLogger(const char* name) MemCopy(ll_name.start() + len, kLogExt, sizeof(kLogExt)); ll_output_handle_ = base::OS::FOpen(ll_name.start(), base::OS::LogFileOpenMode); - setvbuf(ll_output_handle_, NULL, _IOFBF, kLogBufferSize); + setvbuf(ll_output_handle_, NULL, _IOLBF, 0); LogCodeInfo(); }