Skip to content

Commit 4031b5c

Browse files
addaleaxtargos
authored andcommitted
report: remove InitializeReport()
PR-URL: #25598 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 0ebe6eb commit 4031b5c

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

src/node.cc

-6
Original file line numberDiff line numberDiff line change
@@ -728,12 +728,6 @@ void RunBootstrapping(Environment* env) {
728728
return;
729729
}
730730

731-
#ifdef NODE_REPORT
732-
if (env->options()->experimental_report) {
733-
report::InitializeReport(env->isolate(), env);
734-
}
735-
#endif // NODE_REPORT
736-
737731
// process, loaderExports, isMainThread
738732
std::vector<Local<String>> node_params = {
739733
env->process_string(),

src/node_report.h

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ typedef struct tm TIME_TYPE;
3838
#define PATHSEP "/"
3939
#endif
4040

41-
void InitializeReport(v8::Isolate* isolate, node::Environment* env);
42-
4341
// Function declarations - functions in src/node_report.cc
4442
std::string TriggerNodeReport(v8::Isolate* isolate,
4543
node::Environment* env,

src/node_report_module.cc

+3-13
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,6 @@ void OnUserSignal(const FunctionCallbackInfo<Value>& info) {
108108
isolate, env, *value, __func__, filename, info[0].As<String>());
109109
}
110110

111-
// Native module initializer function, called when the module is require'd
112-
void InitializeReport(Isolate* isolate, Environment* env) {
113-
// Register the boot time of the process, for
114-
// computing resource consumption average etc.
115-
std::shared_ptr<PerIsolateOptions> options = env->isolate_data()->options();
116-
117-
if (options->report_signal == "") options->report_signal = "SIGUSR2";
118-
}
119-
120111
// A method to sync up data elements in the JS land with its
121112
// corresponding elements in the C++ world. Required because
122113
// (i) the tunables are first intercepted through the CLI but
@@ -236,8 +227,9 @@ void SyncConfig(const FunctionCallbackInfo<Value>& info) {
236227
Local<Value> signal_value;
237228
Local<Value> file_value;
238229
Local<Value> path_value;
239-
if (!node::ToV8Value(context, options->report_signal)
240-
.ToLocal(&signal_value))
230+
std::string signal = options->report_signal;
231+
if (signal.empty()) signal = "SIGUSR2";
232+
if (!node::ToV8Value(context, signal).ToLocal(&signal_value))
241233
return;
242234
if (!obj->Set(context, signalkey, signal_value).FromJust()) return;
243235

@@ -264,8 +256,6 @@ static void Initialize(Local<Object> exports,
264256
Local<Context> context) {
265257
Environment* env = Environment::GetCurrent(context);
266258
std::shared_ptr<PerIsolateOptions> options = env->isolate_data()->options();
267-
Isolate* isolate = env->isolate();
268-
InitializeReport(isolate, env);
269259
env->SetMethod(exports, "triggerReport", TriggerReport);
270260
env->SetMethod(exports, "getReport", GetReport);
271261
env->SetMethod(exports, "onUnCaughtException", OnUncaughtException);

0 commit comments

Comments
 (0)