Reduce debugging spew and add props to selectivly re-enable it.
change-id: Ib59ed5d7a9d479ccd1af456029735dbc65ae1efe
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp
index 6c18ddb..653d427 100644
--- a/libs/rs/rsContext.cpp
+++ b/libs/rs/rsContext.cpp
@@ -28,8 +28,6 @@
using namespace android;
using namespace android::renderscript;
-bool g_logTimes = -1;
-
pthread_key_t Context::gThreadTLSKey = 0;
void Context::initEGL()
@@ -117,7 +115,7 @@
bool Context::runRootScript()
{
- if (this->logTimes) {
+ if (props.mLogTimes) {
timerSet(RS_TIMER_CLEAR_SWAP);
}
rsAssert(mRootScript->mEnviroment.mIsRoot);
@@ -140,7 +138,7 @@
glClear(GL_COLOR_BUFFER_BIT);
}
- if (this->logTimes) {
+ if (this->props.mLogTimes) {
timerSet(RS_TIMER_SCRIPT);
}
bool ret = runScript(mRootScript.get(), 0);
@@ -208,10 +206,10 @@
mVertex->setupGL(this, &mStateVertex);
}
-static bool get_log_times()
+static bool getProp(const char *str)
{
char buf[PROPERTY_VALUE_MAX];
- property_get("debug.rs.profile", buf, "0");
+ property_get(str, buf, "0");
return 0 != strcmp(buf, "0");
}
@@ -219,7 +217,9 @@
{
Context *rsc = static_cast<Context *>(vrsc);
- rsc->logTimes = get_log_times();
+ rsc->props.mLogTimes = getProp("debug.rs.profile");
+ rsc->props.mLogScripts = getProp("debug.rs.script");
+ rsc->props.mLogObjects = getProp("debug.rs.objects");
rsc->initEGL();
@@ -252,11 +252,11 @@
if (mDraw) {
mDraw = rsc->runRootScript() && !rsc->mPaused;
- if (rsc->logTimes) {
+ if (rsc->props.mLogTimes) {
rsc->timerSet(RS_TIMER_CLEAR_SWAP);
}
eglSwapBuffers(rsc->mEGL.mDisplay, rsc->mEGL.mSurface);
- if (rsc->logTimes) {
+ if (rsc->props.mLogTimes) {
rsc->timerFrame();
rsc->timerSet(RS_TIMER_INTERNAL);
rsc->timerPrint();