Add rate-limited logging for unimplemented es functions.
Bug: 17322013 Change-Id: I7aa5ab2f76cf344cfb75802edbfd44e8e7526ff1
This commit is contained in:
parent
d94854030c
commit
12c4bdad7b
@ -330,12 +330,26 @@ EGLBoolean egl_init_drivers() {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static pthread_mutex_t sLogPrintMutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
static nsecs_t sLogPrintTime = 0;
|
||||||
|
#define NSECS_DURATION 1000000000
|
||||||
|
|
||||||
void gl_unimplemented() {
|
void gl_unimplemented() {
|
||||||
ALOGE("called unimplemented OpenGL ES API");
|
bool printLog = false;
|
||||||
char value[PROPERTY_VALUE_MAX];
|
nsecs_t now = systemTime();
|
||||||
property_get("debug.egl.callstack", value, "0");
|
pthread_mutex_lock(&sLogPrintMutex);
|
||||||
if (atoi(value)) {
|
if ((now - sLogPrintTime) > NSECS_DURATION) {
|
||||||
CallStack stack(LOG_TAG);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user