Suppress the output of safe buffer name if -t is specified to 'log'.

Signed-off-by: Shogo Matsumoto <[email protected]>
---
 kernel.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel.c b/kernel.c
index 138ac3c..993913c 100644
--- a/kernel.c
+++ b/kernel.c
@@ -11607,7 +11607,10 @@ __dump_printk_safe_seq_buf(char *buf_name, int 
msg_flags)
                        if (show_header) {
                                ilen = PRINTK_SAFE_SEQ_BUF_INDENT;
                        } else {
-                               ilen = strlen(buf_name) + 3; // "[%s] "
+                               if (msg_flags & SHOW_LOG_TEXT)
+                                       ilen = 0;
+                               else
+                                       ilen = strlen(buf_name) + 3; // "[%s] "
                        }
                        readmem(buffer_addr + per_cpu_offset, KVADDR,
                                buffer, buffer_size,
@@ -11626,7 +11629,7 @@ __dump_printk_safe_seq_buf(char *buf_name, int 
msg_flags)
 
                                        if (show_header)
                                                fprintf(fp, 
space(PRINTK_SAFE_SEQ_BUF_INDENT));
-                                       else
+                                       else if (!(msg_flags & SHOW_LOG_TEXT))
                                                fprintf(fp, "[%s] ", buf_name);
 
                                        continue;
-- 
2.29.2


--
Crash-utility mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/crash-utility

Reply via email to