[lkml]   [2017]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC patch 5/7] crash: Add VMCOREINFO_FIELD_AND_OFFSET()
On Wed 2017-11-15 19:15:36, Thomas Gleixner wrote:
> Changing the time stamp storage in the printk ringbuffer entries would
> break existing tools which rely on the availability of the 'ts_nsec' field
> in vmcore info.
> Provide a new macro which allows to store the offset of a member of struct
> printk_log with a different name. This allows to change the underlying
> storage and without breaking tools.

It seems that this cheating is not enough. I tried to use it in printk
(6th patch in this patch set) and the "crash" tool complained:

===== cut =====
WARNING: log buf data structure(s) have changed

log: invalid structure member offset: log_ts_nsec
FILE: kernel.c LINE: 5055 FUNCTION: dump_log_entry()
===== cut =====

The crash tool get this value using the following code:

MEMBER_OFFSET_INIT(log_ts_nsec, "printk_log", "ts_nsec");
+ datatype_info((X), (Y), NULL)

, where the last function does something like:

datatype_info(char *name, char *member, struct datatype_member *dm)
struct gnu_request *req;

req->command = GNU_GET_DATATYPE;
req->name = name;
req->member = member;


I am not completely sure what it does. I guess that gdb
is able to get information about the real types either
from vmlinux binary or vmcore. It is not able to
find "ts_nsec" in the struct "printk_log" and fails.

I am afraid that we would need to fix crash for
the modified struct printk_log. Then this hack
will not be needed.

Best Regards,

 \ /
  Last update: 2017-11-23 13:47    [W:0.110 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site