ART: Replace some '\n' with std::endl
Induce flushing the ostreams at strategic points to improve
log visibility.
Bug: 62337922
Test: m test-art-host
Change-Id: Ic4b4c698b568575b55160fff0ad5c31fa6b4018a
diff --git a/runtime/base/histogram-inl.h b/runtime/base/histogram-inl.h
index b28eb72..be20920 100644
--- a/runtime/base/histogram-inl.h
+++ b/runtime/base/histogram-inl.h
@@ -198,7 +198,7 @@
kFractionalDigits)
<< "-" << FormatDuration(Percentile(per_1, data) * kAdjust, unit, kFractionalDigits) << " "
<< "Avg: " << FormatDuration(Mean() * kAdjust, unit, kFractionalDigits) << " Max: "
- << FormatDuration(Max() * kAdjust, unit, kFractionalDigits) << "\n";
+ << FormatDuration(Max() * kAdjust, unit, kFractionalDigits) << std::endl;
}
template <class Value>
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 5094189..95aba79 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -165,7 +165,7 @@
if (dump_native_stack) {
DumpNativeStack(os, tid, nullptr, " native: ");
}
- os << "\n";
+ os << std::endl;
}
void ThreadList::DumpUnattachedThreads(std::ostream& os, bool dump_native_stack) {
@@ -216,11 +216,10 @@
ScopedObjectAccess soa(self);
thread->Dump(local_os, dump_native_stack_, backtrace_map_.get());
}
- local_os << "\n";
{
// Use the logging lock to ensure serialization when writing to the common ostream.
MutexLock mu(self, *Locks::logging_lock_);
- *os_ << local_os.str();
+ *os_ << local_os.str() << std::endl;
}
barrier_.Pass(self);
}