Expose the set of enabled tags.
This is used by the Java trace wrappers to avoid JNI overhead
when trace tags are disabled.
Also added a new tag for the input subsystem and view hierarchy.
Change-Id: Ia04a507e42a37b1d3bbb19859e6c07a92f4fe9aa
diff --git a/libs/utils/Trace.cpp b/libs/utils/Trace.cpp
index c49278a..d532296 100644
--- a/libs/utils/Trace.cpp
+++ b/libs/utils/Trace.cpp
@@ -34,10 +34,12 @@
sTraceFD = open(traceFileName, O_WRONLY);
if (sTraceFD == -1) {
ALOGE("error opening trace file: %s (%d)", strerror(errno), errno);
+ // sEnabledTags remains zero indicating that no tracing can occur
} else {
char value[PROPERTY_VALUE_MAX];
property_get("atrace.tags.enableflags", value, "0");
- sEnabledTags = strtoll(value, NULL, 0) | ATRACE_TAG_ALWAYS;
+ sEnabledTags = (strtoll(value, NULL, 0) & ATRACE_TAG_VALID_MASK)
+ | ATRACE_TAG_ALWAYS;
}
android_atomic_release_store(1, &sIsReady);