From 3118f969f488b738de1976917a0944705c209173 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 13 Sep 2024 22:34:11 +0000 Subject: 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 --- libs/gui/BLASTBufferQueue.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libs/gui/BLASTBufferQueue.cpp') 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 #include +#include #include #include #include @@ -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 -- cgit v1.2.3-59-g8ed1b