[PATCH] printk: Export struct log size and member offsets through vmcoreinfo
Kay Sievers
kay at vrfy.org
Wed Jul 18 13:27:08 EDT 2012
On Wed, Jul 18, 2012 at 7:18 PM, Vivek Goyal <vgoyal at redhat.com> wrote:
> Currently I am not exporting log "level" info as that is a bitfield and
> offsetof() bitfields can't be calculated.
We could make the level the lower 3 bits of the byte, export the byte,
and define that only 3 bits of the byte are valid? Would that help?
> kernel/printk.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
> + /*
> + * Export struct log size and field offsets. User space tools can
> + * parse it and detect any changes to structure down the line.
> + */
> + VMCOREINFO_STRUCT_SIZE(log);
> + VMCOREINFO_OFFSET(log, ts_nsec);
> + VMCOREINFO_OFFSET(log, len);
> + VMCOREINFO_OFFSET(log, text_len);
> + VMCOREINFO_OFFSET(log, dict_len);
Ah, nice, that's how you handle exporting structures, it was still on
my list, to find out how all that should look like.
Cc:ing Greg, to pick it up.
Thanks a lot for taking care of it,
Kay
More information about the kexec
mailing list