[kexec-tools] kexec-kdump-howto: Add a section for debugging tips

Baoquan He baoquan at fedoraproject.org
Tue Jun 25 08:53:08 UTC 2013


commit 52972364dc53439c8509e50ae7ff05645b3f5325
Author: Vivek Goyal <vgoyal at redhat.com>
Date:   Fri Jun 14 10:56:40 2013 -0400

    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 <vgoyal at redhat.com>
    Acked-by: Baoquan He <bhe at redhat.com>

 kexec-kdump-howto.txt |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
---
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 <domain-name>" 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 <domain-name>
+  ln -s <name-of-tty> /dev/modem
+  minicom -C /tmp/console-logs
+
+  Now minicom should be logging serial console in file console-logs.
+
+


More information about the scm-commits mailing list