From 8428cfe893c1f13eb22cd879669f12b65900738f Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Wed, 11 Jan 2006 12:17:30 -0800 Subject: [PATCH] kdump: add dmesg gdbmacro into document Add gdb macro which print the kernel ring buffer into kdump docs Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/kdump/gdbmacros.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Documentation/kdump') diff --git a/Documentation/kdump/gdbmacros.txt b/Documentation/kdump/gdbmacros.txt index bc1b9eb92ae..dcf5580380a 100644 --- a/Documentation/kdump/gdbmacros.txt +++ b/Documentation/kdump/gdbmacros.txt @@ -177,3 +177,25 @@ document trapinfo 'trapinfo ' 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 -- cgit v1.2.3-70-g09d2