diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-03-05 07:41:49 -0800 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2014-03-05 16:12:28 -0800 |
commit | 7e2f83c0bcc3ad8a2840a48be14d302ed79d671c (patch) | |
tree | e2d2ed4a9a9e218e046cb0796607cca8fc5ed97f /logd | |
parent | 51ebffd8a5536af09b60950bf7cf6f020c962f8a (diff) | |
download | core-7e2f83c0bcc3ad8a2840a48be14d302ed79d671c.tar.gz core-7e2f83c0bcc3ad8a2840a48be14d302ed79d671c.tar.bz2 core-7e2f83c0bcc3ad8a2840a48be14d302ed79d671c.zip |
logd: liblog: 64-bit issues
- structure packing
- move towards log_time from struct timespec
- extend log_time to cover differences between
log_time and struct timespec
Change-Id: I106ed0b609917306d170044054b5b32645f2a295
Diffstat (limited to 'logd')
-rw-r--r-- | logd/LogBuffer.cpp | 6 | ||||
-rw-r--r-- | logd/LogBuffer.h | 10 | ||||
-rw-r--r-- | logd/LogBufferElement.cpp | 8 | ||||
-rw-r--r-- | logd/LogBufferElement.h | 6 |
4 files changed, 16 insertions, 14 deletions
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index 7340a36d8..c5760f7c1 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -36,7 +36,7 @@ LogBuffer::LogBuffer(LastLogTimes *times) pthread_mutex_init(&mLogElementsLock, NULL); } -void LogBuffer::log(log_id_t log_id, struct timespec realtime, +void LogBuffer::log(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, const char *msg, unsigned short len) { if ((log_id >= LOG_ID_MAX) || (log_id < 0)) { @@ -182,8 +182,8 @@ unsigned long LogBuffer::getSize(log_id_t /*id*/) { return LOG_BUFFER_SIZE; } -struct timespec LogBuffer::flushTo( - SocketClient *reader, const struct timespec start, bool privileged, +log_time LogBuffer::flushTo( + SocketClient *reader, const log_time start, bool privileged, bool (*filter)(const LogBufferElement *element, void *arg), void *arg) { LogBufferElementCollection::iterator it; log_time max = start; diff --git a/logd/LogBuffer.h b/logd/LogBuffer.h index 7c69f1bdc..1b50a8f85 100644 --- a/logd/LogBuffer.h +++ b/logd/LogBuffer.h @@ -40,12 +40,12 @@ public: LogBuffer(LastLogTimes *times); - void log(log_id_t log_id, struct timespec realtime, + void log(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, const char *msg, unsigned short len); - struct timespec flushTo(SocketClient *writer, const struct timespec start, - bool privileged, - bool (*filter)(const LogBufferElement *element, void *arg) = NULL, - void *arg = NULL); + log_time flushTo(SocketClient *writer, const log_time start, + bool privileged, + bool (*filter)(const LogBufferElement *element, void *arg) = NULL, + void *arg = NULL); void clear(log_id_t id); unsigned long getSize(log_id_t id); diff --git a/logd/LogBufferElement.cpp b/logd/LogBufferElement.cpp index 1c55623c3..01cc9de38 100644 --- a/logd/LogBufferElement.cpp +++ b/logd/LogBufferElement.cpp @@ -24,9 +24,11 @@ #include "LogBufferElement.h" #include "LogReader.h" -const struct timespec LogBufferElement::FLUSH_ERROR = { 0, 0 }; +const log_time LogBufferElement::FLUSH_ERROR(0, 0); -LogBufferElement::LogBufferElement(log_id_t log_id, struct timespec realtime, uid_t uid, pid_t pid, const char *msg, unsigned short len) +LogBufferElement::LogBufferElement(log_id_t log_id, log_time realtime, + uid_t uid, pid_t pid, const char *msg, + unsigned short len) : mLogId(log_id) , mUid(uid) , mPid(pid) @@ -41,7 +43,7 @@ LogBufferElement::~LogBufferElement() { delete [] mMsg; } -struct timespec LogBufferElement::flushTo(SocketClient *reader) { +log_time LogBufferElement::flushTo(SocketClient *reader) { struct logger_entry_v3 entry; memset(&entry, 0, sizeof(struct logger_entry_v3)); entry.hdr_size = sizeof(struct logger_entry_v3); diff --git a/logd/LogBufferElement.h b/logd/LogBufferElement.h index 390c97c23..1da09aea6 100644 --- a/logd/LogBufferElement.h +++ b/logd/LogBufferElement.h @@ -32,7 +32,7 @@ class LogBufferElement { const log_time mRealTime; public: - LogBufferElement(log_id_t log_id, struct timespec realtime, + LogBufferElement(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, const char *msg, unsigned short len); virtual ~LogBufferElement(); @@ -43,8 +43,8 @@ public: log_time getMonotonicTime(void) const { return mMonotonicTime; } log_time getRealTime(void) const { return mRealTime; } - static const struct timespec FLUSH_ERROR; - struct timespec flushTo(SocketClient *writer); + static const log_time FLUSH_ERROR; + log_time flushTo(SocketClient *writer); }; #endif |