report: remove InitializeReport()

PR-URL: https://github.com/nodejs/node/pull/25598
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
Anna Henningsen 2019-01-21 01:17:28 +01:00
parent eeea0dd1e7
commit a8d763adf2
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9
3 changed files with 3 additions and 21 deletions

View File

@ -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<Local<String>> node_params = {
env->process_string(),

View File

@ -38,8 +38,6 @@ typedef struct tm TIME_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,

View File

@ -108,15 +108,6 @@ void OnUserSignal(const FunctionCallbackInfo<Value>& info) {
isolate, env, *value, __func__, filename, info[0].As<String>());
}
// 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<PerIsolateOptions> 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<Value>& info) {
Local<Value> signal_value;
Local<Value> file_value;
Local<Value> 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<Object> exports,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
std::shared_ptr<PerIsolateOptions> 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);