logger.h: Add definition for logger_entry_v4
Extends logger_entry_v3 to add an uid field and moves some fields to
unsigned (easier to have zero'd bit-field for future adjustments).
Still no version field, not crossing that bridge, historical reasons.
Bug: 25996918
Change-Id: I18b7291666c3a5b170d6771a012363a41f2c5847
diff --git a/include/log/logger.h b/include/log/logger.h
index b3928a7..58e6705 100644
--- a/include/log/logger.h
+++ b/include/log/logger.h
@@ -64,6 +64,18 @@
char msg[0]; /* the entry's payload */
} __attribute__((__packed__));
+struct logger_entry_v4 {
+ uint16_t len; /* length of the payload */
+ uint16_t hdr_size; /* sizeof(struct logger_entry_v4) */
+ int32_t pid; /* generating process's pid */
+ uint32_t tid; /* generating process's tid */
+ uint32_t sec; /* seconds since Epoch */
+ uint32_t nsec; /* nanoseconds */
+ uint32_t lid; /* log id of the payload, bottom 4 bits currently */
+ uint32_t uid; /* generating process's uid */
+ char msg[0]; /* the entry's payload */
+} __attribute__((__packed__));
+
/*
* The maximum size of the log entry payload that can be
* written to the logger. An attempt to write more than
@@ -83,7 +95,8 @@
struct log_msg {
union {
unsigned char buf[LOGGER_ENTRY_MAX_LEN + 1];
- struct logger_entry_v3 entry;
+ struct logger_entry_v4 entry;
+ struct logger_entry_v4 entry_v4;
struct logger_entry_v3 entry_v3;
struct logger_entry_v2 entry_v2;
struct logger_entry entry_v1;