mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
report: fix typos in report keys and bump the version
Replace "kbytes" with "bytes" in `PrintSystemInformation()` in `src/node_report.cc`, as RLIMIT_DATA, RLIMIT_RSS, and RLIMIT_AS are given in bytes. The report version is bumped from 4 to 5. Refs: https://www.ibm.com/docs/en/aix/7.3?topic=k-kgetrlimit64-kernel-service PR-URL: https://github.com/nodejs/node/pull/56068 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
@@ -35,7 +35,7 @@ is provided below for reference.
|
||||
```json
|
||||
{
|
||||
"header": {
|
||||
"reportVersion": 4,
|
||||
"reportVersion": 5,
|
||||
"event": "exception",
|
||||
"trigger": "Exception",
|
||||
"filename": "report.20181221.005011.8974.0.001.json",
|
||||
@@ -392,7 +392,7 @@ is provided below for reference.
|
||||
"soft": "",
|
||||
"hard": "unlimited"
|
||||
},
|
||||
"data_seg_size_kbytes": {
|
||||
"data_seg_size_bytes": {
|
||||
"soft": "unlimited",
|
||||
"hard": "unlimited"
|
||||
},
|
||||
@@ -404,7 +404,7 @@ is provided below for reference.
|
||||
"soft": "unlimited",
|
||||
"hard": 65536
|
||||
},
|
||||
"max_memory_size_kbytes": {
|
||||
"max_memory_size_bytes": {
|
||||
"soft": "unlimited",
|
||||
"hard": "unlimited"
|
||||
},
|
||||
@@ -424,7 +424,7 @@ is provided below for reference.
|
||||
"soft": "unlimited",
|
||||
"hard": 4127290
|
||||
},
|
||||
"virtual_memory_kbytes": {
|
||||
"virtual_memory_bytes": {
|
||||
"soft": "unlimited",
|
||||
"hard": "unlimited"
|
||||
}
|
||||
@@ -588,6 +588,41 @@ Report version definitions are consistent across LTS releases.
|
||||
|
||||
### Version history
|
||||
|
||||
#### Version 5
|
||||
|
||||
<!-- YAML
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/56068
|
||||
description: Fix typos in the memory limit units.
|
||||
-->
|
||||
|
||||
Replace the keys `data_seg_size_kbytes`, `max_memory_size_kbytes`, and `virtual_memory_kbytes`
|
||||
with `data_seg_size_bytes`, `max_memory_size_bytes`, and `virtual_memory_bytes`
|
||||
respectively in the `userLimits` section, as these values are given in bytes.
|
||||
|
||||
```json
|
||||
{
|
||||
"userLimits": {
|
||||
// Skip some keys ...
|
||||
"data_seg_size_bytes": { // replacing data_seg_size_kbytes
|
||||
"soft": "unlimited",
|
||||
"hard": "unlimited"
|
||||
},
|
||||
// ...
|
||||
"max_memory_size_bytes": { // replacing max_memory_size_kbytes
|
||||
"soft": "unlimited",
|
||||
"hard": "unlimited"
|
||||
},
|
||||
// ...
|
||||
"virtual_memory_bytes": { // replacing virtual_memory_kbytes
|
||||
"soft": "unlimited",
|
||||
"hard": "unlimited"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Version 4
|
||||
|
||||
<!-- YAML
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <cwctype>
|
||||
#include <fstream>
|
||||
|
||||
constexpr int NODE_REPORT_VERSION = 4;
|
||||
constexpr int NODE_REPORT_VERSION = 5;
|
||||
constexpr int NANOS_PER_SEC = 1000 * 1000 * 1000;
|
||||
constexpr double SEC_PER_MICROS = 1e-6;
|
||||
constexpr int MAX_FRAME_COUNT = node::kMaxFrameCountForLogging;
|
||||
@@ -732,13 +732,13 @@ static void PrintSystemInformation(JSONWriter* writer) {
|
||||
int id;
|
||||
} rlimit_strings[] = {
|
||||
{"core_file_size_blocks", RLIMIT_CORE},
|
||||
{"data_seg_size_kbytes", RLIMIT_DATA},
|
||||
{"data_seg_size_bytes", RLIMIT_DATA},
|
||||
{"file_size_blocks", RLIMIT_FSIZE},
|
||||
#if !(defined(_AIX) || defined(__sun))
|
||||
{"max_locked_memory_bytes", RLIMIT_MEMLOCK},
|
||||
#endif
|
||||
#ifndef __sun
|
||||
{"max_memory_size_kbytes", RLIMIT_RSS},
|
||||
{"max_memory_size_bytes", RLIMIT_RSS},
|
||||
#endif
|
||||
{"open_files", RLIMIT_NOFILE},
|
||||
{"stack_size_bytes", RLIMIT_STACK},
|
||||
@@ -747,7 +747,7 @@ static void PrintSystemInformation(JSONWriter* writer) {
|
||||
{"max_user_processes", RLIMIT_NPROC},
|
||||
#endif
|
||||
#ifndef __OpenBSD__
|
||||
{"virtual_memory_kbytes", RLIMIT_AS}
|
||||
{"virtual_memory_bytes", RLIMIT_AS}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ function _validateContent(report, fields = []) {
|
||||
'glibcVersionRuntime', 'glibcVersionCompiler', 'cwd',
|
||||
'reportVersion', 'networkInterfaces', 'threadId'];
|
||||
checkForUnknownFields(header, headerFields);
|
||||
assert.strictEqual(header.reportVersion, 4); // Increment as needed.
|
||||
assert.strictEqual(header.reportVersion, 5); // Increment as needed.
|
||||
assert.strictEqual(typeof header.event, 'string');
|
||||
assert.strictEqual(typeof header.trigger, 'string');
|
||||
assert(typeof header.filename === 'string' || header.filename === null);
|
||||
@@ -309,11 +309,11 @@ function _validateContent(report, fields = []) {
|
||||
|
||||
// Verify the format of the userLimits section on non-Windows platforms.
|
||||
if (!isWindows) {
|
||||
const userLimitsFields = ['core_file_size_blocks', 'data_seg_size_kbytes',
|
||||
const userLimitsFields = ['core_file_size_blocks', 'data_seg_size_bytes',
|
||||
'file_size_blocks', 'max_locked_memory_bytes',
|
||||
'max_memory_size_kbytes', 'open_files',
|
||||
'max_memory_size_bytes', 'open_files',
|
||||
'stack_size_bytes', 'cpu_time_seconds',
|
||||
'max_user_processes', 'virtual_memory_kbytes'];
|
||||
'max_user_processes', 'virtual_memory_bytes'];
|
||||
checkForUnknownFields(report.userLimits, userLimitsFields);
|
||||
for (const [type, limits] of Object.entries(report.userLimits)) {
|
||||
assert.strictEqual(typeof type, 'string');
|
||||
|
||||
Reference in New Issue
Block a user