Add requestor name to GraphicBuffer alloc metadata
Adds a requestor name (usually the BufferQueue consumer's name) to the
metadata that GraphicBufferAllocator stores on allocation so that
`dumpsys SurfaceFlinger` can attempt to attribute buffer usage to the
correct client.
Bug: 30776557
Change-Id: I6e0f346584c871bb3b9d5481f82b697b0475a916
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index fcb9357..03abc49 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -1872,7 +1872,9 @@
return setError(EGL_BAD_PARAMETER, (EGLClientBuffer)0);
}
- GraphicBuffer* gBuffer = new GraphicBuffer(width, height, format, usage);
+ GraphicBuffer* gBuffer = new GraphicBuffer(width, height, format, usage,
+ std::string("[eglCreateNativeClientBufferANDROID pid ") +
+ std::to_string(getpid()) + ']');
const status_t err = gBuffer->initCheck();
if (err != NO_ERROR) {
ALOGE("Unable to create native buffer { w=%d, h=%d, f=%d, u=%#x }: %#x",