diff options
author | Alex Ray <aray@google.com> | 2012-11-30 11:11:54 -0800 |
---|---|---|
committer | Alex Ray <aray@google.com> | 2012-11-30 11:11:54 -0800 |
commit | af348741539ae4a84aa929a54ecf359dae96f3ee (patch) | |
tree | b799625eeebbcc4a1ee12b9767eb11262ff88170 /services | |
parent | e8cb004257565111cb261f3e9c786adba881859a (diff) | |
download | frameworks_av-af348741539ae4a84aa929a54ecf359dae96f3ee.zip frameworks_av-af348741539ae4a84aa929a54ecf359dae96f3ee.tar.gz frameworks_av-af348741539ae4a84aa929a54ecf359dae96f3ee.tar.bz2 |
Remove conditional compilation of ATRACE functions
Tracing functions are meant to be dynamically controlled via sysprops.
Conditional compilation removes this functionality.
Change-Id: I26bc473d104d0b3c50a228dddfda3fa2428d157a
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/Android.mk | 3 | ||||
-rw-r--r-- | services/audioflinger/FastMixer.cpp | 5 | ||||
-rw-r--r-- | services/audioflinger/Threads.cpp | 10 |
3 files changed, 8 insertions, 10 deletions
diff --git a/services/audioflinger/Android.mk b/services/audioflinger/Android.mk index c4050b8..dc65833 100644 --- a/services/audioflinger/Android.mk +++ b/services/audioflinger/Android.mk @@ -66,9 +66,6 @@ LOCAL_CFLAGS += -DSTATE_QUEUE_INSTANTIATIONS='"StateQueueInstantiations.cpp"' LOCAL_CFLAGS += -UFAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE -# uncomment for systrace -# LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_AUDIO - # uncomment for dumpsys to write most recent audio output to .wav file # 47.5 seconds at 44.1 kHz, 8 megabytes # LOCAL_CFLAGS += -DTEE_SINK_FRAMES=0x200000 diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp index 2160ea3..0366dfe 100644 --- a/services/audioflinger/FastMixer.cpp +++ b/services/audioflinger/FastMixer.cpp @@ -17,6 +17,11 @@ #define LOG_TAG "FastMixer" //#define LOG_NDEBUG 0 +/** Uncomment for systrace. + * ATRACE_TAG will default to ATRACE_TAG_NEVER in the header. + */ +//#define ATRACE_TAG ATRACE_TAG_AUDIO + #include <sys/atomics.h> #include <time.h> #include <utils/Log.h> diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 6cada0a..fd64395 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -18,6 +18,7 @@ #define LOG_TAG "AudioFlinger" //#define LOG_NDEBUG 0 +#define ATRACE_TAG ATRACE_TAG_AUDIO #include <math.h> #include <fcntl.h> @@ -25,6 +26,7 @@ #include <cutils/properties.h> #include <cutils/compiler.h> #include <utils/Log.h> +#include <utils/Trace.h> #include <private/media/AudioTrackShared.h> #include <hardware/audio.h> @@ -1652,9 +1654,7 @@ void AudioFlinger::PlaybackThread::threadLoop_write() if (mNormalSink != 0) { #define mBitShift 2 // FIXME size_t count = mixBufferSize >> mBitShift; -#if defined(ATRACE_TAG) && (ATRACE_TAG != ATRACE_TAG_NEVER) ATRACE_BEGIN("write"); -#endif // update the setpoint when AudioFlinger::mScreenState changes uint32_t screenState = AudioFlinger::mScreenState; if (screenState != mScreenState) { @@ -1666,9 +1666,7 @@ void AudioFlinger::PlaybackThread::threadLoop_write() } } ssize_t framesWritten = mNormalSink->write(mMixBuffer, count); -#if defined(ATRACE_TAG) && (ATRACE_TAG != ATRACE_TAG_NEVER) ATRACE_END(); -#endif if (framesWritten > 0) { bytesWritten = framesWritten << mBitShift; } else { @@ -2000,9 +1998,7 @@ if (mType == MIXER) { if (!mStandby && delta > maxPeriod) { mNumDelayedWrites++; if ((now - lastWarning) > kWarningThrottleNs) { -#if defined(ATRACE_TAG) && (ATRACE_TAG != ATRACE_TAG_NEVER) - ScopedTrace st(ATRACE_TAG, "underrun"); -#endif + ATRACE_NAME("underrun"); ALOGW("write blocked for %llu msecs, %d delayed writes, thread %p", ns2ms(delta), mNumDelayedWrites, this); lastWarning = now; |