From 153b9fe667e6e78e0218ff0159353097428c7657 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Mon, 15 Jul 2013 11:23:36 -0700 Subject: Make AudioFlinger::instantiate() more resilient when called from separate module Bug: 8834855 Change-Id: I4cd842cdfb09d2aaaaab9df9ac3bec6179709bd3 --- services/audioflinger/FastMixer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'services/audioflinger/FastMixer.cpp') diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp index 12e4683..819e8ec 100644 --- a/services/audioflinger/FastMixer.cpp +++ b/services/audioflinger/FastMixer.cpp @@ -25,6 +25,7 @@ #define ATRACE_TAG ATRACE_TAG_AUDIO +#include "Configuration.h" #include #include #include @@ -142,7 +143,9 @@ bool FastMixer::threadLoop() preIdle = *current; current = &preIdle; oldTsValid = false; +#ifdef FAST_MIXER_STATISTICS oldLoadValid = false; +#endif ignoreNextOverrun = true; } previous = current; @@ -182,8 +185,10 @@ bool FastMixer::threadLoop() warmupCycles = 0; sleepNs = -1; coldGen = current->mColdGen; +#ifdef FAST_MIXER_STATISTICS bounds = 0; full = false; +#endif oldTsValid = !clock_gettime(CLOCK_MONOTONIC, &oldTs); } else { sleepNs = FAST_HOT_IDLE_NS; @@ -614,6 +619,7 @@ FastMixerDumpState::FastMixerDumpState() : { mMeasuredWarmupTs.tv_sec = 0; mMeasuredWarmupTs.tv_nsec = 0; +#ifdef FAST_MIXER_STATISTICS // sample arrays aren't accessed atomically with respect to the bounds, // so clearing reduces chance for dumpsys to read random uninitialized samples memset(&mMonotonicNs, 0, sizeof(mMonotonicNs)); @@ -621,6 +627,7 @@ FastMixerDumpState::FastMixerDumpState() : #ifdef CPU_FREQUENCY_STATISTICS memset(&mCpukHz, 0, sizeof(mCpukHz)); #endif +#endif } FastMixerDumpState::~FastMixerDumpState() -- cgit v1.1