Linus Torvalds writes: (Summary)
Dear god, that's nasty.
Dear god, that's nasty.
I agree that the vmcore info name probably needs to be retained, but maybe we could just do that with
maybe we could just do that with
#define VMCOREINFO_FIELD_AND_OFFSET(name, field, offset) \ vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", name, field, offset) vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", name, field, offset) and then do
and then do
#define VMCOREINFO_OFFSET(name, field) \
VMCOREINFO_FIELD_AND_OFFSET(#name, #field, \
(unsigned long)offsetof(struct name, offset))
(unsigned long)offsetof(struct name, offset))
and for that ts_nsec you can then do
and for that ts_nsec you can then do
Dear god, that's nasty.
I agree that the vmcore info name probably needs to be retained, but maybe we could just do that with
maybe we could just do that with
#define VMCOREINFO_FIELD_AND_OFFSET(name, field, offset) \ vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", name, field, offset) vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", name, field, offset) and then do
and then do
#define VMCOREINFO_OFFSET(name, field) \
VMCOREINFO_FIELD_AND_OFFSET(#name, #field, \
(unsigned long)offsetof(struct name, offset))
(unsigned long)offsetof(struct name, offset))
and for that ts_nsec you can then do
and for that ts_nsec you can then do
/* ts.mono used to be called "ts_nsec" */ VMCOREINFO_FIELD_AND_OFFSET("printk_log", "ts_nsec", (unsigned long)offsetof(struct printk_log, ts.mono)) or something.