Add property debug.bcc.nocache in Compiler.cpp. Set to 1 if
you want to turn off caching.
Change-Id: I2e997b387e5c7fd76592fbf2d651ca425f06a506
diff --git a/lib/bcc/Compiler.cpp b/lib/bcc/Compiler.cpp
index 7efd05e..65cb0bf 100644
--- a/lib/bcc/Compiler.cpp
+++ b/lib/bcc/Compiler.cpp
@@ -104,6 +104,8 @@
#include <sys/types.h>
#include <unistd.h>
+#include <cutils/properties.h>
+
#include <string>
#include <vector>
@@ -325,6 +327,13 @@
}
+static bool getProp(const char *str) {
+ char buf[PROPERTY_VALUE_MAX];
+ property_get(str, buf, "0");
+ return 0 != strcmp(buf, "0");
+}
+
+
int Compiler::readBC(const char *bitcode,
size_t bitcodeSize,
const BCCchar *resName,
@@ -360,6 +369,11 @@
mResId = i;
}
+ this->props.mNoCache = getProp("debug.bcc.nocache");
+ if (this->props.mNoCache) {
+ resName = NULL;
+ }
+
if (resName) {
// Turn on mUseCache mode iff
// 1. Has resName