docs: gdbmacros: print newest record
authorJohn Ogness <john.ogness@linutronix.de>
Thu, 29 Dec 2022 13:43:39 +0000 (14:49 +0106)
committerPetr Mladek <pmladek@suse.com>
Tue, 3 Jan 2023 09:44:14 +0000 (10:44 +0100)
@head_id points to the newest record, but the printing loop
exits when it increments to this value (before printing).

Exit the printing loop after the newest record has been printed.

The python-based function in scripts/gdb/linux/dmesg.py already
does this correctly.

Fixes: e60768311af8 ("scripts/gdb: update for lockless printk ringbuffer")
Cc: stable@vger.kernel.org
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20221229134339.197627-1-john.ogness@linutronix.de
Documentation/admin-guide/kdump/gdbmacros.txt

index 82aecdcae8a6c182d0bebea90492b79a199510a8..030de95e3e6b2464f130ecd2f2e93f8ce804d151 100644 (file)
@@ -312,10 +312,10 @@ define dmesg
                        set var $prev_flags = $info->flags
                end
 
-               set var $id = ($id + 1) & $id_mask
                if ($id == $end_id)
                        loop_break
                end
+               set var $id = ($id + 1) & $id_mask
        end
 end
 document dmesg