diff options
Diffstat (limited to 'src/mongo/util/processinfo_osx.cpp')
-rw-r--r-- | src/mongo/util/processinfo_osx.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/mongo/util/processinfo_osx.cpp b/src/mongo/util/processinfo_osx.cpp index 45fc77f68ff..3bc13439d16 100644 --- a/src/mongo/util/processinfo_osx.cpp +++ b/src/mongo/util/processinfo_osx.cpp @@ -48,6 +48,7 @@ #include <sys/types.h> #include "mongo/db/jsobj.h" +#include "mongo/logv2/log.h" #include "mongo/util/log.h" #include "mongo/util/processinfo.h" @@ -153,7 +154,7 @@ Variant getSysctlByName(const char* sysctlName) { } while (status == -1 && errno == ENOMEM); if (status == -1) { // unrecoverable error from sysctlbyname - log() << sysctlName << " unavailable"; + LOGV2(23351, "{sysctlName} unavailable", "sysctlName"_attr = sysctlName); return ""; } @@ -169,11 +170,15 @@ long long getSysctlByName<NumberVal>(const char* sysctlName) { long long value = 0; size_t len = sizeof(value); if (sysctlbyname(sysctlName, &value, &len, nullptr, 0) < 0) { - log() << "Unable to resolve sysctl " << sysctlName << " (number) "; + LOGV2(23352, + "Unable to resolve sysctl {sysctlName} (number) ", + "sysctlName"_attr = sysctlName); } if (len > 8) { - log() << "Unable to resolve sysctl " << sysctlName << " as integer. System returned " - << len << " bytes."; + LOGV2(23353, + "Unable to resolve sysctl {sysctlName} as integer. System returned {len} bytes.", + "sysctlName"_attr = sysctlName, + "len"_attr = len); } return value; } @@ -223,7 +228,9 @@ bool ProcessInfo::blockCheckSupported() { bool ProcessInfo::blockInMemory(const void* start) { char x = 0; if (mincore(alignToStartOfPage(start), getPageSize(), &x)) { - log() << "mincore failed: " << errnoWithDescription(); + LOGV2(23354, + "mincore failed: {errnoWithDescription}", + "errnoWithDescription"_attr = errnoWithDescription()); return 1; } return x & 0x1; @@ -232,7 +239,9 @@ bool ProcessInfo::blockInMemory(const void* start) { bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector<char>* out) { out->resize(numPages); if (mincore(alignToStartOfPage(start), numPages * getPageSize(), &out->front())) { - log() << "mincore failed: " << errnoWithDescription(); + LOGV2(23355, + "mincore failed: {errnoWithDescription}", + "errnoWithDescription"_attr = errnoWithDescription()); return false; } for (size_t i = 0; i < numPages; ++i) { |