summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamie Gennis2013-05-07 20:12:18 -0500
committerAndroid (Google) Code Review2013-05-07 20:12:19 -0500
commita1ee12ca3a0ec44bb8a3eb917d13c0b5178075d9 (patch)
tree95aaa758c05821b976746f54d169b478c98b8774
parentfee250d27a9c03af1ba439047b976d89563b1887 (diff)
parent2b68e0675b3e3e2f45001e4597872609d26956ae (diff)
downloadplatform-system-core-a1ee12ca3a0ec44bb8a3eb917d13c0b5178075d9.tar.gz
platform-system-core-a1ee12ca3a0ec44bb8a3eb917d13c0b5178075d9.tar.xz
platform-system-core-a1ee12ca3a0ec44bb8a3eb917d13c0b5178075d9.zip
Merge "libcutils: add a trace tag for Dalvik" into jb-mr2-dev
-rw-r--r--include/cutils/trace.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/cutils/trace.h b/include/cutils/trace.h
index 9b564e25e..29034cab5 100644
--- a/include/cutils/trace.h
+++ b/include/cutils/trace.h
@@ -65,7 +65,8 @@ __BEGIN_DECLS
65#define ATRACE_TAG_HAL (1<<11) 65#define ATRACE_TAG_HAL (1<<11)
66#define ATRACE_TAG_APP (1<<12) 66#define ATRACE_TAG_APP (1<<12)
67#define ATRACE_TAG_RESOURCES (1<<13) 67#define ATRACE_TAG_RESOURCES (1<<13)
68#define ATRACE_TAG_LAST ATRACE_TAG_RESOURCES 68#define ATRACE_TAG_DALVIK (1<<14)
69#define ATRACE_TAG_LAST ATRACE_TAG_DALVIK
69 70
70// Reserved for initialization. 71// Reserved for initialization.
71#define ATRACE_TAG_NOT_READY (1LL<<63) 72#define ATRACE_TAG_NOT_READY (1LL<<63)
@@ -78,6 +79,7 @@ __BEGIN_DECLS
78#error ATRACE_TAG must be defined to be one of the tags defined in cutils/trace.h 79#error ATRACE_TAG must be defined to be one of the tags defined in cutils/trace.h
79#endif 80#endif
80 81
82#ifdef HAVE_ANDROID_OS
81/** 83/**
82 * Maximum size of a message that can be logged to the trace buffer. 84 * Maximum size of a message that can be logged to the trace buffer.
83 * Note this message includes a tag, the pid, and the string given as the name. 85 * Note this message includes a tag, the pid, and the string given as the name.
@@ -256,6 +258,19 @@ static inline void atrace_int(uint64_t tag, const char* name, int32_t value)
256 } 258 }
257} 259}
258 260
261#else // not HAVE_ANDROID_OS
262
263#define ATRACE_INIT()
264#define ATRACE_GET_ENABLED_TAGS()
265#define ATRACE_ENABLED()
266#define ATRACE_BEGIN(name)
267#define ATRACE_END()
268#define ATRACE_ASYNC_BEGIN(name, cookie)
269#define ATRACE_ASYNC_END(name, cookie)
270#define ATRACE_INT(name, value)
271
272#endif // not HAVE_ANDROID_OS
273
259__END_DECLS 274__END_DECLS
260 275
261#endif // _LIBS_CUTILS_TRACE_H 276#endif // _LIBS_CUTILS_TRACE_H