summaryrefslogtreecommitdiffstats
path: root/opengl/libs
diff options
context:
space:
mode:
authorMichael Lentine <mlentine@google.com>2014-09-11 12:24:13 -0700
committerMichael Lentine <mlentine@google.com>2014-09-23 08:30:12 -0700
commit12c4bdad7b2372ab64dcd2abbdbe47e709fb8b90 (patch)
tree62fc4fea471bc3abce1c243e160aa79f4018a133 /opengl/libs
parentd94854030c76fc4ee4126ca1707a76fbd1f29126 (diff)
downloadframeworks_native-12c4bdad7b2372ab64dcd2abbdbe47e709fb8b90.zip
frameworks_native-12c4bdad7b2372ab64dcd2abbdbe47e709fb8b90.tar.gz
frameworks_native-12c4bdad7b2372ab64dcd2abbdbe47e709fb8b90.tar.bz2
Add rate-limited logging for unimplemented es functions.
Bug: 17322013 Change-Id: I7aa5ab2f76cf344cfb75802edbfd44e8e7526ff1
Diffstat (limited to 'opengl/libs')
-rw-r--r--opengl/libs/EGL/egl.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 67fbae5..7c70fa0 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -330,12 +330,26 @@ EGLBoolean egl_init_drivers() {
return res;
}
+static pthread_mutex_t sLogPrintMutex = PTHREAD_MUTEX_INITIALIZER;
+static nsecs_t sLogPrintTime = 0;
+#define NSECS_DURATION 1000000000
+
void gl_unimplemented() {
- ALOGE("called unimplemented OpenGL ES API");
- char value[PROPERTY_VALUE_MAX];
- property_get("debug.egl.callstack", value, "0");
- if (atoi(value)) {
- CallStack stack(LOG_TAG);
+ bool printLog = false;
+ nsecs_t now = systemTime();
+ pthread_mutex_lock(&sLogPrintMutex);
+ if ((now - sLogPrintTime) > NSECS_DURATION) {
+ sLogPrintTime = now;
+ printLog = true;
+ }
+ pthread_mutex_unlock(&sLogPrintMutex);
+ if (printLog) {
+ ALOGE("called unimplemented OpenGL ES API");
+ char value[PROPERTY_VALUE_MAX];
+ property_get("debug.egl.callstack", value, "0");
+ if (atoi(value)) {
+ CallStack stack(LOG_TAG);
+ }
}
}