diff options
author | Mathias Agopian <mathias@google.com> | 2012-03-01 22:11:25 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-03-01 22:20:24 -0800 |
commit | 546ed2d7d98ce4f1415647913a231a6b4fc6ca66 (patch) | |
tree | b273d822c8f3e0aa6e88985caa39e2809b43623b /libs/gui | |
parent | 06b573e4f9a6600ed41c653f2371ca45779ccaa9 (diff) | |
download | frameworks_native-546ed2d7d98ce4f1415647913a231a6b4fc6ca66.zip frameworks_native-546ed2d7d98ce4f1415647913a231a6b4fc6ca66.tar.gz frameworks_native-546ed2d7d98ce4f1415647913a231a6b4fc6ca66.tar.bz2 |
Add ATRACEs for Buffer indices
Change-Id: I44d7a9a9bf03f418cab2a4854583aac9e533daee
Diffstat (limited to 'libs/gui')
-rw-r--r-- | libs/gui/BufferQueue.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp index d761680..70051e4 100644 --- a/libs/gui/BufferQueue.cpp +++ b/libs/gui/BufferQueue.cpp @@ -56,6 +56,11 @@ #define ST_LOGW(x, ...) ALOGW("[%s] "x, mConsumerName.string(), ##__VA_ARGS__) #define ST_LOGE(x, ...) ALOGE("[%s] "x, mConsumerName.string(), ##__VA_ARGS__) +#define ATRACE_BUFFER_INDEX(index) \ + char ___traceBuf[1024]; \ + snprintf(___traceBuf, 1024, "%s: %d", mConsumerName.string(), (index)); \ + android::ScopedTrace ___bufTracer(ATRACE_TAG, ___traceBuf); + namespace android { // Get an ID that's unique within this process. @@ -387,6 +392,8 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h, const int buf = found; *outBuf = found; + ATRACE_BUFFER_INDEX(buf); + const bool useDefaultSize = !w && !h; if (useDefaultSize) { // use the default size @@ -497,6 +504,8 @@ status_t BufferQueue::setSynchronousMode(bool enabled) { status_t BufferQueue::queueBuffer(int buf, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) { ATRACE_CALL(); + ATRACE_BUFFER_INDEX(buf); + ST_LOGV("queueBuffer: slot=%d time=%lld", buf, timestamp); sp<FrameAvailableListener> listener; @@ -810,6 +819,7 @@ void BufferQueue::freeAllBuffersLocked() { } status_t BufferQueue::acquire(BufferItem *buffer) { + ATRACE_CALL(); Mutex::Autolock _l(mMutex); // check if queue is empty // In asynchronous mode the list is guaranteed to be one buffer @@ -818,6 +828,8 @@ status_t BufferQueue::acquire(BufferItem *buffer) { Fifo::iterator front(mQueue.begin()); int buf = *front; + ATRACE_BUFFER_INDEX(buf); + if (mSlots[buf].mAcquireCalled) { buffer->mGraphicBuffer = NULL; } @@ -845,6 +857,9 @@ status_t BufferQueue::acquire(BufferItem *buffer) { status_t BufferQueue::releaseBuffer(int buf, EGLDisplay display, EGLSyncKHR fence) { + ATRACE_CALL(); + ATRACE_BUFFER_INDEX(buf); + Mutex::Autolock _l(mMutex); if (buf == INVALID_BUFFER_SLOT) { |