lkml.org 
[lkml]   [2012]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] printk: Export struct log size and member offsets through vmcoreinfo
On Wed, Jul 18, 2012 at 7:18 PM, Vivek Goyal <vgoyal@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


\
 
 \ /
  Last update: 2012-07-18 20:02    [W:0.055 / U:0.652 seconds]
©2003-2014 Jasper Spaans. Advertise on this site