From 52972364dc53439c8509e50ae7ff05645b3f5325 Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Fri, 14 Jun 2013 10:56:40 -0400 Subject: [PATCH] kexec-kdump-howto: Add a section for debugging tips Add a section for debugging tips. I had to spend some time to figure out how to drop into a shell from kdump_pre/kdump_post scripts. So thought of documenting that so that somebdoy else can save time. Also add a method to log serial consoles for virtual machines. I was loosing some of the messages over reboot. Logging to file is fine. This can be helful in debugging. v2: Add method to log serial console for virtual machines v3: Fix serial console logging instructions. Signed-off-by: Vivek Goyal Acked-by: Baoquan He --- kexec-kdump-howto.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt index 43c6bcb..d70781b 100644 --- a/kexec-kdump-howto.txt +++ b/kexec-kdump-howto.txt @@ -577,3 +577,32 @@ initramfs for the time being. If you need modify "KDUMP_COMMANDLINE=" in options are copied from /proc/cmdline. In general it is best to append command line options using "KDUMP_COMMANDLINE_APPEND=" instead of replacing the original command line completely. + +Debugging Tips +-------------- +- One can drop into a shell before/after saving vmcore with the help of + using kdump_pre/kdump_post hooks. Use following in one of the pre/post + scripts to drop into a shell. + + #!/bin/bash + _ctty=/dev/ttyS0 + setsid /bin/sh -i -l 0<>$_ctty 1<>$_ctty 2<>$_ctty + + One might have to change the terminal depending on what they are using. + +- Serial console logging for virtual machines + + I generally use "virsh console " to get to serial console. + I noticed after dump saving system reboots and when grub menu shows up + some of the previously logged messages are no more there. That means + any important debugging info at the end will be lost. + + One can log serial console as follows to make sure messages are not lost. + + virsh ttyconsole + ln -s /dev/modem + minicom -C /tmp/console-logs + + Now minicom should be logging serial console in file console-logs. + +