summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2012-10-29 16:49:44 -0700
committerAndy McFadden <fadden@android.com>2012-11-08 16:40:11 -0800
commit3fdeb48e3c89be15fe3b539a26ec9a3cf28c898c (patch)
tree99c42430f3e6afe78df97d6e36f7a5e845e8f98f
parent0b2c9268265e9a165551eaa66cb461d3fab8b564 (diff)
downloadframeworks_native-3fdeb48e3c89be15fe3b539a26ec9a3cf28c898c.zip
frameworks_native-3fdeb48e3c89be15fe3b539a26ec9a3cf28c898c.tar.gz
frameworks_native-3fdeb48e3c89be15fe3b539a26ec9a3cf28c898c.tar.bz2
Reduce emulator logspam
The emulator doesn't support systrace, but we should point that out at most once per process. Bug 7436352 Change-Id: I06b2c1ea0df6c02c11cd2496423c337f8d7c62a1
-rw-r--r--include/utils/Trace.h2
-rw-r--r--libs/utils/Trace.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/include/utils/Trace.h b/include/utils/Trace.h
index 93e2285..41bce00 100644
--- a/include/utils/Trace.h
+++ b/include/utils/Trace.h
@@ -54,6 +54,8 @@
#define ATRACE_TAG_CAMERA (1<<10)
#define ATRACE_TAG_LAST ATRACE_TAG_CAMERA
+#define ATRACE_TAG_NOT_READY (1LL<<63) // Reserved for use during init
+
#define ATRACE_TAG_VALID_MASK ((ATRACE_TAG_LAST - 1) | ATRACE_TAG_LAST)
#ifndef ATRACE_TAG
diff --git a/libs/utils/Trace.cpp b/libs/utils/Trace.cpp
index 5cd5731..f5aaea3 100644
--- a/libs/utils/Trace.cpp
+++ b/libs/utils/Trace.cpp
@@ -25,7 +25,7 @@ namespace android {
volatile int32_t Tracer::sIsReady = 0;
int Tracer::sTraceFD = -1;
-uint64_t Tracer::sEnabledTags = 0;
+uint64_t Tracer::sEnabledTags = ATRACE_TAG_NOT_READY;
Mutex Tracer::sMutex;
void Tracer::changeCallback() {
@@ -46,7 +46,7 @@ void Tracer::init() {
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
+ sEnabledTags = 0; // no tracing can occur
} else {
loadSystemProperty();
}