lkml.org 
[lkml]   [2017]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC patch 5/7] crash: Add VMCOREINFO_FIELD_AND_OFFSET()
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.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/crash_core.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--- a/include/linux/crash_core.h
+++ b/include/linux/crash_core.h
@@ -48,9 +48,11 @@ phys_addr_t paddr_vmcoreinfo_note(void);
#define VMCOREINFO_STRUCT_SIZE(name) \
vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
(unsigned long)sizeof(struct name))
-#define VMCOREINFO_OFFSET(name, field) \
- vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
+#define VMCOREINFO_FIELD_AND_OFFSET(name, fieldname, field) \
+ vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #fieldname, \
(unsigned long)offsetof(struct name, field))
+#define VMCOREINFO_OFFSET(name, field) \
+ VMCOREINFO_FIELD_AND_OFFSET(name, field, field)
#define VMCOREINFO_LENGTH(name, value) \
vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value)
#define VMCOREINFO_NUMBER(name) \

\
 
 \ /
  Last update: 2017-11-15 19:30    [W:0.144 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site