Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report: remove InitializeReport() #25598

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 0 additions & 2 deletions src/node_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 3 additions & 13 deletions src/node_report_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand All @@ -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);
Expand Down