Revert "[log][d8] Only use d8.log.getAndStop on temporary log file"

This reverts commit 21bb43cc6a.

Reason for revert: See broken build: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20-%20builder/49882

Original change's description:
> [log][d8] Only use d8.log.getAndStop on temporary log file
> 
> We run tests in parallel which can cause multiple tests to write to
> the shared v8.log file. This obviously breaks the simple assertions in
> mjsunit/tools/log.js.
> 
> - Use temporary files for log testing with --logfile='+'
> 
> - Change the symbol from '&' to '+' for using temporary files for
>   logging with --logfile
> 
> - Enable skipped log tests again.
> 
> Bug: v8:10937, chromium:1129854, chromium:1130196
> Change-Id: I607dc9a9ecc352e58525cdd21c1c93efebf0f09f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2421826
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70071}

TBR=cbruni@chromium.org,verwaest@chromium.org,victorgomes@chromium.org

Change-Id: I5de61792c283139b2a898334e28e1f7b2d7c08f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10937
Bug: chromium:1129854
Bug: chromium:1130196
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2424625
Reviewed-by: Francis McCabe <fgm@chromium.org>
Commit-Queue: Francis McCabe <fgm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70072}
This commit is contained in:
Francis McCabe 2020-09-22 18:57:45 +00:00 committed by Commit Bot
parent 21bb43cc6a
commit ec570b8a80
5 changed files with 9 additions and 7 deletions

View File

@ -1511,8 +1511,8 @@ void Shell::LogGetAndStop(const v8::FunctionCallbackInfo<v8::Value>& args) {
HandleScope handle_scope(isolate);
std::string file_name = i_isolate->logger()->file_name();
if (!i::Log::IsLoggingToTemporaryFile(file_name)) {
Throw(isolate, "Only capturing from temporary files is supported.");
if (i::Log::IsLoggingToConsole(file_name)) {
Throw(isolate, "Logging to console instead of file.");
return;
}
if (!i_isolate->logger()->is_logging()) {

View File

@ -1660,9 +1660,7 @@ DEFINE_BOOL(trace_wasm_gdb_remote, false, "trace Webassembly GDB-remote server")
#define FLAG FLAG_FULL
// log.cc
DEFINE_STRING(logfile, "v8.log",
"Specify the name of the log file, use '-' for console, '+' for "
"a temporary file.")
DEFINE_STRING(logfile, "v8.log", "Specify the name of the log file.")
DEFINE_BOOL(logfile_per_isolate, true, "Separate log files for each isolate.")
DEFINE_BOOL(log, false,

View File

@ -19,7 +19,7 @@
namespace v8 {
namespace internal {
const char* const Log::kLogToTemporaryFile = "+";
const char* const Log::kLogToTemporaryFile = "&";
const char* const Log::kLogToConsole = "-";
// static

View File

@ -182,6 +182,10 @@
# Needs to be adapted after changes to Function constructor. chromium:1065094
'cross-realm-filtering': [SKIP],
# https://crbug.com/v8/10937
# https://crbug.com/1129854
'tools/log': [SKIP],
}], # ALWAYS
##############################################################################

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --logfile='+' --log-all --log --no-stress-opt
// Flags: --log-all --log --no-stress-opt
function testFunctionWithFunnyName(o) {
return o.a;