Reputation: 28252
I am writing an assignment (so I'm under lots of pressure, hehe) and I have a particular place where my project is dereferencing NULL.
The details are this: it's a system call that walks the page table entries of this process and reports which were accessed since the call last happened. Please do no give suggestions about the problem itself, as I don't want to violate any academic honesty rules.
It seems to be the case, however, that the execution of the system call is preempted, and something goes in and screws with the structures I'm using. The infuriating thing is that I can't figure out what.
Therefore, I want the panic to tell me what spinlocks/semaphores, etc. are being held at the time of the panic. This would give me a hint as to what the hell is going on.
Upvotes: 2
Views: 1141
Reputation: 361
panic_print=0x08
echo 8 > /proc/sys/kernel/panic_print
Documentation for /proc/sys/kernel
panic_print
Bitmask for printing system info when panic happens.
User can chose combination of the following bits:
===== ============================================
bit 0 print all tasks info
bit 1 print system memory info
bit 2 print timer info
bit 3 print locks info if CONFIG_LOCKDEP
is on
bit 4 print ftrace buffer
bit 5 print all printk messages in buffer
bit 6 print all CPUs backtrace (if available in the arch)
===== ============================================
So for example to print tasks and memory info on panic, user can::
echo 3 > /proc/sys/kernel/panic_print
Upvotes: 0
Reputation: 2730
If you build your kernel with CONFIG_LOCKDEP
enabled you should be able to dump all locks with alt-sysrq-D
. See drivers/tty/sysrq.c
.
Upvotes: 3