am 9d773b97: Merge "trace: Add support for tracing 64-bit ints." into klp-dev
* commit '9d773b978b9fc26fb08a973e0290aba5432b720a': trace: Add support for tracing 64-bit ints.
This commit is contained in:
commit
3929efb9d4
1 changed files with 17 additions and 0 deletions
|
|
@ -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
|
#else // not HAVE_ANDROID_OS
|
||||||
|
|
||||||
#define ATRACE_INIT()
|
#define ATRACE_INIT()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue