Limit profman log spam with time threshold
Bug: 28599906
Change-Id: Ibe1001da94c7916761c8f3b4b5dbacd8cf3809a7
(cherry picked from commit 305ed710a8ea732e59bdc782121dea3389adc357)
diff --git a/profman/profman.cc b/profman/profman.cc
index 3e632bc..0febf63 100644
--- a/profman/profman.cc
+++ b/profman/profman.cc
@@ -216,7 +216,10 @@
}
void LogCompletionTime() {
- LOG(INFO) << "profman took " << PrettyDuration(NanoTime() - start_ns_);
+ static constexpr uint64_t kLogThresholdTime = MsToNs(100); // 100ms
+ uint64_t time_taken = NanoTime() - start_ns_;
+ if (time_taken > kLogThresholdTime)
+ LOG(WARNING) << "profman took " << PrettyDuration(NanoTime() - start_ns_);
}
std::vector<std::string> profile_files_;