add an option to EGL to dump stack traces on errors
enable by setting debug.egl.callstack to 1
Change-Id: I7fad9ce71b4c4c5ece97d4f9d139348eab742a3c
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index ca62908..1e43195 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -148,10 +148,13 @@
if (egl_tls_t::logNoContextCall()) {
LOGE("call to OpenGL ES API with no current context "
"(logged once per thread)");
- LOGE("call stack before error:");
- CallStack stack;
- stack.update();
- stack.dump();
+ char value[PROPERTY_VALUE_MAX];
+ property_get("debug.egl.callstack", value, "0");
+ if (atoi(value)) {
+ CallStack stack;
+ stack.update();
+ stack.dump();
+ }
}
return 0;
}