diff options
author | Glenn Kasten <gkasten@google.com> | 2015-03-03 01:00:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-03 01:00:54 +0000 |
commit | 785b34e6b2743e3303dcd56d269259da73c40dfb (patch) | |
tree | d6cc5eb0be4404b51a59f5460a76a3ecb355ba21 /services/audioflinger | |
parent | a5c5ad3615613ac0f15012e9e07a34582da7fe77 (diff) | |
parent | 214b406c813e5baca3e4b5cdc1d986de35f09bbb (diff) | |
download | frameworks_av-785b34e6b2743e3303dcd56d269259da73c40dfb.zip frameworks_av-785b34e6b2743e3303dcd56d269259da73c40dfb.tar.gz frameworks_av-785b34e6b2743e3303dcd56d269259da73c40dfb.tar.bz2 |
Merge "Rename FAST_MIXER_STATISTICS to FAST_THREAD_STATISTICS"
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/Configuration.h | 5 | ||||
-rw-r--r-- | services/audioflinger/FastMixer.cpp | 4 | ||||
-rw-r--r-- | services/audioflinger/FastMixerDumpState.cpp | 10 | ||||
-rw-r--r-- | services/audioflinger/FastMixerDumpState.h | 4 | ||||
-rw-r--r-- | services/audioflinger/FastThread.cpp | 8 | ||||
-rw-r--r-- | services/audioflinger/FastThread.h | 2 | ||||
-rw-r--r-- | services/audioflinger/FastThreadDumpState.cpp | 2 | ||||
-rw-r--r-- | services/audioflinger/FastThreadDumpState.h | 2 |
8 files changed, 18 insertions, 19 deletions
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 <utils/Log.h> #include <utils/Trace.h> #include <system/audio.h> -#ifdef FAST_MIXER_STATISTICS +#ifdef FAST_THREAD_STATISTICS #include <cpustats/CentralTendencyStatistics.h> #ifdef CPU_FREQUENCY_STATISTICS #include <cpustats/ThreadCpuUsage.h> @@ -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 <cpustats/CentralTendencyStatistics.h> #ifdef CPU_FREQUENCY_STATISTICS #include <cpustats/ThreadCpuUsage.h> @@ -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, |