summaryrefslogtreecommitdiff
path: root/libs/gui/BLASTBufferQueue.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2024-09-13 22:34:11 +0000
committer Alec Mouri <alecmouri@google.com> 2024-09-13 23:37:38 +0000
commit3118f969f488b738de1976917a0944705c209173 (patch)
treee7f0d3def33e5efe4809a92756de74ec9811b06c /libs/gui/BLASTBufferQueue.cpp
parentec115475e968329f8198ecc49458714229a3afff (diff)
Add some tracing for release fences
* Fix FenceMonitor to cleanly teardown * App-side tracing for BBQ release callbacks * Trace future compleition in TxnCallbackInvoker Bug: 360932099 Bug: 357762453 Flag: EXEMPT debugging Test: builds Test: perfetto Change-Id: I188c04da1e249b672b428837c328568d9e7a1e66
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
-rw-r--r--libs/gui/BLASTBufferQueue.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index 3c1971fd81..94998e5ab7 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -31,6 +31,7 @@
#include <sys/epoll.h>
#include <sys/eventfd.h>
+#include <gui/FenceMonitor.h>
#include <gui/FrameRateUtils.h>
#include <gui/GLConsumer.h>
#include <gui/IProducerListener.h>
@@ -475,6 +476,16 @@ void BLASTBufferQueue::releaseBufferCallbackLocked(
ATRACE_CALL();
BQA_LOGV("releaseBufferCallback %s", id.to_string().c_str());
+ if (CC_UNLIKELY(atrace_is_tag_enabled(ATRACE_TAG_GRAPHICS))) {
+ if (!mFenceMonitor) {
+ std::string monitorName = "release :";
+ monitorName.append(mName.c_str());
+ mFenceMonitor.emplace(monitorName.c_str());
+ }
+
+ mFenceMonitor->queueFence(releaseFence);
+ }
+
// Calculate how many buffers we need to hold before we release them back
// to the buffer queue. This will prevent higher latency when we are running
// on a lower refresh rate than the max supported. We only do that for EGL