From 31be55203fd220142cdefdf957a5a71374c07876 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 1 Mar 2019 19:15:38 -0500 Subject: report: rename location to trigger trigger more accurately describes the use of the field. Previously, location was just the name of the C++ function that called TriggerNodeReport(). PR-URL: https://github.com/nodejs/node/pull/26386 Reviewed-By: Richard Lau Reviewed-By: James M Snell --- src/node_report.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/node_report.cc') diff --git a/src/node_report.cc b/src/node_report.cc index 4617fb6271..85c66a51bf 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -70,7 +70,7 @@ using v8::Value; static void WriteNodeReport(Isolate* isolate, Environment* env, const char* message, - const char* location, + const char* trigger, const std::string& filename, std::ostream& out, Local stackstr, @@ -79,7 +79,7 @@ static void PrintVersionInformation(JSONWriter* writer); static void PrintJavaScriptStack(JSONWriter* writer, Isolate* isolate, Local stackstr, - const char* location); + const char* trigger); static void PrintNativeStack(JSONWriter* writer); #ifndef _WIN32 static void PrintResourceUsage(JSONWriter* writer); @@ -100,7 +100,7 @@ static std::atomic_int seq = {0}; // sequence number for report filenames std::string TriggerNodeReport(Isolate* isolate, Environment* env, const char* message, - const char* location, + const char* trigger, std::string name, Local stackstr) { std::ostringstream oss; @@ -178,7 +178,7 @@ std::string TriggerNodeReport(Isolate* isolate, << "Writing Node.js report to file: " << filename << std::endl; } - WriteNodeReport(isolate, env, message, location, filename, *outstream, + WriteNodeReport(isolate, env, message, trigger, filename, *outstream, stackstr, &tm_struct); // Do not close stdout/stderr, only close files we opened. @@ -194,14 +194,14 @@ std::string TriggerNodeReport(Isolate* isolate, void GetNodeReport(Isolate* isolate, Environment* env, const char* message, - const char* location, + const char* trigger, Local stackstr, std::ostream& out) { // Obtain the current time and the pid (platform dependent) TIME_TYPE tm_struct; LocalTime(&tm_struct); WriteNodeReport( - isolate, env, message, location, "", out, stackstr, &tm_struct); + isolate, env, message, trigger, "", out, stackstr, &tm_struct); } // Internal function to coordinate and write the various @@ -209,7 +209,7 @@ void GetNodeReport(Isolate* isolate, static void WriteNodeReport(Isolate* isolate, Environment* env, const char* message, - const char* location, + const char* trigger, const std::string& filename, std::ostream& out, Local stackstr, @@ -228,7 +228,7 @@ static void WriteNodeReport(Isolate* isolate, writer.json_objectstart("header"); writer.json_keyvalue("event", message); - writer.json_keyvalue("location", location); + writer.json_keyvalue("trigger", trigger); if (!filename.empty()) writer.json_keyvalue("filename", filename); else @@ -280,7 +280,7 @@ static void WriteNodeReport(Isolate* isolate, writer.json_objectend(); // Report summary JavaScript stack backtrace - PrintJavaScriptStack(&writer, isolate, stackstr, location); + PrintJavaScriptStack(&writer, isolate, stackstr, trigger); // Report native stack backtrace PrintNativeStack(&writer); @@ -372,12 +372,12 @@ static void PrintVersionInformation(JSONWriter* writer) { static void PrintJavaScriptStack(JSONWriter* writer, Isolate* isolate, Local stackstr, - const char* location) { + const char* trigger) { writer->json_objectstart("javascriptStack"); std::string ss; - if ((!strcmp(location, "OnFatalError")) || - (!strcmp(location, "Signal"))) { + if ((!strcmp(trigger, "FatalError")) || + (!strcmp(trigger, "Signal"))) { ss = "No stack.\nUnavailable.\n"; } else { String::Utf8Value sv(isolate, stackstr); -- cgit v1.2.3