diff options
| author | 2023-12-06 17:04:54 +0800 | |
|---|---|---|
| committer | 2023-12-06 09:27:39 +0000 | |
| commit | c476a34059e1769fc07299a96454b312cda89cfc (patch) | |
| tree | ed6318be9fbdbe6b86b53500efe812b8c5257c8d | |
| parent | f1e4a205322b15d1530430a4b22ad238bbf9427b (diff) | |
Add handleAlive in logs for child layers for layer leaks.
It is useful to judge whether the SurfaceControl of this child layer
is released when the layer leak issue happened because child layer
won't be added to mOffScreenLayers when its LayerHandle is destroyed,
so we can not get its handleAlive in dumps or logs of offscreenlayer.
Test: logcat
Change-Id: I93f25d7ea5bd91f9c89960e05916a8c9d3fe277a
Signed-off-by: jiayongqiang <jiayongqiang@xiaomi.com>
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 7c85452462..df33e0c7e8 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -4192,7 +4192,8 @@ status_t SurfaceFlinger::addClientLayer(LayerCreationArgs& args, const sp<IBinde int sampleSize = (layer->getChildrenCount() / 100) + 1; layer->traverseChildren([&](Layer* layer) { if (rand() % sampleSize == 0) { - ALOGE("Child Layer: %s", layer->getName().c_str()); + ALOGE("Child Layer: %s%s", layer->getName().c_str(), + (layer->isHandleAlive() ? "handleAlive" : "")); } }); } |