Re: [SPECIFICATION RFC] The firmware and bootloader log specification

From: Randy Dunlap
Date: Fri Nov 13 2020 - 22:19:14 EST


On 11/13/20 3:52 PM, Daniel Kiper wrote:
> Hey,
>
>
> Here is the description (pseudocode) of the structures which will be
> used to store the log data.
>
> Anyway, I am aware that this is not specification per se.


Yes, you have caveats here. I'm sure that you either already know
or would learn soon enough that struct struct bf_log has some
padding added to it (for alignment) unless it is packed.
Or you could rearrange the order of some of its fields
and save 8 bytes per struct on x86_64.


> struct bf_log
> {
> uint32_t version;
> char producer[64];
> uint64_t flags;
> uint64_t next_bf_log_addr;
> uint32_t next_msg_off;
> bf_log_msg msgs[];
> }
>
> struct bf_log_msg
> {
> uint32_t size;
> uint64_t ts_nsec;
> uint32_t level;
> uint32_t facility;
> uint32_t msg_off;
> char strings[];
> }


cheers.
--
~Randy