[PATCH] kdump: add dmesg gdbmacro into document
authorAkinobu Mita <mita@miraclelinux.com>
Wed, 11 Jan 2006 20:17:30 +0000 (12:17 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 02:42:10 +0000 (18:42 -0800)
Add gdb macro which print the kernel ring buffer into kdump docs

Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Documentation/kdump/gdbmacros.txt

index bc1b9eb92ae129982ad34d6dbac4c61dbd58861b..dcf5580380ab3c848f185ed15df95b25b24b2037 100644 (file)
@@ -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