libc: libc_logging 64bit compile issue

- user space logger wire format for time

Change-Id: I4840653e3a6ae151a02584311d1227d2fe536d0f
This commit is contained in:
Mark Salyzyn 2014-03-05 13:44:00 -08:00
parent 48d145c1ce
commit 9fc76027f3

View File

@ -478,6 +478,11 @@ static int __libc_open_log_socket()
return log_fd;
}
struct log_time { // Wire format
uint32_t tv_sec;
uint32_t tv_nsec;
};
#endif
static int __libc_write_log(int priority, const char* tag, const char* msg) {
@ -493,8 +498,11 @@ static int __libc_write_log(int priority, const char* tag, const char* msg) {
char log_id = LOG_ID_MAIN;
vec[0].iov_base = &log_id;
vec[0].iov_len = sizeof(log_id);
timespec realtime_ts;
clock_gettime(CLOCK_REALTIME, &realtime_ts);
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
log_time realtime_ts;
realtime_ts.tv_sec = ts.tv_sec;
realtime_ts.tv_nsec = ts.tv_nsec;
vec[1].iov_base = &realtime_ts;
vec[1].iov_len = sizeof(realtime_ts);
@ -549,8 +557,11 @@ static int __libc_android_log_event(int32_t tag, char type, const void* payload,
char log_id = LOG_ID_EVENTS;
vec[0].iov_base = &log_id;
vec[0].iov_len = sizeof(log_id);
timespec realtime_ts;
clock_gettime(CLOCK_REALTIME, &realtime_ts);
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
log_time realtime_ts;
realtime_ts.tv_sec = ts.tv_sec;
realtime_ts.tv_nsec = ts.tv_nsec;
vec[1].iov_base = &realtime_ts;
vec[1].iov_len = sizeof(realtime_ts);