diff --git a/src/env-inl.h b/src/env-inl.h index f970e414f12ea8..02c335a02d4c8d 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -465,7 +465,7 @@ inline void Environment::set_printed_error(bool value) { } inline void Environment::set_trace_sync_io(bool value) { - options_->trace_sync_io = value; + trace_sync_io_ = value; } inline bool Environment::abort_on_uncaught_exception() const { diff --git a/src/env.cc b/src/env.cc index f0ac855e3d8326..719e444ec2d458 100644 --- a/src/env.cc +++ b/src/env.cc @@ -567,7 +567,7 @@ void Environment::StopProfilerIdleNotifier() { } void Environment::PrintSyncTrace() const { - if (!options_->trace_sync_io) return; + if (!trace_sync_io_) return; HandleScope handle_scope(isolate()); diff --git a/src/env.h b/src/env.h index 5ffefde5cec1a8..d8495a5efa34c7 100644 --- a/src/env.h +++ b/src/env.h @@ -1272,6 +1272,7 @@ class Environment : public MemoryRetainer { const uint64_t timer_base_; std::shared_ptr env_vars_; bool printed_error_ = false; + bool trace_sync_io_ = false; bool emit_env_nonstring_warning_ = true; bool emit_err_name_warning_ = true; size_t async_callback_scope_depth_ = 0; diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc index 5d5a48cc36a54b..05ff8d55267511 100644 --- a/src/node_main_instance.cc +++ b/src/node_main_instance.cc @@ -111,6 +111,8 @@ int NodeMainInstance::Run() { env->async_hooks()->pop_async_id(1); } + env->set_trace_sync_io(env->options()->trace_sync_io); + { SealHandleScope seal(isolate_); bool more;