Check if the trace was stopped before starting the tracing thread
If a winscope trace is started and stopped quickly, the tracing thread
will not be stopped. The tracing thread waits for a conditional variable
notification that is sent before the thread starts running. To fix the
issue, properly initialize the trace enabled variable in the tracing
thread.
Test: atest FlickerLibTest:LayersTraceMonitorTest
Fixes: 153206487
Change-Id: I0c591c1fc3209327b40323b3ebb4fa4279c6ed05
diff --git a/services/surfaceflinger/SurfaceTracing.h b/services/surfaceflinger/SurfaceTracing.h
index 83872ed..5dae169 100644
--- a/services/surfaceflinger/SurfaceTracing.h
+++ b/services/surfaceflinger/SurfaceTracing.h
@@ -85,7 +85,7 @@
};
void mainLoop();
- void addFirstEntry();
+ bool addFirstEntry();
LayersTraceProto traceWhenNotified();
LayersTraceProto traceLayersLocked(const char* where,
const sp<const DisplayDevice>& displayDevice)