printk: Export struct log size and member offsets through vmcoreinfo
authorVivek Goyal <vgoyal@redhat.com>
Wed, 18 Jul 2012 17:18:12 +0000 (13:18 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jul 2012 00:14:18 +0000 (17:14 -0700)
commit6791457a090d9a234a40b501c2536f0aefaeae4b
tree39ba0f7e11dca9a88a38f85ca94b26f46f76365e
parentbd8a4f06d0310326f89fd58fed74f2db8e345056
printk: Export struct log size and member offsets through vmcoreinfo

There are tools like makedumpfile and vmcore-dmesg which can extract
kernel log buffer from vmcore. Since we introduced structured logging,
that functionality is broken. Now user space tools need to know about
"struct log" and offsets of various fields to be able to parse struct
log data and extract text message or dictonary.

This patch exports some of the fields.

Currently I am not exporting log "level" info as that is a bitfield and
offsetof() bitfields can't be calculated. But if people start asking for
log level info in the output then we probably either need to seprate
out "level" or use bit shift operations for flags and level.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/printk.c