For b/3381327: Save 159+ms for every launch of Books, YouTube, Movie Studio...
Before this CL, you will see in the logcat:
698 StopWatch D StopWatch calcFileSHA1 time (us): 159162
698 bcc I File opened. fd=45
698 bcc I File closed. fd=45
698 StopWatch D StopWatch calcFileSHA1 time (us): 19282
...
This CL also cleans up bcc's logcat.
Change-Id: I4e23b459eee0dc77ef186fb761a64d731a721517
diff --git a/lib/bcc/CacheReader.cpp b/lib/bcc/CacheReader.cpp
index a8e252b..e44f5b5 100644
--- a/lib/bcc/CacheReader.cpp
+++ b/lib/bcc/CacheReader.cpp
@@ -153,7 +153,7 @@
if (memcmp(mpHeader->libbcc_build_time, libbcc_build_time, 24) != 0) {
mpHeader->libbcc_build_time[24 - 1] = '\0'; // ensure terminated
- LOGE("Build time mismatch: lib %s cached %s\n", libbcc_build_time,
+ LOGW("Build time mismatch: lib %s cached %s\n", libbcc_build_time,
mpHeader->libbcc_build_time);
return false;
}
diff --git a/lib/bcc/Compiler.h b/lib/bcc/Compiler.h
index b90c9e1..abfbc3d 100644
--- a/lib/bcc/Compiler.h
+++ b/lib/bcc/Compiler.h
@@ -121,7 +121,6 @@
int compile();
- // interface for bccGetScriptInfoLog()
char const *getErrorMessage() {
return mError.c_str();
}
diff --git a/lib/bcc/ContextManager.cpp b/lib/bcc/ContextManager.cpp
index ea8c8b1..8d173c1 100644
--- a/lib/bcc/ContextManager.cpp
+++ b/lib/bcc/ContextManager.cpp
@@ -119,7 +119,7 @@
}
if (ContextSlotTaken[slot]) {
- LOGE("Suggested bcc context slot has been occupied.\n");
+ LOGW("Suggested bcc context slot has been occupied.\n");
return NULL;
}
diff --git a/lib/bcc/FileHandle.cpp b/lib/bcc/FileHandle.cpp
index db02741..7dcb065 100644
--- a/lib/bcc/FileHandle.cpp
+++ b/lib/bcc/FileHandle.cpp
@@ -54,7 +54,7 @@
continue;
}
- LOGE("Unable to open %s in %s mode. (reason: %s)\n",
+ LOGW("Unable to open %s in %s mode. (reason: %s)\n",
filename, open_mode_str[mode], strerror(errno));
return -1;
@@ -93,11 +93,11 @@
}
// Good, we have open and lock the file correctly.
- LOGI("File opened. fd=%d\n", mFD);
+ LOGV("File opened. fd=%d\n", mFD);
return mFD;
}
- LOGE("Unable to open %s in %s mode.\n", filename, open_mode_str[mode]);
+ LOGW("Unable to open %s in %s mode.\n", filename, open_mode_str[mode]);
return -1;
}
@@ -106,7 +106,7 @@
if (mFD >= 0) {
flock(mFD, LOCK_UN);
::close(mFD);
- LOGI("File closed. fd=%d\n", mFD);
+ LOGV("File closed. fd=%d\n", mFD);
mFD = -1;
}
}
diff --git a/lib/bcc/Script.cpp b/lib/bcc/Script.cpp
index 23e8f41..cb86ef5 100644
--- a/lib/bcc/Script.cpp
+++ b/lib/bcc/Script.cpp
@@ -240,7 +240,7 @@
return 1;
}
- LOGE("Load Library\n");
+ LOGI("Load Library\n");
}
// Compile and JIT the code
diff --git a/lib/bcc/bcc.cpp b/lib/bcc/bcc.cpp
index 11e3a95..d98c0f8 100644
--- a/lib/bcc/bcc.cpp
+++ b/lib/bcc/bcc.cpp
@@ -63,11 +63,13 @@
return wrap(new bcc::Script());
}
+
extern "C" void bccDisposeScript(BCCScriptRef script) {
BCC_FUNC_LOGGER();
delete unwrap(script);
}
+
extern "C" int bccRegisterSymbolCallback(BCCScriptRef script,
BCCSymbolLookupFn pFn,
void *pContext) {
@@ -75,6 +77,7 @@
return unwrap(script)->registerSymbolCallback(pFn, pContext);
}
+
extern "C" int bccGetError(BCCScriptRef script) {
BCC_FUNC_LOGGER();
return unwrap(script)->getError();
@@ -271,4 +274,3 @@
#endif
}
}
-