If dex2oat takes >1s, show a breakdown of where the time went.
Turns out that we spend nearly as much time verifying as actually compiling.
Change-Id: Icf2e42b4cc77bd9a48a6d04a4fe19f57270c5927
diff --git a/src/timing_logger.h b/src/timing_logger.h
index b8e545e..594ae98 100644
--- a/src/timing_logger.h
+++ b/src/timing_logger.h
@@ -41,9 +41,13 @@
void Dump() {
LOG(INFO) << name_ << ": begin";
for (size_t i = 1; i < times_.size(); ++i) {
- LOG(INFO) << name_ << ": " << PrettyDuration(times_[i] - times_[i-1]) << labels_[i];
+ LOG(INFO) << name_ << StringPrintf(": %8lld ms, ", NsToMs(times_[i] - times_[i-1])) << labels_[i];
}
- LOG(INFO) << name_ << ": end, " << PrettyDuration(times_.back() - times_.front());
+ LOG(INFO) << name_ << ": end, " << NsToMs(GetTotalNs()) << " ms";
+ }
+
+ uint64_t GetTotalNs() {
+ return times_.back() - times_.front();
}
private: