Loading include/log/log.h +1 −1 Original line number Diff line number Diff line Loading @@ -491,7 +491,7 @@ typedef enum { #endif #ifndef LOG_EVENT_STRING #define LOG_EVENT_STRING(_tag, _value) \ ((void) 0) /* not implemented -- must combine len with string */ (void) __android_log_bswrite(_tag, _value); #endif /* TODO: something for LIST */ Loading include/log/logd.h +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ extern "C" { int __android_log_bwrite(int32_t tag, const void *payload, size_t len); int __android_log_btwrite(int32_t tag, char type, const void *payload, size_t len); int __android_log_bswrite(int32_t tag, const char *payload); #ifdef __cplusplus } Loading liblog/logd_write.c +22 −0 Original line number Diff line number Diff line Loading @@ -473,3 +473,25 @@ int __android_log_btwrite(int32_t tag, char type, const void *payload, return write_to_log(LOG_ID_EVENTS, vec, 3); } /* * Like __android_log_bwrite, but used for writing strings to the * event log. */ int __android_log_bswrite(int32_t tag, const char *payload) { struct iovec vec[4]; char type = EVENT_TYPE_STRING; uint32_t len = strlen(payload); vec[0].iov_base = &tag; vec[0].iov_len = sizeof(tag); vec[1].iov_base = &type; vec[1].iov_len = sizeof(type); vec[2].iov_base = &len; vec[2].iov_len = sizeof(len); vec[3].iov_base = (void*)payload; vec[3].iov_len = len; return write_to_log(LOG_ID_EVENTS, vec, 4); } liblog/logd_write_kern.c +22 −0 Original line number Diff line number Diff line Loading @@ -317,3 +317,25 @@ int __android_log_btwrite(int32_t tag, char type, const void *payload, return write_to_log(LOG_ID_EVENTS, vec, 3); } /* * Like __android_log_bwrite, but used for writing strings to the * event log. */ int __android_log_bswrite(int32_t tag, const char *payload) { struct iovec vec[4]; char type = EVENT_TYPE_STRING; uint32_t len = strlen(payload); vec[0].iov_base = &tag; vec[0].iov_len = sizeof(tag); vec[1].iov_base = &type; vec[1].iov_len = sizeof(type); vec[2].iov_base = &len; vec[2].iov_len = sizeof(len); vec[3].iov_base = (void*)payload; vec[3].iov_len = len; return write_to_log(LOG_ID_EVENTS, vec, 4); } Loading
include/log/log.h +1 −1 Original line number Diff line number Diff line Loading @@ -491,7 +491,7 @@ typedef enum { #endif #ifndef LOG_EVENT_STRING #define LOG_EVENT_STRING(_tag, _value) \ ((void) 0) /* not implemented -- must combine len with string */ (void) __android_log_bswrite(_tag, _value); #endif /* TODO: something for LIST */ Loading
include/log/logd.h +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ extern "C" { int __android_log_bwrite(int32_t tag, const void *payload, size_t len); int __android_log_btwrite(int32_t tag, char type, const void *payload, size_t len); int __android_log_bswrite(int32_t tag, const char *payload); #ifdef __cplusplus } Loading
liblog/logd_write.c +22 −0 Original line number Diff line number Diff line Loading @@ -473,3 +473,25 @@ int __android_log_btwrite(int32_t tag, char type, const void *payload, return write_to_log(LOG_ID_EVENTS, vec, 3); } /* * Like __android_log_bwrite, but used for writing strings to the * event log. */ int __android_log_bswrite(int32_t tag, const char *payload) { struct iovec vec[4]; char type = EVENT_TYPE_STRING; uint32_t len = strlen(payload); vec[0].iov_base = &tag; vec[0].iov_len = sizeof(tag); vec[1].iov_base = &type; vec[1].iov_len = sizeof(type); vec[2].iov_base = &len; vec[2].iov_len = sizeof(len); vec[3].iov_base = (void*)payload; vec[3].iov_len = len; return write_to_log(LOG_ID_EVENTS, vec, 4); }
liblog/logd_write_kern.c +22 −0 Original line number Diff line number Diff line Loading @@ -317,3 +317,25 @@ int __android_log_btwrite(int32_t tag, char type, const void *payload, return write_to_log(LOG_ID_EVENTS, vec, 3); } /* * Like __android_log_bwrite, but used for writing strings to the * event log. */ int __android_log_bswrite(int32_t tag, const char *payload) { struct iovec vec[4]; char type = EVENT_TYPE_STRING; uint32_t len = strlen(payload); vec[0].iov_base = &tag; vec[0].iov_len = sizeof(tag); vec[1].iov_base = &type; vec[1].iov_len = sizeof(type); vec[2].iov_base = &len; vec[2].iov_len = sizeof(len); vec[3].iov_base = (void*)payload; vec[3].iov_len = len; return write_to_log(LOG_ID_EVENTS, vec, 4); }