summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-01-28 20:08:10 -0500
committercjihrig <cjihrig@gmail.com>2019-01-31 13:27:52 -0500
commit5d4b085b1be6094317de536858c3e7d8cbbae848 (patch)
tree7159982056383e4af2784232688b916a46511cce
parent973c223429279286b8441f20807a770920d58bcb (diff)
downloadandroid-node-v8-5d4b085b1be6094317de536858c3e7d8cbbae848.tar.gz
android-node-v8-5d4b085b1be6094317de536858c3e7d8cbbae848.tar.bz2
android-node-v8-5d4b085b1be6094317de536858c3e7d8cbbae848.zip
report: disambiguate glibc versions
- 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>
-rw-r--r--doc/api/report.md4
-rw-r--r--src/node_report.cc20
2 files changed, 14 insertions, 10 deletions
diff --git a/doc/api/report.md b/doc/api/report.md
index ecf44b20cf..cc09999305 100644
--- a/doc/api/report.md
+++ b/doc/api/report.md
@@ -36,7 +36,8 @@ is provided below for reference.
"child"
],
"nodejsVersion": "v12.0.0-pre",
- "glibcVersion": "2.17",
+ "glibcVersionRuntime": "2.17",
+ "glibcVersionCompiler": "2.17",
"wordSize": "64 bit",
"componentVersions": {
"node": "12.0.0-pre",
@@ -55,7 +56,6 @@ is provided below for reference.
"release": "node"
},
"osVersion": "Linux 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018",
- "glibc": "2.17",
"machine": "Linux 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018test_machine x86_64"
},
"javascriptStack": {
diff --git a/src/node_report.cc b/src/node_report.cc
index a9861f931e..381a40e786 100644
--- a/src/node_report.cc
+++ b/src/node_report.cc
@@ -323,11 +323,22 @@ static void PrintVersionInformation(JSONWriter* writer) {
buf << "v" << NODE_VERSION_STRING;
writer->json_keyvalue("nodejsVersion", buf.str());
buf.str("");
+
+#ifndef _WIN32
+ // Report compiler and runtime glibc versions where possible.
+ const char* (*libc_version)();
+ *(reinterpret_cast<void**>(&libc_version)) =
+ dlsym(RTLD_DEFAULT, "gnu_get_libc_version");
+ if (libc_version != nullptr)
+ writer->json_keyvalue("glibcVersionRuntime", (*libc_version)());
+#endif /* _WIN32 */
+
#ifdef __GLIBC__
buf << __GLIBC__ << "." << __GLIBC_MINOR__;
- writer->json_keyvalue("glibcVersion", buf.str());
+ writer->json_keyvalue("glibcVersionCompiler", buf.str());
buf.str("");
#endif
+
// Report Process word size
writer->json_keyvalue("wordSize", sizeof(void*) * 8);
@@ -433,13 +444,6 @@ static void PrintVersionInformation(JSONWriter* writer) {
buf.str("");
buf << os_info.nodename << " " << os_info.machine;
writer->json_keyvalue("machine", buf.str());
-
- const char* (*libc_version)();
- *(reinterpret_cast<void**>(&libc_version)) =
- dlsym(RTLD_DEFAULT, "gnu_get_libc_version");
- if (libc_version != nullptr) {
- writer->json_keyvalue("glibc", (*libc_version)());
- }
}
#endif
}