summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-05-30 19:17:47 -0700
committerJeff Brown <jeffbrown@google.com>2012-05-30 19:17:47 -0700
commit1ea51bf519bdfc0e04daa88b8788f06105c5599b (patch)
tree51e1b1989ed3861eb36e90fdf2d0c20bd2e1d93c /libs
parente10824965c64663b8878b808206ee382c7ab6af8 (diff)
downloadframeworks_native-1ea51bf519bdfc0e04daa88b8788f06105c5599b.zip
frameworks_native-1ea51bf519bdfc0e04daa88b8788f06105c5599b.tar.gz
frameworks_native-1ea51bf519bdfc0e04daa88b8788f06105c5599b.tar.bz2
Remove unused statistics code.
Bug: 6559630 Change-Id: Iacdf4bb4c1c125c09305cbd8cb443c7c80cfc010
Diffstat (limited to 'libs')
-rw-r--r--libs/utils/Looper.cpp68
1 files changed, 0 insertions, 68 deletions
diff --git a/libs/utils/Looper.cpp b/libs/utils/Looper.cpp
index d1aa664..95db28d 100644
--- a/libs/utils/Looper.cpp
+++ b/libs/utils/Looper.cpp
@@ -98,20 +98,6 @@ Looper::Looper(bool allowNonCallbacks) :
mPolling = false;
mWaiters = 0;
#endif
-
-#ifdef LOOPER_STATISTICS
- mPendingWakeTime = -1;
- mPendingWakeCount = 0;
- mSampledWakeCycles = 0;
- mSampledWakeCountSum = 0;
- mSampledWakeLatencySum = 0;
-
- mSampledPolls = 0;
- mSampledZeroPollCount = 0;
- mSampledZeroPollLatencySum = 0;
- mSampledTimeoutPollCount = 0;
- mSampledTimeoutPollLatencySum = 0;
-#endif
}
Looper::~Looper() {
@@ -234,10 +220,6 @@ int Looper::pollInner(int timeoutMillis) {
mResponses.clear();
mResponseIndex = 0;
-#ifdef LOOPER_STATISTICS
- nsecs_t pollStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-#endif
-
#ifdef LOOPER_USES_EPOLL
struct epoll_event eventItems[EPOLL_MAX_EVENTS];
int eventCount = epoll_wait(mEpollFd, eventItems, EPOLL_MAX_EVENTS, timeoutMillis);
@@ -341,29 +323,6 @@ Done:
}
#endif
-#ifdef LOOPER_STATISTICS
- nsecs_t pollEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
- mSampledPolls += 1;
- if (timeoutMillis == 0) {
- mSampledZeroPollCount += 1;
- mSampledZeroPollLatencySum += pollEndTime - pollStartTime;
- } else if (timeoutMillis > 0 && result == ALOOPER_POLL_TIMEOUT) {
- mSampledTimeoutPollCount += 1;
- mSampledTimeoutPollLatencySum += pollEndTime - pollStartTime
- - milliseconds_to_nanoseconds(timeoutMillis);
- }
- if (mSampledPolls == SAMPLED_POLLS_TO_AGGREGATE) {
- ALOGD("%p ~ poll latency statistics: %0.3fms zero timeout, %0.3fms non-zero timeout", this,
- 0.000001f * float(mSampledZeroPollLatencySum) / mSampledZeroPollCount,
- 0.000001f * float(mSampledTimeoutPollLatencySum) / mSampledTimeoutPollCount);
- mSampledPolls = 0;
- mSampledZeroPollCount = 0;
- mSampledZeroPollLatencySum = 0;
- mSampledTimeoutPollCount = 0;
- mSampledTimeoutPollLatencySum = 0;
- }
-#endif
-
// Invoke pending message callbacks.
mNextMessageUptime = LLONG_MAX;
while (mMessageEnvelopes.size() != 0) {
@@ -454,13 +413,6 @@ void Looper::wake() {
ALOGD("%p ~ wake", this);
#endif
-#ifdef LOOPER_STATISTICS
- // FIXME: Possible race with awoken() but this code is for testing only and is rarely enabled.
- if (mPendingWakeCount++ == 0) {
- mPendingWakeTime = systemTime(SYSTEM_TIME_MONOTONIC);
- }
-#endif
-
ssize_t nWrite;
do {
nWrite = write(mWakeWritePipeFd, "W", 1);
@@ -478,26 +430,6 @@ void Looper::awoken() {
ALOGD("%p ~ awoken", this);
#endif
-#ifdef LOOPER_STATISTICS
- if (mPendingWakeCount == 0) {
- ALOGD("%p ~ awoken: spurious!", this);
- } else {
- mSampledWakeCycles += 1;
- mSampledWakeCountSum += mPendingWakeCount;
- mSampledWakeLatencySum += systemTime(SYSTEM_TIME_MONOTONIC) - mPendingWakeTime;
- mPendingWakeCount = 0;
- mPendingWakeTime = -1;
- if (mSampledWakeCycles == SAMPLED_WAKE_CYCLES_TO_AGGREGATE) {
- ALOGD("%p ~ wake statistics: %0.3fms wake latency, %0.3f wakes per cycle", this,
- 0.000001f * float(mSampledWakeLatencySum) / mSampledWakeCycles,
- float(mSampledWakeCountSum) / mSampledWakeCycles);
- mSampledWakeCycles = 0;
- mSampledWakeCountSum = 0;
- mSampledWakeLatencySum = 0;
- }
- }
-#endif
-
char buffer[16];
ssize_t nRead;
do {