X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Documentation%2Fkdump%2Fgdbmacros.txt;h=9b9b454b048ad78e9745a3d12971aa0cff665fc5;hb=0d8e573c30a317f1b37808fce4f8c7b3f801674f;hp=bc1b9eb92ae129982ad34d6dbac4c61dbd58861b;hpb=ab997aaeb9cf7a0da1cecc46c5bb6c7262416917;p=firefly-linux-kernel-4.4.55.git diff --git a/Documentation/kdump/gdbmacros.txt b/Documentation/kdump/gdbmacros.txt index bc1b9eb92ae1..9b9b454b048a 100644 --- a/Documentation/kdump/gdbmacros.txt +++ b/Documentation/kdump/gdbmacros.txt @@ -175,5 +175,27 @@ end document trapinfo Run info threads and lookup pid of thread #1 'trapinfo ' will tell you by which trap & possibly - addresthe kernel paniced. + address the kernel panicked. +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