Skip to content

Commit b1e0c43

Browse files
cjihrigaddaleax
authored andcommitted
report: disambiguate glibc versions
- Give the glibc version entries more specific names. - Group all of the glibc version reporting together. PR-URL: #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>
1 parent f6c8820 commit b1e0c43

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

doc/api/report.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ is provided below for reference.
3636
"child"
3737
],
3838
"nodejsVersion": "v12.0.0-pre",
39-
"glibcVersion": "2.17",
39+
"glibcVersionRuntime": "2.17",
40+
"glibcVersionCompiler": "2.17",
4041
"wordSize": "64 bit",
4142
"componentVersions": {
4243
"node": "12.0.0-pre",
@@ -55,7 +56,6 @@ is provided below for reference.
5556
"release": "node"
5657
},
5758
"osVersion": "Linux 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018",
58-
"glibc": "2.17",
5959
"machine": "Linux 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018test_machine x86_64"
6060
},
6161
"javascriptStack": {

src/node_report.cc

+12-8
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,22 @@ static void PrintVersionInformation(JSONWriter* writer) {
323323
buf << "v" << NODE_VERSION_STRING;
324324
writer->json_keyvalue("nodejsVersion", buf.str());
325325
buf.str("");
326+
327+
#ifndef _WIN32
328+
// Report compiler and runtime glibc versions where possible.
329+
const char* (*libc_version)();
330+
*(reinterpret_cast<void**>(&libc_version)) =
331+
dlsym(RTLD_DEFAULT, "gnu_get_libc_version");
332+
if (libc_version != nullptr)
333+
writer->json_keyvalue("glibcVersionRuntime", (*libc_version)());
334+
#endif /* _WIN32 */
335+
326336
#ifdef __GLIBC__
327337
buf << __GLIBC__ << "." << __GLIBC_MINOR__;
328-
writer->json_keyvalue("glibcVersion", buf.str());
338+
writer->json_keyvalue("glibcVersionCompiler", buf.str());
329339
buf.str("");
330340
#endif
341+
331342
// Report Process word size
332343
writer->json_keyvalue("wordSize", sizeof(void*) * 8);
333344

@@ -433,13 +444,6 @@ static void PrintVersionInformation(JSONWriter* writer) {
433444
buf.str("");
434445
buf << os_info.nodename << " " << os_info.machine;
435446
writer->json_keyvalue("machine", buf.str());
436-
437-
const char* (*libc_version)();
438-
*(reinterpret_cast<void**>(&libc_version)) =
439-
dlsym(RTLD_DEFAULT, "gnu_get_libc_version");
440-
if (libc_version != nullptr) {
441-
writer->json_keyvalue("glibc", (*libc_version)());
442-
}
443447
}
444448
#endif
445449
}

0 commit comments

Comments
 (0)