From 214b406c813e5baca3e4b5cdc1d986de35f09bbb Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Mon, 2 Mar 2015 14:15:47 -0800 Subject: Rename FAST_MIXER_STATISTICS to FAST_THREAD_STATISTICS Change-Id: Idb5f5bf0c20bffff8536cf4a46f696e12e99e81b --- services/audioflinger/Configuration.h | 5 ++--- services/audioflinger/FastMixer.cpp | 4 ++-- services/audioflinger/FastMixerDumpState.cpp | 10 +++++----- services/audioflinger/FastMixerDumpState.h | 4 ++-- services/audioflinger/FastThread.cpp | 8 ++++---- services/audioflinger/FastThread.h | 2 +- services/audioflinger/FastThreadDumpState.cpp | 2 +- services/audioflinger/FastThreadDumpState.h | 2 +- 8 files changed, 18 insertions(+), 19 deletions(-) (limited to 'services') diff --git a/services/audioflinger/Configuration.h b/services/audioflinger/Configuration.h index 6a8aeb1..845697a 100644 --- a/services/audioflinger/Configuration.h +++ b/services/audioflinger/Configuration.h @@ -29,9 +29,8 @@ // uncomment to display CPU load adjusted for CPU frequency //#define CPU_FREQUENCY_STATISTICS -// uncomment to enable fast mixer to take performance samples for later statistical analysis -#define FAST_MIXER_STATISTICS -// FIXME rename to FAST_THREAD_STATISTICS +// uncomment to enable fast threads to take performance samples for later statistical analysis +#define FAST_THREAD_STATISTICS // uncomment for debugging timing problems related to StateQueue::push() //#define STATE_QUEUE_DUMP diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp index 8b12f28..220ebf3 100644 --- a/services/audioflinger/FastMixer.cpp +++ b/services/audioflinger/FastMixer.cpp @@ -31,7 +31,7 @@ #include #include #include -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS #include #ifdef CPU_FREQUENCY_STATISTICS #include @@ -82,7 +82,7 @@ FastMixer::FastMixer() : FastThread(), fastTrackNames[i] = -1; generations[i] = 0; } -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS oldLoad.tv_sec = 0; oldLoad.tv_nsec = 0; #endif diff --git a/services/audioflinger/FastMixerDumpState.cpp b/services/audioflinger/FastMixerDumpState.cpp index 0ddd908..148c0f7 100644 --- a/services/audioflinger/FastMixerDumpState.cpp +++ b/services/audioflinger/FastMixerDumpState.cpp @@ -18,7 +18,7 @@ //#define LOG_NDEBUG 0 #include "Configuration.h" -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS #include #ifdef CPU_FREQUENCY_STATISTICS #include @@ -31,7 +31,7 @@ namespace android { FastMixerDumpState::FastMixerDumpState( -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS uint32_t samplingN #endif ) : FastThreadDumpState(), @@ -40,12 +40,12 @@ FastMixerDumpState::FastMixerDumpState( mSampleRate(0), mFrameCount(0), mTrackMask(0) { -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS increaseSamplingN(samplingN); #endif } -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS void FastMixerDumpState::increaseSamplingN(uint32_t samplingN) { if (samplingN <= mSamplingN || samplingN > kSamplingN || roundup(samplingN) != samplingN) { @@ -126,7 +126,7 @@ void FastMixerDumpState::dump(int fd) const mNumTracks, mWriteErrors, mUnderruns, mOverruns, mSampleRate, mFrameCount, measuredWarmupMs, mWarmupCycles, mixPeriodSec * 1e3); -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS // find the interval of valid samples uint32_t bounds = mBounds; uint32_t newestOpen = bounds & 0xFFFF; diff --git a/services/audioflinger/FastMixerDumpState.h b/services/audioflinger/FastMixerDumpState.h index f8354dd..bd475d6 100644 --- a/services/audioflinger/FastMixerDumpState.h +++ b/services/audioflinger/FastMixerDumpState.h @@ -67,7 +67,7 @@ struct FastTrackDump { // It has a different lifetime than the FastMixer, and so it can't be a member of FastMixer. struct FastMixerDumpState : FastThreadDumpState { FastMixerDumpState( -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS uint32_t samplingN = kSamplingNforLowRamDevice #endif ); @@ -84,7 +84,7 @@ struct FastMixerDumpState : FastThreadDumpState { uint32_t mTrackMask; // mask of active tracks FastTrackDump mTracks[FastMixerState::kMaxFastTracks]; -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS // Compile-time constant for a "low RAM device", must be a power of 2 <= kSamplingN. // This value was chosen such that each array uses 1 small page (4 Kbytes). static const uint32_t kSamplingNforLowRamDevice = 0x400; diff --git a/services/audioflinger/FastThread.cpp b/services/audioflinger/FastThread.cpp index b69cc85..a146b9c 100644 --- a/services/audioflinger/FastThread.cpp +++ b/services/audioflinger/FastThread.cpp @@ -51,7 +51,7 @@ FastThread::FastThread() : Thread(false /*canCallJava*/), mDummyDumpState(NULL), dumpState(NULL), ignoreNextOverrun(true), -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS // oldLoad oldLoadValid(false), bounds(0), @@ -130,7 +130,7 @@ bool FastThread::threadLoop() if (command & FastThreadState::IDLE) { onIdle(); oldTsValid = false; -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS oldLoadValid = false; #endif ignoreNextOverrun = true; @@ -175,7 +175,7 @@ bool FastThread::threadLoop() warmupConsecutiveInRangeCycles = 0; sleepNs = -1; coldGen = current->mColdGen; -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS bounds = 0; full = false; #endif @@ -281,7 +281,7 @@ bool FastThread::threadLoop() ignoreNextOverrun = false; } } -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS if (isWarm) { // advance the FIFO queue bounds size_t i = bounds & (dumpState->mSamplingN - 1); diff --git a/services/audioflinger/FastThread.h b/services/audioflinger/FastThread.h index cb32e9d..e8eaf39 100644 --- a/services/audioflinger/FastThread.h +++ b/services/audioflinger/FastThread.h @@ -63,7 +63,7 @@ protected: FastThreadDumpState *mDummyDumpState; FastThreadDumpState *dumpState; bool ignoreNextOverrun; // used to ignore initial overrun and first after an underrun -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS struct timespec oldLoad; // previous value of clock_gettime(CLOCK_THREAD_CPUTIME_ID) bool oldLoadValid; // whether oldLoad is valid uint32_t bounds; diff --git a/services/audioflinger/FastThreadDumpState.cpp b/services/audioflinger/FastThreadDumpState.cpp index d7b825d..9d575a6 100644 --- a/services/audioflinger/FastThreadDumpState.cpp +++ b/services/audioflinger/FastThreadDumpState.cpp @@ -22,7 +22,7 @@ FastThreadDumpState::FastThreadDumpState() : mCommand(FastThreadState::INITIAL), mUnderruns(0), mOverruns(0), /* mMeasuredWarmupTs({0, 0}), */ mWarmupCycles(0) -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS , mSamplingN(1), mBounds(0) #endif { diff --git a/services/audioflinger/FastThreadDumpState.h b/services/audioflinger/FastThreadDumpState.h index 17afbe5..67468b9 100644 --- a/services/audioflinger/FastThreadDumpState.h +++ b/services/audioflinger/FastThreadDumpState.h @@ -33,7 +33,7 @@ struct FastThreadDumpState { struct timespec mMeasuredWarmupTs; // measured warmup time uint32_t mWarmupCycles; // number of loop cycles required to warmup -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS // Recently collected samples of per-cycle monotonic time, thread CPU time, and CPU frequency. // kSamplingN is max size of sampling frame (statistics), and must be a power of 2 <= 0x8000. // The sample arrays are virtually allocated based on this compile-time constant, -- cgit v1.1