mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
report: expose report public native apis
Allows APM vendors to generate a diagnostic report without calling into JavaScript. Like, from their own message channels interrupting the isolate and generating a report on demand. PR-URL: https://github.com/nodejs/node/pull/44255 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
1 parent
b53ea08d7b
commit
381e11e18e
10 files changed
+404
-140
No files matched your search
+3
-14
@@ -411,8 +411,7 @@ static void ReportFatalException(Environment* env,
|
||||
}
|
||||
|
||||
if (env->isolate_data()->options()->report_uncaught_exception) {
|
||||
report::TriggerNodeReport(
|
||||
isolate, env, report_message.c_str(), "Exception", "", error);
|
||||
TriggerNodeReport(env, report_message.c_str(), "Exception", "", error);
|
||||
}
|
||||
|
||||
if (env->options()->trace_uncaught) {
|
||||
@@ -440,10 +439,6 @@ void OnFatalError(const char* location, const char* message) {
|
||||
}
|
||||
|
||||
Isolate* isolate = Isolate::TryGetCurrent();
|
||||
Environment* env = nullptr;
|
||||
if (isolate != nullptr) {
|
||||
env = Environment::GetCurrent(isolate);
|
||||
}
|
||||
bool report_on_fatalerror;
|
||||
{
|
||||
Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
|
||||
@@ -451,8 +446,7 @@ void OnFatalError(const char* location, const char* message) {
|
||||
}
|
||||
|
||||
if (report_on_fatalerror) {
|
||||
report::TriggerNodeReport(
|
||||
isolate, env, message, "FatalError", "", Local<Object>());
|
||||
TriggerNodeReport(isolate, message, "FatalError", "", Local<Object>());
|
||||
}
|
||||
|
||||
fflush(stderr);
|
||||
@@ -470,10 +464,6 @@ void OOMErrorHandler(const char* location, bool is_heap_oom) {
|
||||
}
|
||||
|
||||
Isolate* isolate = Isolate::TryGetCurrent();
|
||||
Environment* env = nullptr;
|
||||
if (isolate != nullptr) {
|
||||
env = Environment::GetCurrent(isolate);
|
||||
}
|
||||
bool report_on_fatalerror;
|
||||
{
|
||||
Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
|
||||
@@ -481,8 +471,7 @@ void OOMErrorHandler(const char* location, bool is_heap_oom) {
|
||||
}
|
||||
|
||||
if (report_on_fatalerror) {
|
||||
report::TriggerNodeReport(
|
||||
isolate, env, message, "OOMError", "", Local<Object>());
|
||||
TriggerNodeReport(isolate, message, "OOMError", "", Local<Object>());
|
||||
}
|
||||
|
||||
fflush(stderr);
|
||||
|
||||
Reference in new issue
Block a user