Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63b3c872 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Support skipping layer dump on virtual displays

Virtual displays consume significant buffer space and
frequently fill the in memory ring buffer during the transition, causing
test flakiness. To mitigate this problem, do'nt dump traces from virtual
displays by default

Bug: 255715397
Test: atest FlickerLibTest
Change-Id: I4a5d8a1fac52899f126edccf6534bed4876b10e0
parent 4da2bc58
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -5016,8 +5016,22 @@ void SurfaceFlinger::dumpWideColorInfo(std::string& result) const {
}

LayersProto SurfaceFlinger::dumpDrawingStateProto(uint32_t traceFlags) const {
    std::unordered_set<uint64_t> stackIdsToSkip;

    // Determine if virtual layers display should be skipped
    if ((traceFlags & LayerTracing::TRACE_VIRTUAL_DISPLAYS) == 0) {
        for (const auto& [_, display] : FTL_FAKE_GUARD(mStateLock, mDisplays)) {
            if (display->isVirtual()) {
                stackIdsToSkip.insert(display->getLayerStack().id);
            }
        }
    }

    LayersProto layersProto;
    for (const sp<Layer>& layer : mDrawingState.layersSortedByZ) {
        if (stackIdsToSkip.find(layer->getLayerStack().id) != stackIdsToSkip.end()) {
            continue;
        }
        layer->writeToProto(layersProto, traceFlags);
    }

+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ public:
        TRACE_EXTRA = 1 << 3,
        TRACE_HWC = 1 << 4,
        TRACE_BUFFERS = 1 << 5,
        TRACE_VIRTUAL_DISPLAYS = 1 << 6,
        TRACE_ALL = TRACE_INPUT | TRACE_COMPOSITION | TRACE_EXTRA,
    };
    void setTraceFlags(uint32_t flags);