diff options
| author | 2020-04-09 00:19:23 +0000 | |
|---|---|---|
| committer | 2020-04-09 00:19:23 +0000 | |
| commit | 164a1d8b1eb9b12894e62e76813421d8bd7fd830 (patch) | |
| tree | 379f43d1d2432e577159209769b23d65b9a8ad3d | |
| parent | db283837dc09d0f5d7f9d54ea1b26d2651488ece (diff) | |
| parent | 73454c3371c6c031c602b6ae90a565a96175e685 (diff) | |
Merge "Check if the trace was stopped before starting the tracing thread" into rvc-dev
| -rw-r--r-- | services/surfaceflinger/SurfaceTracing.cpp | 7 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceTracing.h | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/services/surfaceflinger/SurfaceTracing.cpp b/services/surfaceflinger/SurfaceTracing.cpp index 0b1251eac6..f0b895d047 100644 --- a/services/surfaceflinger/SurfaceTracing.cpp +++ b/services/surfaceflinger/SurfaceTracing.cpp @@ -36,22 +36,21 @@ SurfaceTracing::SurfaceTracing(SurfaceFlinger& flinger) : mFlinger(flinger), mSfLock(flinger.mDrawingStateLock) {} void SurfaceTracing::mainLoop() { - addFirstEntry(); - bool enabled = true; + bool enabled = addFirstEntry(); while (enabled) { LayersTraceProto entry = traceWhenNotified(); enabled = addTraceToBuffer(entry); } } -void SurfaceTracing::addFirstEntry() { +bool SurfaceTracing::addFirstEntry() { const auto displayDevice = mFlinger.getDefaultDisplayDevice(); LayersTraceProto entry; { std::scoped_lock lock(mSfLock); entry = traceLayersLocked("tracing.enable", displayDevice); } - addTraceToBuffer(entry); + return addTraceToBuffer(entry); } LayersTraceProto SurfaceTracing::traceWhenNotified() { diff --git a/services/surfaceflinger/SurfaceTracing.h b/services/surfaceflinger/SurfaceTracing.h index a00e5d64af..e90fc4d9e6 100644 --- a/services/surfaceflinger/SurfaceTracing.h +++ b/services/surfaceflinger/SurfaceTracing.h @@ -90,7 +90,7 @@ private: }; void mainLoop(); - void addFirstEntry(); + bool addFirstEntry(); LayersTraceProto traceWhenNotified(); LayersTraceProto traceLayersLocked(const char* where, const sp<const DisplayDevice>& displayDevice) |