summaryrefslogtreecommitdiff
path: root/src/node_report.cc
AgeCommit message (Collapse)Author
2019-10-22src: remove unnecessary std::endl usageDaniel Bevenius
This commit removes a few std::endl that could be replaced by '\n' as it does not look like the buffer needs to be flushed in these places. This is only done in error handling, and once when the report has been generated, so this is very minor but I thought I'd bring it up in case it was overlooked. PR-URL: https://github.com/nodejs/node/pull/30003 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2019-10-21src: remove unused iomanip includeDaniel Bevenius
This commit removes the include of the IO manipulators header as I can't find that it is used anywhere. PR-URL: https://github.com/nodejs/node/pull/30004 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-08-11report: list envvars using uv_os_environ()cjihrig
This commit simplifies the diagnostic report's code for listing environment variables by using uv_os_environ() instead of platform specific code. PR-URL: https://github.com/nodejs/node/pull/28963 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-08-03report: include network interfaces in reportcjihrig
PR-URL: https://github.com/nodejs/node/pull/28911 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-29src: fix OpenBSD buildDavid Carlier
PR-URL: https://github.com/nodejs/node/pull/28384 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-25report: loop over uv_cpu_info() resultscjihrig
The code currently loops over the results, but only the first result is accessed. PR-URL: https://github.com/nodejs/node/pull/28829 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-05src: correct json writer placement in process.reporthimself65
PR-URL: https://github.com/nodejs/node/pull/28433 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-06-20report: add report versioningcjihrig
This commit adds a version to the diagnostic report feature. PR-URL: https://github.com/nodejs/node/pull/28121 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-06-15report: add cpu info to report outputChristopher Hiller
The report shows CPU consumption %, but without the number of CPU cores, a consumer cannot tell if the percent (given across all cores) is actually problematic. E.g., 100% on one CPU is a problem, but 100% on four CPUs is not necessarily. This change adds CPU information (similar to `os.cpus()`) to the report output. Extra info besides the count is also provided as to avoid future breaking changes in the eventuality that someone needs it; changing the datatype of `header.cpus` would be breaking. PR-URL: https://github.com/nodejs/node/pull/28188 Refs: https://github.com/nodejs/diagnostics/issues/307 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-05-26src: move DiagnosticFilename inlines into a -inl.hSam Roberts
DiagnosticFilename's constructor default values use inlines from env-inl.h, causing the many users of node_internals.h to include env-inl.h, even if they never use DiagnosticFilename. PR-URL: https://github.com/nodejs/node/pull/27839 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-05-23src: remove env-inl.h from header filesSam Roberts
Inline headers should only be included into the .cc files that use them. PR-URL: https://github.com/nodejs/node/pull/27755 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-05-11src: extract common macro to util.hgengjiawen
PR-URL: https://github.com/nodejs/node/pull/27512 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-05-01report: use const reference in node_report.ccgengjiawen
PR-URL: https://github.com/nodejs/node/pull/27479 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-04-22report: use uv_gettimeofday for dumpEventTimeStampcjihrig
dumpEventTimeStamp was not implemented on Windows, and did not include any error checking. This commit adds Windows support and error checking. PR-URL: https://github.com/nodejs/node/pull/27029 Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-04-19src: fix performance-faster-string-find in node_report.ccgengjiawen
PR-URL: https://github.com/nodejs/node/pull/27262 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-04-10src: always use diagnostic file sequence numbercjihrig
This commit attaches a sequence number to all filenames that are automatically generated by DiagnosticFilename. This prevents accidental overwriting of existing files. PR-URL: https://github.com/nodejs/node/pull/27142 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-04-02report: add cwd to reportcjihrig
The diagnostic report currently contains command line information, and the environment, which contains the PWD environment variable. This combination covers the majority of cases, but it would be useful to have the result of uv_cwd() as an additional data point. This commit adds that information. PR-URL: https://github.com/nodejs/node/pull/27022 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-03-22src: apply clang-tidy performance-faster-string-findgengjiawen
PR-URL: https://github.com/nodejs/node/pull/26812 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-20report: remove duplicate TIME_TYPEcjihrig
PR-URL: https://github.com/nodejs/node/pull/26708 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-17report: tidy up included headersRichard Lau
Remove inclusion of headers that are no longer required. PR-URL: https://github.com/nodejs/node/pull/26697 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2019-03-15report: use LocalTime from DiagnosticFilenameRichard Lau
PR-URL: https://github.com/nodejs/node/pull/26647 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-03-15report: use DiagnosticFilename for default filenameRichard Lau
PR-URL: https://github.com/nodejs/node/pull/26647 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-03-12src: de-lint header usageRefael Ackermann
PR-URL: https://github.com/nodejs/node/pull/26306 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-03-10report: fix stdout/stderr output formattingcjihrig
This commit prevents the report and "report complete" message from being printed on the same line. PR-URL: https://github.com/nodejs/node/pull/26522 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-07src: make parameter name const reference in method TriggerNodeReportgengjiawen
PR-URL: https://github.com/nodejs/node/pull/26397 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-04report: support RUSAGE_SELF stats on Windowscjihrig
This commit adds support for the resourceUsage report section on Windows by using uv_getrusage() instead of getrusage(). PR-URL: https://github.com/nodejs/node/pull/26406 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-03-03report: rename location to triggercjihrig
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 <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-03report: use triggerReport() to handle signalscjihrig
This commit uses the triggerReport() binding to handle signals and removes the custom onUserSignal() function. PR-URL: https://github.com/nodejs/node/pull/26386 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-28report: fix build warning in node_report.ccRichard Lau
Fixes `maybe-uninitialized` build warning in `src/node_report.cc`. PR-URL: https://github.com/nodejs/node/pull/26265 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-02-27src: apply clang-tidy rule modernize-deprecated-headersgengjiawen
PR-URL: https://github.com/nodejs/node/pull/26159 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-26report: use ru_stime for system CPU calculationcjihrig
PR-URL: https://github.com/nodejs/node/pull/26286 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-26report: simplify heap space iterationcjihrig
PR-URL: https://github.com/nodejs/node/pull/26285 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-20report: simplify TriggerNodeReport()cjihrig
PR-URL: https://github.com/nodejs/node/pull/26174 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-18src: unify uptime base used across the code baseJoyee Cheung
This patch joins `per_process::prog_start_time` (a double) and `performance::performance_node_start` (a uint64_t) into a `per_process::node_start_time` (a uint64_t) which gets initialized in `node::Start()`. PR-URL: https://github.com/nodejs/node/pull/26016 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-16src: use same parameter name in node_report.ccgengjiawen
PR-URL: https://github.com/nodejs/node/pull/26046 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-13os,report: use UV_MAXHOSTNAMESIZEcjihrig
UV_MAXHOSTNAMESIZE was introduced in libuv 1.26.0. Use this instead of including multiple header files, adding fallback ifdef logic, and remembering to add one to the buffer size for the terminating nul character with MAXHOSTNAMELEN. PR-URL: https://github.com/nodejs/node/pull/26038 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-12report: make more items programmatically accessibleAnna Henningsen
Prefer structured output over stringified information for libuv handles and the native stack trace. PR-URL: https://github.com/nodejs/node/pull/26019 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-06report: include information about event loop itselfAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/25906 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-05report: use libuv calls for OS and machine infocjihrig
PR-URL: https://github.com/nodejs/node/pull/25900 Fixes: https://github.com/nodejs/node/issues/25843 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-01report: separate release metadataRichard Lau
Report release metadata separately from `componentVersions`. Test `componentVersions` and `release` values in the report. PR-URL: https://github.com/nodejs/node/pull/25826 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-31report: disambiguate glibc versionscjihrig
- Give the glibc version entries more specific names. - Group all of the glibc version reporting together. PR-URL: https://github.com/nodejs/node/pull/25781 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-30report: use consistent format for dumpEventTimeAnna Henningsen
Use the same JS-compatible format on both POSIX and Windows. PR-URL: https://github.com/nodejs/node/pull/25751 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-01-30report: split up osVersion and machine valuescjihrig
Prior to this commit, on non-Windows platforms, the "osVersion" value was prepended to the "machine" value. PR-URL: https://github.com/nodejs/node/pull/25755 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-01-27report: represent numbers as numbersAnna Henningsen
Do not stringify numbers and boolean values when writing JSON. PR-URL: https://github.com/nodejs/node/pull/25651 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-01-27report: do not use `uv_default_loop()` as fallbackAnna Henningsen
Not seeing an associated `Environment` is a rare condition anyway, but using `uv_default_loop()` as a fallback is not thread-safe. PR-URL: https://github.com/nodejs/node/pull/25652 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-01-24report: roll extra loop iteration in `PrintNativeStack()`Anna Henningsen
PR-URL: https://github.com/nodejs/node/pull/25610 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-01-22report: simplify rlimit to JSON logiccjihrig
PR-URL: https://github.com/nodejs/node/pull/25597 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2019-01-22report: use uv_pid_t instead of custom PID_TYPEcjihrig
PR-URL: https://github.com/nodejs/node/pull/25597 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2019-01-18src: silence compiler warning in node_report.ccDaniel Bevenius
Currently the following compiler warnings is generated: ../src/node_report.cc:778:43: warning: format specifies type 'unsigned long' but the argument has type 'rlim_t' (aka 'unsigned long long') [-Wformat] snprintf(buf, sizeof(buf), "%lu", limit.rlim_max); ~~~ ^~~~~~~~~~~~~~ %llu 1 warning generated. This commit changes the format specifier to $llu. PR-URL: https://github.com/nodejs/node/pull/25557 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-01-18src: merge into coreGireesh Punathil
Make node-report part of core runtime because: 1. When enabled, node-report significantly helps root cause various types of problems, including support issues sent to the various repos of the Node.js organization. 2. The requirement of explicitly adding the dependency to node-report in user applications often represents a blocker to adoption. Major deviation from the module version of the node-report is that the report is generated in JSON format, as opposed to human readable text. No new functionalities have been added, changes that are required for melding it as a built-in capability has been affected on the module version of node-report (https://github.com/nodejs/node-report) Co-authored-by: Bidisha Pyne <bidipyne@in.ibm.com> Co-authored-by: Howard Hellyer <hhellyer@uk.ibm.com> Co-authored-by: Jeremiah Senkpiel <fishrock123@rocketmail.com> Co-authored-by: Julian Alimin <dmastag@yahoo.com> Co-authored-by: Lakshmi Swetha Gopireddy <lakshmigopireddy@in.ibm.com> Co-authored-by: Manusaporn Treerungroj <m.treerungroj@gmail.com> Co-authored-by: Michael Dawson <michael_dawson@ca.ibm.com> Co-authored-by: Richard Chamberlain <richard_chamberlain@uk.ibm.com> Co-authored-by: Richard Lau <riclau@uk.ibm.com> Co-authored-by: Sam Roberts <vieuxtech@gmail.com> Co-authored-by: Vipin Menon <vipinmv1@in.ibm.com> PR-URL: https://github.com/nodejs/node/pull/22712 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <Michael_Dawson@ca.ibm.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>