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

Commit 0e6538a9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Check if the trace was stopped before starting the tracing thread" into...

Merge "Check if the trace was stopped before starting the tracing thread" into rvc-dev am: 164a1d8b

Change-Id: I1c338406868c062b84741160e5b10192ecc88259
parents dc67deb3 164a1d8b
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -36,22 +36,21 @@ SurfaceTracing::SurfaceTracing(SurfaceFlinger& flinger)
      : mFlinger(flinger), mSfLock(flinger.mDrawingStateLock) {}
      : mFlinger(flinger), mSfLock(flinger.mDrawingStateLock) {}


void SurfaceTracing::mainLoop() {
void SurfaceTracing::mainLoop() {
    addFirstEntry();
    bool enabled = addFirstEntry();
    bool enabled = true;
    while (enabled) {
    while (enabled) {
        LayersTraceProto entry = traceWhenNotified();
        LayersTraceProto entry = traceWhenNotified();
        enabled = addTraceToBuffer(entry);
        enabled = addTraceToBuffer(entry);
    }
    }
}
}


void SurfaceTracing::addFirstEntry() {
bool SurfaceTracing::addFirstEntry() {
    const auto displayDevice = mFlinger.getDefaultDisplayDevice();
    const auto displayDevice = mFlinger.getDefaultDisplayDevice();
    LayersTraceProto entry;
    LayersTraceProto entry;
    {
    {
        std::scoped_lock lock(mSfLock);
        std::scoped_lock lock(mSfLock);
        entry = traceLayersLocked("tracing.enable", displayDevice);
        entry = traceLayersLocked("tracing.enable", displayDevice);
    }
    }
    addTraceToBuffer(entry);
    return addTraceToBuffer(entry);
}
}


LayersTraceProto SurfaceTracing::traceWhenNotified() {
LayersTraceProto SurfaceTracing::traceWhenNotified() {
+1 −1
Original line number Original line Diff line number Diff line
@@ -90,7 +90,7 @@ private:
    };
    };


    void mainLoop();
    void mainLoop();
    void addFirstEntry();
    bool addFirstEntry();
    LayersTraceProto traceWhenNotified();
    LayersTraceProto traceWhenNotified();
    LayersTraceProto traceLayersLocked(const char* where,
    LayersTraceProto traceLayersLocked(const char* where,
                                       const sp<const DisplayDevice>& displayDevice)
                                       const sp<const DisplayDevice>& displayDevice)