diff options
| author | Ben Cheng <bccheng@google.com> | 2013-09-23 22:39:15 -0700 |
|---|---|---|
| committer | Ben Cheng <bccheng@google.com> | 2013-09-23 22:39:15 -0700 |
| commit | 5cd118178e87c4a6590dc8d8446effa5d5193a9f (patch) | |
| tree | 4b9df4d9c9089c86922189f4f6340c6eda68d969 /libutils | |
| parent | 6b1a027239689a817aa5ca44a2bcbfe48ed21408 (diff) | |
| download | system_core-5cd118178e87c4a6590dc8d8446effa5d5193a9f.tar.gz system_core-5cd118178e87c4a6590dc8d8446effa5d5193a9f.tar.bz2 system_core-5cd118178e87c4a6590dc8d8446effa5d5193a9f.zip | |
Disable timestamp logging.
The kernel problem has been fixed long time ago and the ad-hoc logging
mechanism is not thread safe and can flood the log with spurious
messages.
BUG: 10899829
Change-Id: I63278db51295e744eed3e47dc8d4cfe621c0d8f7
Diffstat (limited to 'libutils')
| -rw-r--r-- | libutils/SystemClock.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libutils/SystemClock.cpp b/libutils/SystemClock.cpp index 4b7488941..ac8da8871 100644 --- a/libutils/SystemClock.cpp +++ b/libutils/SystemClock.cpp @@ -61,12 +61,20 @@ int64_t elapsedRealtime() #define METHOD_IOCTL 1 #define METHOD_SYSTEMTIME 2 +/* + * To debug/verify the timestamps returned by the kernel, change + * DEBUG_TIMESTAMP to 1 and call the timestamp routine from a single thread + * in the test program. b/10899829 + */ +#define DEBUG_TIMESTAMP 0 + static const char *gettime_method_names[] = { "clock_gettime", "ioctl", "systemTime", }; +#if DEBUG_TIMESTAMP static inline void checkTimeStamps(int64_t timestamp, int64_t volatile *prevTimestampPtr, int volatile *prevMethodPtr, @@ -93,6 +101,9 @@ static inline void checkTimeStamps(int64_t timestamp, *prevMethodPtr = curMethod; #endif } +#else +#define checkTimeStamps(timestamp, prevTimestampPtr, prevMethodPtr, curMethod) +#endif /* * native public static long elapsedRealtimeNano(); @@ -103,8 +114,10 @@ int64_t elapsedRealtimeNano() struct timespec ts; int result; int64_t timestamp; +#if DEBUG_TIMESTAMP static volatile int64_t prevTimestamp; static volatile int prevMethod; +#endif #if 0 /* |
