Skip to content

Commit

Permalink
[PATCH] kdump: add dmesg gdbmacro into document
Browse files Browse the repository at this point in the history
Add gdb macro which print the kernel ring buffer into kdump docs

Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Jan 12, 2006
1 parent beb25c6 commit 8428cfe
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Documentation/kdump/gdbmacros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8428cfe

Please sign in to comment.