Skip to contentSkip to conversation

kdump: add dmesg gdbmacro into document

PATCH New Akinobu Mita 1 participant 2 messages Jan 6, 2006 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 kdump: add dmesg gdbmacro into document

Add gdb macro which print the kernel ring buffer into kdump docs

Documentation/kdump/gdbmacros.txt renamed from Documentation/kdump/gdbmacros.txt.orig +22 -0
@@ -177,3 +177,25 @@ document trapinfo
 	'trapinfo <pid>' will tell you by which trap & possibly
 	addresthe kernel paniced.
 end
+
+
+define dmesg
+	set $i = 0
+	set $end_idx = (log_end - 1) & (log_buf_len - 1)
+
+	while ($i < logged_chars)
+		set $idx = (log_end - 1 - logged_chars + $i) & (log_buf_len - 1)
+
+		if ($idx + 100 <= $end_idx) || \
+		   ($end_idx <= $idx && $idx + 100 < log_buf_len)
+			printf "%.100s", &log_buf[$idx]
+			set $i = $i + 100
+		else
+			printf "%c", log_buf[$idx]
+			set $i = $i + 1
+		end
+	end
+end
+document dmesg
+	print the kernel ring buffer
+end
#1 lore raw

PATCH 2/2 doc: refer to kdump in oops-tracing.txt

Kdump has been merged and supported on several architectures. It is better to encourage to use kdump rather than non standard kernel crash dump patches.

Documentation/oops-tracing.txt renamed from Documentation/oops-tracing.txt.orig +3 -5
@@ -41,11 +41,9 @@ the disk is not available then you have 
     run a null modem to a second machine and capture the output there
     using your favourite communication program.  Minicom works well.
 
-(3) Patch the kernel with one of the crash dump patches.  These save
-    data to a floppy disk or video rom or a swap partition.  None of
-    these are standard kernel patches so you have to find and apply
-    them yourself.  Search kernel archives for kmsgdump, lkcd and
-    oops+smram.
+(3) Use Kdump (see Documentation/kdump/kdump.txt),
+    extract the kernel ring buffer from old memory with using dmesg
+    gdbmacro in Documentation/kdump/gdbmacros.txt.
 
 
 Full Information