diff options
author | Jamie Gennis <jgennis@google.com> | 2013-09-18 19:17:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-18 19:17:58 +0000 |
commit | 9d773b978b9fc26fb08a973e0290aba5432b720a (patch) | |
tree | d2c2a9c36127b54fac7dbe0b1a55e9e782f00895 | |
parent | 5535b05120fa3fd3d68a09e01284aba35cc6e058 (diff) | |
parent | f1921c79498cb2c048caf4f1725e74c22cae3e8f (diff) | |
download | system_core-9d773b978b9fc26fb08a973e0290aba5432b720a.zip system_core-9d773b978b9fc26fb08a973e0290aba5432b720a.tar.gz system_core-9d773b978b9fc26fb08a973e0290aba5432b720a.tar.bz2 |
Merge "trace: Add support for tracing 64-bit ints." into klp-dev
-rw-r--r-- | include/cutils/trace.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/cutils/trace.h b/include/cutils/trace.h index a0dd1e0..1c8f107 100644 --- a/include/cutils/trace.h +++ b/include/cutils/trace.h @@ -259,6 +259,23 @@ static inline void atrace_int(uint64_t tag, const char* name, int32_t value) } } +/** + * Traces a 64-bit integer counter value. name is used to identify the + * counter. This can be used to track how a value changes over time. + */ +#define ATRACE_INT64(name, value) atrace_int64(ATRACE_TAG, name, value) +static inline void atrace_int64(uint64_t tag, const char* name, int64_t value) +{ + if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { + char buf[ATRACE_MESSAGE_LENGTH]; + size_t len; + + len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "C|%d|%s|%lld", + getpid(), name, value); + write(atrace_marker_fd, buf, len); + } +} + #else // not HAVE_ANDROID_OS #define ATRACE_INIT() |