Skip to contentSkip to conversation

dmesg macro in Documentation/kdump/gdbmacros.txt outdated

DISCUSSION Andreas Fenkart 3 participants 3 messages Mar 1, 2013

lore
Share & tools
lore
#0 lore raw

Is there an updated version matching the changed printk structure?

thanks,

#1 lore raw
Quoted 2 lines · Andreas Fenkart

Is there an updated version matching the changed printk structure?

Not that I know of, but you might want to ask the author of that file to update it if possible.

greg k-h

#2 lore raw
In reply to Andreas Fenkart
Quoted 1 line · Andreas Fenkart

Is there an updated version matching the changed printk structure?

I hacked something up a while ago, but it's not perfect. The code below stops dumping too early IIRC, but I never got around to fix that. Maybe someone wants to look at it and help debug, so we can put it into gdbmacros.txt ...

Thanks,
Daniel

define dmesg
set $idx = 0
set $seq = 0

while ($seq++ < log_next_seq)
set $buf = log_buf + $idx
set $log = (struct log *) $buf

if ($log->len == 0)
loop_break
end

printf "%s\n", (char *) ($buf + sizeof(struct log)) set $idx += $log->len
end
end

document dmesg
dmesg
Print the content of the kernel message buffer
end