summaryrefslogtreecommitdiff
path: root/Documentation/admin-guide/kdump
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2020-09-14 15:33:52 +0300
committerPetr Mladek <pmladek@suse.com>2020-09-15 16:52:49 +0300
commit10dcb06d40411a73e1ae111717e9a987bb760313 (patch)
tree21520d9beb051c2215ce29d03a30e180b6e78cd7 /Documentation/admin-guide/kdump
parentcc5c7041c6e1fe8c02fe9e16f28a5e52f7a6957c (diff)
downloadlinux-10dcb06d40411a73e1ae111717e9a987bb760313.tar.xz
printk: ringbuffer: change representation of states
Rather than deriving the state by evaluating bits within the flags area of the state variable, assign the states explicit values and set those values in the flags area. Introduce macros to make it simple to read and write state values for the state variable. Although the functionality is preserved, the binary representation for the states is changed. 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/20200914123354.832-5-john.ogness@linutronix.de
Diffstat (limited to 'Documentation/admin-guide/kdump')
-rw-r--r--Documentation/admin-guide/kdump/gdbmacros.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/Documentation/admin-guide/kdump/gdbmacros.txt b/Documentation/admin-guide/kdump/gdbmacros.txt
index 7adece30237e..8f533b751c46 100644
--- a/Documentation/admin-guide/kdump/gdbmacros.txt
+++ b/Documentation/admin-guide/kdump/gdbmacros.txt
@@ -295,9 +295,12 @@ document dump_record
end
define dmesg
- set var $desc_committed = 1UL << ((sizeof(long) * 8) - 1)
- set var $flags_mask = 3UL << ((sizeof(long) * 8) - 2)
- set var $id_mask = ~$flags_mask
+ # definitions from kernel/printk/printk_ringbuffer.h
+ set var $desc_committed = 1
+ set var $desc_sv_bits = sizeof(long) * 8
+ set var $desc_flags_shift = $desc_sv_bits - 2
+ set var $desc_flags_mask = 3 << $desc_flags_shift
+ set var $id_mask = ~$desc_flags_mask
set var $desc_count = 1U << prb->desc_ring.count_bits
set var $prev_flags = 0
@@ -309,7 +312,8 @@ define dmesg
set var $desc = &prb->desc_ring.descs[$id % $desc_count]
# skip non-committed record
- if (($desc->state_var.counter & $flags_mask) == $desc_committed)
+ set var $state = 3 & ($desc->state_var.counter >> $desc_flags_shift)
+ if ($state == $desc_committed)
dump_record $desc $prev_flags
set var $prev_flags = $desc->info.flags
end