[Devel] [PATCH RH9 1/2] printk: define struct member aliases for log_buf*

Alexander Mikhalitsyn alexander.mikhalitsyn at virtuozzo.com
Mon Oct 25 15:30:38 MSK 2021


This aliases is needed to make crash work properly
and allow it to extract dmesg ringbuffer data.

https://jira.sw.ru/browse/PSBM-135139

Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
---
 kernel/printk/printk.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index ff8a41260284..1f62085c1064 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -448,6 +448,13 @@ static void ____ ## name ## _definition(void)				\
 	     : : "g" (offsetof(typeof(inst), memb)));			\
 }									\
 extern typeof(inst.memb) name;
+/*
+ * See dump_log(int msg_flags) function.
+ *
+ * https://github.com/crash-utility/crash/blob/7.3.0/kernel.c#L5040
+ */
+DEFINE_STRUCT_MEMBER_ALIAS(log_buf, init_log_state, buf);
+DEFINE_STRUCT_MEMBER_ALIAS(log_buf_len, init_log_state, buf_len);
 DEFINE_STRUCT_MEMBER_ALIAS(clear_seq, init_log_state, clear_seq);
 DEFINE_STRUCT_MEMBER_ALIAS(prb, init_log_state, prb);
 #undef DEFINE_STRUCT_MEMBER_ALIAS
-- 
2.31.1



More information about the Devel mailing list