Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c28d8dc authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "add an option to EGL to dump stack traces on errors"

parents e6bf4c2b ecfe091a
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -148,11 +148,14 @@ static int gl_no_context() {
    if (egl_tls_t::logNoContextCall()) {
    if (egl_tls_t::logNoContextCall()) {
        LOGE("call to OpenGL ES API with no current context "
        LOGE("call to OpenGL ES API with no current context "
             "(logged once per thread)");
             "(logged once per thread)");
        LOGE("call stack before error:");
        char value[PROPERTY_VALUE_MAX];
        property_get("debug.egl.callstack", value, "0");
        if (atoi(value)) {
            CallStack stack;
            CallStack stack;
            stack.update();
            stack.update();
            stack.dump();
            stack.dump();
        }
        }
    }
    return 0;
    return 0;
}
}


+11 −0
Original line number Original line Diff line number Diff line
@@ -14,9 +14,13 @@
 ** limitations under the License.
 ** limitations under the License.
 */
 */


#include <stdlib.h>
#include <pthread.h>
#include <pthread.h>


#include <cutils/log.h>
#include <cutils/log.h>
#include <cutils/properties.h>

#include <utils/CallStack.h>


#include <EGL/egl.h>
#include <EGL/egl.h>


@@ -69,6 +73,13 @@ void egl_tls_t::setErrorEtcImpl(const char* caller, int line, EGLint error) {
    if (tls->error != error) {
    if (tls->error != error) {
        LOGE("%s:%d error %x (%s)", caller, line, error, egl_strerror(error));
        LOGE("%s:%d error %x (%s)", caller, line, error, egl_strerror(error));
        tls->error = error;
        tls->error = error;
        char value[PROPERTY_VALUE_MAX];
        property_get("debug.egl.callstack", value, "0");
        if (atoi(value)) {
            CallStack stack;
            stack.update();
            stack.dump();
        }
    }
    }
}
}