37 lines
1.2 KiB
Diff
37 lines
1.2 KiB
Diff
--- src/mongo/util/processinfo_linux2.cpp 2015-08-24 02:39:52.000000000 +0200
|
|
+++ src/mongo/util/processinfo_linux2.cpp 2015-08-26 18:47:57.444816879 +0200
|
|
@@ -34,7 +34,9 @@
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <sys/mman.h>
|
|
+#if defined(__GLIBC__)
|
|
#include <gnu/libc-version.h>
|
|
+#endif
|
|
#include <sys/utsname.h>
|
|
|
|
#include "processinfo.h"
|
|
@@ -420,12 +422,14 @@
|
|
}
|
|
|
|
void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {
|
|
+#if defined(__GLIBC__)
|
|
// [dm] i don't think mallinfo works. (64 bit.) ??
|
|
struct mallinfo malloc_info =
|
|
mallinfo(); // structure has same name as function that returns it. (see malloc.h)
|
|
info.append("heap_usage_bytes",
|
|
malloc_info.uordblks /*main arena*/ + malloc_info.hblkhd /*mmap blocks*/);
|
|
// docs claim hblkhd is included in uordblks but it isn't
|
|
+#endif
|
|
|
|
LinuxProc p(_pid);
|
|
info.appendNumber("page_faults", static_cast<long long>(p._maj_flt));
|
|
@@ -460,7 +464,9 @@
|
|
|
|
BSONObjBuilder bExtra;
|
|
bExtra.append("versionString", LinuxSysHelper::readLineFromFile("/proc/version"));
|
|
+#if defined(__GLIBC__)
|
|
bExtra.append("libcVersion", gnu_get_libc_version());
|
|
+#endif
|
|
if (!verSig.empty())
|
|
// optional
|
|
bExtra.append("versionSignature", verSig);
|