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
This commit is contained in:
Mark Salyzyn 2015-12-03 15:37:00 -08:00
parent 85abb0860e
commit 9b292f563e
1 changed files with 14 additions and 1 deletions

View File

@ -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;