Improve VLOG_STREAM
Previously VLOG_STREAM would always print even if the module was
turned off. This changes VLOG_STREAM to not print when the module is
off. Like with LOG_STREAM the stream is consumed even if it's not
printed.
Also updated some ti_heap.cc logs to use LOG_STREAM.
Test: ./test/run-test --host --dev 1981
Test: ./test/run-test --host --dev --runtime-option -verbose:plugin 1981
Test: ./test.py --host
Change-Id: If709474918b3e67749647fae5accb0ce98ea3a59
diff --git a/openjdkjvmti/ti_heap.cc b/openjdkjvmti/ti_heap.cc
index f14fbaf..bbb2ced 100644
--- a/openjdkjvmti/ti_heap.cc
+++ b/openjdkjvmti/ti_heap.cc
@@ -1707,11 +1707,11 @@
const art::JavaFrameRootInfo& jfri =
art::down_cast<const art::JavaFrameRootInfo&>(info);
if (jfri.GetVReg() == art::JavaFrameRootInfo::kMethodDeclaringClass) {
- info.Describe(LOG_STREAM(INFO) << "Not changing declaring-class during stack walk. "
- "Found obsolete java frame id ");
+ info.Describe(VLOG_STREAM(plugin) << "Not changing declaring-class during stack"
+ << " walk. Found obsolete java frame id ");
continue;
} else {
- info.Describe(LOG_STREAM(INFO) << "Found java frame id ");
+ info.Describe(VLOG_STREAM(plugin) << "Found java frame id ");
threads_with_roots_.insert(info.GetThreadId());
}
}
@@ -1733,11 +1733,11 @@
const art::JavaFrameRootInfo& jfri =
art::down_cast<const art::JavaFrameRootInfo&>(info);
if (jfri.GetVReg() == art::JavaFrameRootInfo::kMethodDeclaringClass) {
- info.Describe(LOG_STREAM(INFO) << "Not changing declaring-class during stack walk. "
- "Found obsolete java frame id ");
+ info.Describe(VLOG_STREAM(plugin) << "Not changing declaring-class during stack"
+ << " walk. Found obsolete java frame id ");
continue;
} else {
- info.Describe(LOG_STREAM(INFO) << "Found java frame id ");
+ info.Describe(VLOG_STREAM(plugin) << "Found java frame id ");
threads_with_roots_.insert(info.GetThreadId());
}
}