summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'storaged')
-rw-r--r--storaged/storaged.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/storaged/storaged.cpp b/storaged/storaged.cpp
index d3fa2b97d..73df6d0d4 100644
--- a/storaged/storaged.cpp
+++ b/storaged/storaged.cpp
@@ -22,6 +22,7 @@
22 22
23#include <android-base/logging.h> 23#include <android-base/logging.h>
24#include <cutils/properties.h> 24#include <cutils/properties.h>
25#include <log/log.h>
25 26
26#include <storaged.h> 27#include <storaged.h>
27#include <storaged_utils.h> 28#include <storaged_utils.h>
@@ -217,14 +218,20 @@ void storaged_t::event_checked(void) {
217 if (mConfig.event_time_check_usec && 218 if (mConfig.event_time_check_usec &&
218 clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start_ts) < 0) { 219 clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start_ts) < 0) {
219 check_time = false; 220 check_time = false;
220 PLOG_TO(SYSTEM, ERROR) << "clock_gettime() failed"; 221 static time_t state_a;
222 IF_ALOG_RATELIMIT_LOCAL(300, &state_a) {
223 PLOG_TO(SYSTEM, ERROR) << "clock_gettime() failed";
224 }
221 } 225 }
222 226
223 event(); 227 event();
224 228
225 if (mConfig.event_time_check_usec) { 229 if (mConfig.event_time_check_usec && check_time) {
226 if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end_ts) < 0) { 230 if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end_ts) < 0) {
227 PLOG_TO(SYSTEM, ERROR) << "clock_gettime() failed"; 231 static time_t state_b;
232 IF_ALOG_RATELIMIT_LOCAL(300, &state_b) {
233 PLOG_TO(SYSTEM, ERROR) << "clock_gettime() failed";
234 }
228 return; 235 return;
229 } 236 }
230 int64_t cost = (end_ts.tv_sec - start_ts.tv_sec) * SEC_TO_USEC + 237 int64_t cost = (end_ts.tv_sec - start_ts.tv_sec) * SEC_TO_USEC +