[PATCH v3 5/7] log: add support -m for output of printk safe buffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Shogo Matsumoto <shogo.matsumoto@xxxxxxxxxxx>
---
 kernel.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/kernel.c b/kernel.c
index 993913c..f9e8763 100644
--- a/kernel.c
+++ b/kernel.c
@@ -11612,6 +11612,9 @@ __dump_printk_safe_seq_buf(char *buf_name, int msg_flags)
 				else
 					ilen = strlen(buf_name) + 3; // "[%s] "
 			}
+			if (msg_flags & SHOW_LOG_LEVEL)
+				ilen += 3; // "<%c>"
+
 			readmem(buffer_addr + per_cpu_offset, KVADDR,
 				buffer, buffer_size,
 				"printk_safe_seq_buf buffer", FAULT_ON_ERROR);
@@ -11632,6 +11635,14 @@ __dump_printk_safe_seq_buf(char *buf_name, int msg_flags)
 					else if (!(msg_flags & SHOW_LOG_TEXT))
 						fprintf(fp, "[%s] ", buf_name);
 
+					if ((msg_flags & SHOW_LOG_LEVEL) && (i < n)) {
+						switch (*p) {
+						case '0' ... '7':
+						case 'c':
+							fprintf(fp, "<%c>", *p);
+						}
+					}
+
 					continue;
 				} else {
 					if (sol)
-- 
2.29.2


--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux