From abd2a72d98105915c8187589f0b9c6cb4be2aedb Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 21 Jan 2019 01:17:28 +0100 Subject: [PATCH] report: remove `InitializeReport()` --- src/node.cc | 6 ------ src/node_report.h | 2 -- src/node_report_module.cc | 16 +++------------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/node.cc b/src/node.cc index 2766654e9a06b9..9637312837306b 100644 --- a/src/node.cc +++ b/src/node.cc @@ -737,12 +737,6 @@ void RunBootstrapping(Environment* env) { return; } -#ifdef NODE_REPORT - if (env->options()->experimental_report) { - report::InitializeReport(env->isolate(), env); - } -#endif // NODE_REPORT - // process, loaderExports, isMainThread std::vector> node_params = { env->process_string(), diff --git a/src/node_report.h b/src/node_report.h index c64b9c9a20c116..7c3bf2856505b0 100644 --- a/src/node_report.h +++ b/src/node_report.h @@ -40,8 +40,6 @@ typedef pid_t PID_TYPE; #define PATHSEP "/" #endif -void InitializeReport(v8::Isolate* isolate, node::Environment* env); - // Function declarations - functions in src/node_report.cc std::string TriggerNodeReport(v8::Isolate* isolate, node::Environment* env, diff --git a/src/node_report_module.cc b/src/node_report_module.cc index 522cf43a4516dd..d13eb61c83820a 100644 --- a/src/node_report_module.cc +++ b/src/node_report_module.cc @@ -108,15 +108,6 @@ void OnUserSignal(const FunctionCallbackInfo& info) { isolate, env, *value, __func__, filename, info[0].As()); } -// Native module initializer function, called when the module is require'd -void InitializeReport(Isolate* isolate, Environment* env) { - // Register the boot time of the process, for - // computing resource consumption average etc. - std::shared_ptr options = env->isolate_data()->options(); - - if (options->report_signal == "") options->report_signal = "SIGUSR2"; -} - // A method to sync up data elements in the JS land with its // corresponding elements in the C++ world. Required because // (i) the tunables are first intercepted through the CLI but @@ -236,8 +227,9 @@ void SyncConfig(const FunctionCallbackInfo& info) { Local signal_value; Local file_value; Local path_value; - if (!node::ToV8Value(context, options->report_signal) - .ToLocal(&signal_value)) + std::string signal = options->report_signal; + if (signal.empty()) signal = "SIGUSR2"; + if (!node::ToV8Value(context, signal).ToLocal(&signal_value)) return; if (!obj->Set(context, signalkey, signal_value).FromJust()) return; @@ -264,8 +256,6 @@ static void Initialize(Local exports, Local context) { Environment* env = Environment::GetCurrent(context); std::shared_ptr options = env->isolate_data()->options(); - Isolate* isolate = env->isolate(); - InitializeReport(isolate, env); env->SetMethod(exports, "triggerReport", TriggerReport); env->SetMethod(exports, "getReport", GetReport); env->SetMethod(exports, "onUnCaughtException", OnUncaughtException);