diff options
author | Amit Pundir <amit.pundir@linaro.org> | 2014-05-27 08:24:07 +0530 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2014-05-27 08:24:07 +0530 |
commit | 4d2449e84bf22156d063277e61a29175809417c4 (patch) | |
tree | fea08a2130c888f5e47e849efd0ce086f5cb1e94 | |
parent | 7a96e08fb1f360c6de523e2592868260568412c2 (diff) | |
parent | 8b187f4acea8d7e517ff9ced32fc7368bdbaa6e0 (diff) | |
download | av-linaro-juno-master.tar.gz |
Merge masterlinaro-juno-master
* aosp/master:
Move frameworks/av off <sys/atomics.h>.
Move frameworks/av from fdprintf to POSIX dprintf.
Restore accidentally-removed NULL timeout.
Move frameworks/av off private API.
Move frameworks/av off __futex_syscall3.
libstagefright foundation: fix uninitialized varibale warning
Codec Offload: Add NULL check as mCallbackThread is NULL when offloaded HAL is running BLOCKING mode
-rw-r--r-- | media/libmedia/AudioTrackShared.cpp | 52 | ||||
-rw-r--r-- | media/libnbaio/NBLog.cpp | 2 | ||||
-rw-r--r-- | media/libstagefright/MediaBuffer.cpp | 5 | ||||
-rw-r--r-- | media/libstagefright/foundation/ANetworkSession.cpp | 2 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 8 | ||||
-rw-r--r-- | services/audioflinger/AudioWatchdog.cpp | 2 | ||||
-rw-r--r-- | services/audioflinger/FastMixer.cpp | 53 | ||||
-rw-r--r-- | services/audioflinger/FastMixer.h | 5 | ||||
-rw-r--r-- | services/audioflinger/StateQueue.cpp | 4 | ||||
-rw-r--r-- | services/audioflinger/Threads.cpp | 13 | ||||
-rw-r--r-- | services/audioflinger/Tracks.cpp | 5 | ||||
-rw-r--r-- | services/camera/libcameraservice/utils/CameraTraces.cpp | 4 | ||||
-rw-r--r-- | services/medialog/MediaLogService.cpp | 4 |
13 files changed, 80 insertions, 79 deletions
diff --git a/media/libmedia/AudioTrackShared.cpp b/media/libmedia/AudioTrackShared.cpp index e898109e6a..d5b0b07e5f 100644 --- a/media/libmedia/AudioTrackShared.cpp +++ b/media/libmedia/AudioTrackShared.cpp @@ -19,9 +19,9 @@ #include <private/media/AudioTrackShared.h> #include <utils/Log.h> -extern "C" { -#include "../private/bionic_futex.h" -} + +#include <linux/futex.h> +#include <sys/syscall.h> namespace android { @@ -206,12 +206,12 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques } int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { - int rc; if (measure && !beforeIsValid) { clock_gettime(CLOCK_MONOTONIC, &before); beforeIsValid = true; } - int ret = __futex_syscall4(&cblk->mFutex, + errno = 0; + (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); // update total elapsed time spent waiting if (measure) { @@ -230,16 +230,16 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques before = after; beforeIsValid = true; } - switch (ret) { - case 0: // normal wakeup by server, or by binderDied() - case -EWOULDBLOCK: // benign race condition with server - case -EINTR: // wait was interrupted by signal or other spurious wakeup - case -ETIMEDOUT: // time-out expired + switch (errno) { + case 0: // normal wakeup by server, or by binderDied() + case EWOULDBLOCK: // benign race condition with server + case EINTR: // wait was interrupted by signal or other spurious wakeup + case ETIMEDOUT: // time-out expired // FIXME these error/non-0 status are being dropped break; default: - ALOGE("%s unexpected error %d", __func__, ret); - status = -ret; + status = errno; + ALOGE("%s unexpected error %s", __func__, strerror(status)); goto end; } } @@ -295,7 +295,7 @@ void ClientProxy::binderDied() audio_track_cblk_t* cblk = mCblk; if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) { // it seems that a FUTEX_WAKE_PRIVATE will not wake a FUTEX_WAIT, even within same process - (void) __futex_syscall3(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, + (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } } @@ -304,7 +304,7 @@ void ClientProxy::interrupt() { audio_track_cblk_t* cblk = mCblk; if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) & CBLK_INTERRUPT)) { - (void) __futex_syscall3(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, + (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } } @@ -435,18 +435,18 @@ status_t AudioTrackClientProxy::waitStreamEndDone(const struct timespec *request } int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { - int rc; - int ret = __futex_syscall4(&cblk->mFutex, + errno = 0; + (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts); - switch (ret) { - case 0: // normal wakeup by server, or by binderDied() - case -EWOULDBLOCK: // benign race condition with server - case -EINTR: // wait was interrupted by signal or other spurious wakeup - case -ETIMEDOUT: // time-out expired + switch (errno) { + case 0: // normal wakeup by server, or by binderDied() + case EWOULDBLOCK: // benign race condition with server + case EINTR: // wait was interrupted by signal or other spurious wakeup + case ETIMEDOUT: // time-out expired break; default: - ALOGE("%s unexpected error %d", __func__, ret); - status = -ret; + status = errno; + ALOGE("%s unexpected error %s", __func__, strerror(status)); goto end; } } @@ -535,7 +535,7 @@ status_t ServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush) if (front != rear) { int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { - (void) __futex_syscall3(&cblk->mFutex, + (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } } @@ -638,7 +638,7 @@ void ServerProxy::releaseBuffer(Buffer* buffer) ALOGV("mAvailToClient=%u stepCount=%u minimum=%u", mAvailToClient, stepCount, minimum); int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); if (!(old & CBLK_FUTEX_WAKE)) { - (void) __futex_syscall3(&cblk->mFutex, + (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } } @@ -682,7 +682,7 @@ bool AudioTrackServerProxy::setStreamEndDone() { bool old = (android_atomic_or(CBLK_STREAM_END_DONE, &mCblk->mFlags) & CBLK_STREAM_END_DONE) != 0; if (!old) { - (void) __futex_syscall3(&mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, + (void) syscall(__NR_futex, &mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, 1); } return old; diff --git a/media/libnbaio/NBLog.cpp b/media/libnbaio/NBLog.cpp index 8dfb4f090c..4f5762fc5a 100644 --- a/media/libnbaio/NBLog.cpp +++ b/media/libnbaio/NBLog.cpp @@ -438,7 +438,7 @@ void NBLog::Reader::dump(int fd, size_t indent) void NBLog::Reader::dumpLine(const String8& timestamp, String8& body) { if (mFd >= 0) { - fdprintf(mFd, "%.*s%s %s\n", mIndent, "", timestamp.string(), body.string()); + dprintf(mFd, "%.*s%s %s\n", mIndent, "", timestamp.string(), body.string()); } else { ALOGI("%.*s%s %s", mIndent, "", timestamp.string(), body.string()); } diff --git a/media/libstagefright/MediaBuffer.cpp b/media/libstagefright/MediaBuffer.cpp index 11b80bf424..8af0880bbb 100644 --- a/media/libstagefright/MediaBuffer.cpp +++ b/media/libstagefright/MediaBuffer.cpp @@ -27,7 +27,6 @@ #include <media/stagefright/MetaData.h> #include <ui/GraphicBuffer.h> -#include <sys/atomics.h> namespace android { @@ -92,7 +91,7 @@ void MediaBuffer::release() { return; } - int prevCount = __atomic_dec(&mRefCount); + int prevCount = __sync_fetch_and_sub(&mRefCount, 1); if (prevCount == 1) { if (mObserver == NULL) { delete this; @@ -112,7 +111,7 @@ void MediaBuffer::claim() { } void MediaBuffer::add_ref() { - (void) __atomic_inc(&mRefCount); + (void) __sync_fetch_and_add(&mRefCount, 1); } void *MediaBuffer::data() const { diff --git a/media/libstagefright/foundation/ANetworkSession.cpp b/media/libstagefright/foundation/ANetworkSession.cpp index af5be708f7..4504c2be2c 100644 --- a/media/libstagefright/foundation/ANetworkSession.cpp +++ b/media/libstagefright/foundation/ANetworkSession.cpp @@ -623,7 +623,7 @@ status_t ANetworkSession::Session::writeMore() { CHECK_EQ(mState, CONNECTED); CHECK(!mOutFragments.empty()); - ssize_t n; + ssize_t n = -1; while (!mOutFragments.empty()) { const Fragment &frag = *mOutFragments.begin(); diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index c0c34f7526..33b19a4c32 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -379,7 +379,7 @@ status_t AudioFlinger::dump(int fd, const Vector<String16>& args) if (mLogMemoryDealer != 0) { sp<IBinder> binder = defaultServiceManager()->getService(String16("media.log")); if (binder != 0) { - fdprintf(fd, "\nmedia.log:\n"); + dprintf(fd, "\nmedia.log:\n"); Vector<String16> args; binder->dump(fd, args); } @@ -2460,7 +2460,7 @@ void AudioFlinger::dumpTee(int fd, const sp<NBAIO_Source>& source, audio_io_hand } } else { if (fd >= 0) { - fdprintf(fd, "unable to rotate tees in %s: %s\n", teePath, strerror(errno)); + dprintf(fd, "unable to rotate tees in %s: %s\n", teePath, strerror(errno)); } } char teeTime[16]; @@ -2514,11 +2514,11 @@ void AudioFlinger::dumpTee(int fd, const sp<NBAIO_Source>& source, audio_io_hand write(teeFd, &temp, sizeof(temp)); close(teeFd); if (fd >= 0) { - fdprintf(fd, "tee copied to %s\n", teePath); + dprintf(fd, "tee copied to %s\n", teePath); } } else { if (fd >= 0) { - fdprintf(fd, "unable to create tee %s: %s\n", teePath, strerror(errno)); + dprintf(fd, "unable to create tee %s: %s\n", teePath, strerror(errno)); } } } diff --git a/services/audioflinger/AudioWatchdog.cpp b/services/audioflinger/AudioWatchdog.cpp index 93d185e79c..877e776d44 100644 --- a/services/audioflinger/AudioWatchdog.cpp +++ b/services/audioflinger/AudioWatchdog.cpp @@ -34,7 +34,7 @@ void AudioWatchdogDump::dump(int fd) } else { strcpy(buf, "N/A\n"); } - fdprintf(fd, "Watchdog: underruns=%u, logs=%u, most recent underrun log at %s", + dprintf(fd, "Watchdog: underruns=%u, logs=%u, most recent underrun log at %s", mUnderruns, mLogs, buf); } diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp index 85d637e236..6d878386ee 100644 --- a/services/audioflinger/FastMixer.cpp +++ b/services/audioflinger/FastMixer.cpp @@ -26,7 +26,6 @@ #define ATRACE_TAG ATRACE_TAG_AUDIO #include "Configuration.h" -#include <sys/atomics.h> #include <time.h> #include <utils/Log.h> #include <utils/Trace.h> @@ -179,7 +178,7 @@ bool FastMixer::threadLoop() ALOG_ASSERT(coldFutexAddr != NULL); int32_t old = android_atomic_dec(coldFutexAddr); if (old <= 0) { - __futex_syscall4(coldFutexAddr, FUTEX_WAIT_PRIVATE, old - 1, NULL); + (void) syscall(__NR_futex, coldFutexAddr, FUTEX_WAIT_PRIVATE, old - 1, NULL); } int policy = sched_getscheduler(0); if (!(policy == SCHED_FIFO || policy == SCHED_RR)) { @@ -695,7 +694,7 @@ static int compare_uint32_t(const void *pa, const void *pb) void FastMixerDumpState::dump(int fd) const { if (mCommand == FastMixerState::INITIAL) { - fdprintf(fd, "FastMixer not initialized\n"); + dprintf(fd, "FastMixer not initialized\n"); return; } #define COMMAND_MAX 32 @@ -729,7 +728,7 @@ void FastMixerDumpState::dump(int fd) const double measuredWarmupMs = (mMeasuredWarmupTs.tv_sec * 1000.0) + (mMeasuredWarmupTs.tv_nsec / 1000000.0); double mixPeriodSec = (double) mFrameCount / (double) mSampleRate; - fdprintf(fd, "FastMixer command=%s writeSequence=%u framesWritten=%u\n" + dprintf(fd, "FastMixer command=%s writeSequence=%u framesWritten=%u\n" " numTracks=%u writeErrors=%u underruns=%u overruns=%u\n" " sampleRate=%u frameCount=%zu measuredWarmup=%.3g ms, warmupCycles=%u\n" " mixPeriod=%.2f ms\n", @@ -783,21 +782,21 @@ void FastMixerDumpState::dump(int fd) const previousCpukHz = sampleCpukHz; #endif } - fdprintf(fd, "Simple moving statistics over last %.1f seconds:\n", wall.n() * mixPeriodSec); - fdprintf(fd, " wall clock time in ms per mix cycle:\n" - " mean=%.2f min=%.2f max=%.2f stddev=%.2f\n", - wall.mean()*1e-6, wall.minimum()*1e-6, wall.maximum()*1e-6, wall.stddev()*1e-6); - fdprintf(fd, " raw CPU load in us per mix cycle:\n" - " mean=%.0f min=%.0f max=%.0f stddev=%.0f\n", - loadNs.mean()*1e-3, loadNs.minimum()*1e-3, loadNs.maximum()*1e-3, - loadNs.stddev()*1e-3); + dprintf(fd, "Simple moving statistics over last %.1f seconds:\n", wall.n() * mixPeriodSec); + dprintf(fd, " wall clock time in ms per mix cycle:\n" + " mean=%.2f min=%.2f max=%.2f stddev=%.2f\n", + wall.mean()*1e-6, wall.minimum()*1e-6, wall.maximum()*1e-6, wall.stddev()*1e-6); + dprintf(fd, " raw CPU load in us per mix cycle:\n" + " mean=%.0f min=%.0f max=%.0f stddev=%.0f\n", + loadNs.mean()*1e-3, loadNs.minimum()*1e-3, loadNs.maximum()*1e-3, + loadNs.stddev()*1e-3); #ifdef CPU_FREQUENCY_STATISTICS - fdprintf(fd, " CPU clock frequency in MHz:\n" - " mean=%.0f min=%.0f max=%.0f stddev=%.0f\n", - kHz.mean()*1e-3, kHz.minimum()*1e-3, kHz.maximum()*1e-3, kHz.stddev()*1e-3); - fdprintf(fd, " adjusted CPU load in MHz (i.e. normalized for CPU clock frequency):\n" - " mean=%.1f min=%.1f max=%.1f stddev=%.1f\n", - loadMHz.mean(), loadMHz.minimum(), loadMHz.maximum(), loadMHz.stddev()); + dprintf(fd, " CPU clock frequency in MHz:\n" + " mean=%.0f min=%.0f max=%.0f stddev=%.0f\n", + kHz.mean()*1e-3, kHz.minimum()*1e-3, kHz.maximum()*1e-3, kHz.stddev()*1e-3); + dprintf(fd, " adjusted CPU load in MHz (i.e. normalized for CPU clock frequency):\n" + " mean=%.1f min=%.1f max=%.1f stddev=%.1f\n", + loadMHz.mean(), loadMHz.minimum(), loadMHz.maximum(), loadMHz.stddev()); #endif if (tail != NULL) { qsort(tail, n, sizeof(uint32_t), compare_uint32_t); @@ -808,12 +807,12 @@ void FastMixerDumpState::dump(int fd) const left.sample(tail[i]); right.sample(tail[n - (i + 1)]); } - fdprintf(fd, "Distribution of mix cycle times in ms for the tails (> ~3 stddev outliers):\n" - " left tail: mean=%.2f min=%.2f max=%.2f stddev=%.2f\n" - " right tail: mean=%.2f min=%.2f max=%.2f stddev=%.2f\n", - left.mean()*1e-6, left.minimum()*1e-6, left.maximum()*1e-6, left.stddev()*1e-6, - right.mean()*1e-6, right.minimum()*1e-6, right.maximum()*1e-6, - right.stddev()*1e-6); + dprintf(fd, "Distribution of mix cycle times in ms for the tails (> ~3 stddev outliers):\n" + " left tail: mean=%.2f min=%.2f max=%.2f stddev=%.2f\n" + " right tail: mean=%.2f min=%.2f max=%.2f stddev=%.2f\n", + left.mean()*1e-6, left.minimum()*1e-6, left.maximum()*1e-6, left.stddev()*1e-6, + right.mean()*1e-6, right.minimum()*1e-6, right.maximum()*1e-6, + right.stddev()*1e-6); delete[] tail; } #endif @@ -823,9 +822,9 @@ void FastMixerDumpState::dump(int fd) const // Instead we always display all tracks, with an indication // of whether we think the track is active. uint32_t trackMask = mTrackMask; - fdprintf(fd, "Fast tracks: kMaxFastTracks=%u activeMask=%#x\n", + dprintf(fd, "Fast tracks: kMaxFastTracks=%u activeMask=%#x\n", FastMixerState::kMaxFastTracks, trackMask); - fdprintf(fd, "Index Active Full Partial Empty Recent Ready\n"); + dprintf(fd, "Index Active Full Partial Empty Recent Ready\n"); for (uint32_t i = 0; i < FastMixerState::kMaxFastTracks; ++i, trackMask >>= 1) { bool isActive = trackMask & 1; const FastTrackDump *ftDump = &mTracks[i]; @@ -845,7 +844,7 @@ void FastMixerDumpState::dump(int fd) const mostRecent = "?"; break; } - fdprintf(fd, "%5u %6s %4u %7u %5u %7s %5zu\n", i, isActive ? "yes" : "no", + dprintf(fd, "%5u %6s %4u %7u %5u %7s %5zu\n", i, isActive ? "yes" : "no", (underruns.mBitFields.mFull) & UNDERRUN_MASK, (underruns.mBitFields.mPartial) & UNDERRUN_MASK, (underruns.mBitFields.mEmpty) & UNDERRUN_MASK, diff --git a/services/audioflinger/FastMixer.h b/services/audioflinger/FastMixer.h index 6158925b32..c356d311d0 100644 --- a/services/audioflinger/FastMixer.h +++ b/services/audioflinger/FastMixer.h @@ -17,11 +17,10 @@ #ifndef ANDROID_AUDIO_FAST_MIXER_H #define ANDROID_AUDIO_FAST_MIXER_H +#include <linux/futex.h> +#include <sys/syscall.h> #include <utils/Debug.h> #include <utils/Thread.h> -extern "C" { -#include "../private/bionic_futex.h" -} #include "StateQueue.h" #include "FastMixerState.h" diff --git a/services/audioflinger/StateQueue.cpp b/services/audioflinger/StateQueue.cpp index 48399c01cd..7e01c9f2d2 100644 --- a/services/audioflinger/StateQueue.cpp +++ b/services/audioflinger/StateQueue.cpp @@ -28,12 +28,12 @@ namespace android { #ifdef STATE_QUEUE_DUMP void StateQueueObserverDump::dump(int fd) { - fdprintf(fd, "State queue observer: stateChanges=%u\n", mStateChanges); + dprintf(fd, "State queue observer: stateChanges=%u\n", mStateChanges); } void StateQueueMutatorDump::dump(int fd) { - fdprintf(fd, "State queue mutator: pushDirty=%u pushAck=%u blockedSequence=%u\n", + dprintf(fd, "State queue mutator: pushDirty=%u pushAck=%u blockedSequence=%u\n", mPushDirty, mPushAck, mBlockedSequence); } #endif diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 1da5147e07..61d881e035 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -1116,7 +1116,7 @@ void AudioFlinger::PlaybackThread::dumpTracks(int fd, const Vector<String16>& ar // These values are "raw"; they will wrap around. See prepareTracks_l() for a better way. FastTrackUnderruns underruns = getFastTrackUnderruns(0); - fdprintf(fd, "Normal mixer raw underrun counters: partial=%u empty=%u\n", + dprintf(fd, "Normal mixer raw underrun counters: partial=%u empty=%u\n", underruns.mBitFields.mPartial, underruns.mBitFields.mEmpty); } @@ -1144,7 +1144,7 @@ void AudioFlinger::PlaybackThread::dumpInternals(int fd, const Vector<String16>& snprintf(buffer, SIZE, "mix buffer : %p\n", mMixBuffer); result.append(buffer); write(fd, result.string(), result.size()); - fdprintf(fd, "Fast track availMask=%#x\n", mFastTrackAvailMask); + dprintf(fd, "Fast track availMask=%#x\n", mFastTrackAvailMask); dumpBase(fd, args); } @@ -2603,7 +2603,7 @@ AudioFlinger::MixerThread::~MixerThread() if (state->mCommand == FastMixerState::COLD_IDLE) { int32_t old = android_atomic_inc(&mFastMixerFutex); if (old == -1) { - __futex_syscall3(&mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); + (void) syscall(__NR_futex, &mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); } } state->mCommand = FastMixerState::EXIT; @@ -2660,7 +2660,7 @@ ssize_t AudioFlinger::MixerThread::threadLoop_write() if (state->mCommand == FastMixerState::COLD_IDLE) { int32_t old = android_atomic_inc(&mFastMixerFutex); if (old == -1) { - __futex_syscall3(&mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); + (void) syscall(__NR_futex, &mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); } #ifdef AUDIO_WATCHDOG if (mAudioWatchdog != 0) { @@ -3951,7 +3951,10 @@ void AudioFlinger::OffloadThread::threadLoop_exit() mMixerStatus = MIXER_DRAIN_ALL; threadLoop_drain(); } - mCallbackThread->exit(); + if (mUseAsyncWrite) { + ALOG_ASSERT(mCallbackThread != 0); + mCallbackThread->exit(); + } PlaybackThread::threadLoop_exit(); } diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp index b59333f468..cce0a32b6e 100644 --- a/services/audioflinger/Tracks.cpp +++ b/services/audioflinger/Tracks.cpp @@ -21,6 +21,7 @@ #include "Configuration.h" #include <math.h> +#include <sys/syscall.h> #include <utils/Log.h> #include <private/media/AudioTrackShared.h> @@ -952,7 +953,7 @@ void AudioFlinger::PlaybackThread::Track::invalidate() android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_release_store(0x40000000, &cblk->mFutex); // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE - (void) __futex_syscall3(&cblk->mFutex, FUTEX_WAKE, INT_MAX); + (void) syscall(__NR_futex, &cblk->mFutex, FUTEX_WAKE, INT_MAX); mIsInvalid = true; } @@ -1839,7 +1840,7 @@ void AudioFlinger::RecordThread::RecordTrack::invalidate() android_atomic_or(CBLK_INVALID, &cblk->mFlags); android_atomic_release_store(0x40000000, &cblk->mFutex); // client is not in server, so FUTEX_WAKE is needed instead of FUTEX_WAKE_PRIVATE - (void) __futex_syscall3(&cblk->mFutex, FUTEX_WAKE, INT_MAX); + (void) syscall(__NR_futex, &cblk->mFutex, FUTEX_WAKE, INT_MAX); } diff --git a/services/camera/libcameraservice/utils/CameraTraces.cpp b/services/camera/libcameraservice/utils/CameraTraces.cpp index 346e15f7de..374dc5ed0c 100644 --- a/services/camera/libcameraservice/utils/CameraTraces.cpp +++ b/services/camera/libcameraservice/utils/CameraTraces.cpp @@ -74,10 +74,10 @@ status_t CameraTraces::dump(int fd, const Vector<String16> &args __attribute__(( return BAD_VALUE; } - fdprintf(fd, "Camera traces (%zu):\n", pcsList.size()); + dprintf(fd, "Camera traces (%zu):\n", pcsList.size()); if (pcsList.empty()) { - fdprintf(fd, " No camera traces collected.\n"); + dprintf(fd, " No camera traces collected.\n"); } // Print newest items first diff --git a/services/medialog/MediaLogService.cpp b/services/medialog/MediaLogService.cpp index 683fdf3fe1..e53b3a64d3 100644 --- a/services/medialog/MediaLogService.cpp +++ b/services/medialog/MediaLogService.cpp @@ -60,7 +60,7 @@ status_t MediaLogService::dump(int fd, const Vector<String16>& args) static const String16 sDump("android.permission.DUMP"); if (!(IPCThreadState::self()->getCallingUid() == AID_MEDIA || PermissionCache::checkCallingPermission(sDump))) { - fdprintf(fd, "Permission Denial: can't dump media.log from pid=%d, uid=%d\n", + dprintf(fd, "Permission Denial: can't dump media.log from pid=%d, uid=%d\n", IPCThreadState::self()->getCallingPid(), IPCThreadState::self()->getCallingUid()); return NO_ERROR; @@ -74,7 +74,7 @@ status_t MediaLogService::dump(int fd, const Vector<String16>& args) for (size_t i = 0; i < namedReaders.size(); i++) { const NamedReader& namedReader = namedReaders[i]; if (fd >= 0) { - fdprintf(fd, "\n%s:\n", namedReader.name()); + dprintf(fd, "\n%s:\n", namedReader.name()); } else { ALOGI("%s:", namedReader.name()); } |