OSDN Git Service

Limit profman log spam with time threshold
authorDavid Sehr <sehr@google.com>
Thu, 5 May 2016 16:02:38 +0000 (09:02 -0700)
committerDavid Sehr <sehr@google.com>
Thu, 5 May 2016 20:17:52 +0000 (13:17 -0700)
Bug: 28599906
Change-Id: Ibe1001da94c7916761c8f3b4b5dbacd8cf3809a7
(cherry picked from commit 305ed710a8ea732e59bdc782121dea3389adc357)

profman/profman.cc

index 3e632bc..0febf63 100644 (file)
@@ -216,7 +216,10 @@ class ProfMan FINAL {
   }
 
   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_;