0136123546.pdf by Unknown

0136123546.pdf by Unknown

Author:Unknown
Language: eng
Format: epub
Published: 2011-10-03T17:02:04.046908+00:00


Download at WoweBook.Com

SECTION #3

Kexec and Kdump

spin_lock(&mydrv_wq.lock); /* Usage before initialization! */

spin_lock_init(&mydrv_wq.lock);

/* ... */

}

The code is erroneously using a spinlock before initializing it. Effectively, the CPU spins forever trying to acquire the lock, and the kernel appears to hang. Let’s debug this problem using kdump.

In this case, there will be no auto-trigger because there is no panic, so force a crash dump by pressing the magic Sysrq key combination, Alt-Sysrq-c. You may need to enable Sysrq by writing a 1 to

/proc/sys/kernel/sysrq:

ptg5994185

bash> echo 1 > /proc/sys/kernel/sysrq

bash> insmod mydrv.ko

This induces the kernel to hang inside mydrv_init(). Press the Alt-Sysrq-c key combination to trigger a crash dump:

Alt-Sysrq-c

... → Messages announcing that a crash dump

has been triggered

Save the dump to disk after kexec boots the capture kernel, boot back to the original kernel, and run crash on the saved dump:

bash> crash vmlinux vmcore.dump

...

PANIC: “SysRq : Trigger a crashdump”

50

Debugging Linux Systems (Digital Shortcut)

© 2010 Pearson Education. All rights reserved.

by Sreekrishnan Venkateswaran

This publication is protected by copyright. Please see page 2 for more details.

From the Library of Ross Hagglund



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.