summaryrefslogtreecommitdiff
path: root/src/mongo/util/diagnostic_info.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/util/diagnostic_info.cpp')
-rw-r--r--src/mongo/util/diagnostic_info.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mongo/util/diagnostic_info.cpp b/src/mongo/util/diagnostic_info.cpp
index f0b7bb8b1ce..b561c588ee3 100644
--- a/src/mongo/util/diagnostic_info.cpp
+++ b/src/mongo/util/diagnostic_info.cpp
@@ -40,6 +40,7 @@
#include "mongo/base/init.h"
#include "mongo/db/client.h"
+#include "mongo/logv2/log.h"
#include "mongo/platform/mutex.h"
#include "mongo/util/clock_source.h"
#include "mongo/util/hierarchical_acquisition.h"
@@ -100,29 +101,29 @@ void BlockedOp::start(ServiceContext* serviceContext) {
_latchState.thread = stdx::thread([this, serviceContext]() mutable {
ThreadClient tc("DiagnosticCaptureTestLatch", serviceContext);
- log() << "Entered currentOpSpawnsThreadWaitingForLatch thread";
+ LOGV2(23123, "Entered currentOpSpawnsThreadWaitingForLatch thread");
stdx::lock_guard testLock(_latchState.mutex);
- log() << "Joining currentOpSpawnsThreadWaitingForLatch thread";
+ LOGV2(23124, "Joining currentOpSpawnsThreadWaitingForLatch thread");
});
_interruptibleState.thread = stdx::thread([this, serviceContext]() mutable {
ThreadClient tc("DiagnosticCaptureTestInterruptible", serviceContext);
auto opCtx = tc->makeOperationContext();
- log() << "Entered currentOpSpawnsThreadWaitingForLatch thread for interruptibles";
+ LOGV2(23125, "Entered currentOpSpawnsThreadWaitingForLatch thread for interruptibles");
stdx::unique_lock lk(_interruptibleState.mutex);
opCtx->waitForConditionOrInterrupt(
_interruptibleState.cv, lk, [&] { return _interruptibleState.isDone; });
_interruptibleState.isDone = false;
- log() << "Joining currentOpSpawnsThreadWaitingForLatch thread for interruptibles";
+ LOGV2(23126, "Joining currentOpSpawnsThreadWaitingForLatch thread for interruptibles");
});
_cv.wait(lk, [this] { return _latchState.isContended && _interruptibleState.isWaiting; });
- log() << "Started threads for currentOpSpawnsThreadWaitingForLatch";
+ LOGV2(23127, "Started threads for currentOpSpawnsThreadWaitingForLatch");
}
// This function unlocks testMutex and joins if there are no more callers of BlockedOp::start()
@@ -155,14 +156,18 @@ void BlockedOp::join() {
}
void BlockedOp::setIsContended(bool value) {
- log() << "Setting isContended to " << (value ? "true" : "false");
+ LOGV2(23128,
+ "Setting isContended to {value_true_false}",
+ "value_true_false"_attr = (value ? "true" : "false"));
stdx::lock_guard lk(_m);
_latchState.isContended = value;
_cv.notify_one();
}
void BlockedOp::setIsWaiting(bool value) {
- log() << "Setting isWaiting to " << (value ? "true" : "false");
+ LOGV2(23129,
+ "Setting isWaiting to {value_true_false}",
+ "value_true_false"_attr = (value ? "true" : "false"));
stdx::lock_guard lk(_m);
_interruptibleState.isWaiting = value;
_cv.notify_one();