[Devel] [PATCH RHEL9 COMMIT] printk: define struct member aliases for log_buf*

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 25 15:55:22 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.10.16
------>
commit a923d524b365ba6c2efe089071db2acc583a00b6
Author: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
Date:   Mon Oct 25 15:55:22 2021 +0300

    printk: define struct member aliases for log_buf*
    
    These aliases are needed to make crash work properly
    and allow it to extract dmesg ringbuffer data.
    
    Fixes: 40428a8d4e0b ("ve/printk: Introduce struct "log_state" and virtualize
    log_buf/log_buf_len")
    
    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


More information about the Devel mailing list