diff options
Diffstat (limited to 'src/mongo/util/processinfo_linux.cpp')
-rw-r--r-- | src/mongo/util/processinfo_linux.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp index 9c2db3c4166..dde30376ce2 100644 --- a/src/mongo/util/processinfo_linux.cpp +++ b/src/mongo/util/processinfo_linux.cpp @@ -54,6 +54,7 @@ #include <boost/none.hpp> #include <boost/optional.hpp> +#include "mongo/logv2/log.h" #include "mongo/util/file.h" #include "mongo/util/log.h" @@ -407,7 +408,7 @@ public: if (mongo::NumberParser{}(meminfo, &systemMem).isOK()) { return systemMem * 1024; // convert from kB to bytes } else - log() << "Unable to collect system memory information"; + LOGV2(23338, "Unable to collect system memory information"); } return 0; } @@ -521,7 +522,9 @@ void ProcessInfo::SystemInfo::collectSystemInfo() { LinuxSysHelper::getLinuxDistro(distroName, distroVersion); if (uname(&unameData) == -1) { - log() << "Unable to collect detailed system information: " << strerror(errno); + LOGV2(23339, + "Unable to collect detailed system information: {strerror_errno}", + "strerror_errno"_attr = strerror(errno)); } osType = "Linux"; @@ -573,8 +576,11 @@ bool ProcessInfo::checkNumaEnabled() { hasMultipleNodes = boost::filesystem::exists("/sys/devices/system/node/node1"); hasNumaMaps = boost::filesystem::exists("/proc/self/numa_maps"); } catch (boost::filesystem::filesystem_error& e) { - log() << "WARNING: Cannot detect if NUMA interleaving is enabled. " - << "Failed to probe \"" << e.path1().string() << "\": " << e.code().message(); + LOGV2(23340, + "WARNING: Cannot detect if NUMA interleaving is enabled. Failed to probe " + "\"{e_path1_string}\": {e_code_message}", + "e_path1_string"_attr = e.path1().string(), + "e_code_message"_attr = e.code().message()); return false; } @@ -600,7 +606,9 @@ bool ProcessInfo::blockCheckSupported() { bool ProcessInfo::blockInMemory(const void* start) { unsigned char x = 0; if (mincore(const_cast<void*>(alignToStartOfPage(start)), getPageSize(), &x)) { - log() << "mincore failed: " << errnoWithDescription(); + LOGV2(23341, + "mincore failed: {errnoWithDescription}", + "errnoWithDescription"_attr = errnoWithDescription()); return 1; } return x & 0x1; @@ -611,7 +619,9 @@ bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector< if (mincore(const_cast<void*>(alignToStartOfPage(start)), numPages * getPageSize(), reinterpret_cast<unsigned char*>(&out->front()))) { - log() << "mincore failed: " << errnoWithDescription(); + LOGV2(23342, + "mincore failed: {errnoWithDescription}", + "errnoWithDescription"_attr = errnoWithDescription()); return false; } for (size_t i = 0; i < numPages; ++i) { |