From 9b292f563ea483563878fc29e75de63cb790fc49 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Thu, 3 Dec 2015 15:37:00 -0800 Subject: [PATCH] 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 --- include/log/logger.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/log/logger.h b/include/log/logger.h index b3928a713..58e670535 100644 --- a/include/log/logger.h +++ b/include/log/logger.h @@ -64,6 +64,18 @@ struct logger_entry_v3 { 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 logger_entry_v3 { 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;