It is a 'magical' key combo you can hit which the kernel will respond to regardless of whatever else it is doing, unless it is completely locked up.
You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when configuring the kernel. When running a kernel with SysRq compiled in, /proc/sys/kernel/sysrq controls the functions allowed to be invoked via the SysRq key. By default the file contains 1 which means that every possible SysRq request is allowed (in older versions SysRq was disabled by default, and you were required to specifically enable it at run-time but this is not the case any more).
Here is the list of possible values in /proc/sys/kernel/sysrq:
0 - disable sysrq completely
1 - enable all functions of sysrq
You can set the value in the file by the following command: echo "number" >/proc/sys/kernel/sysrqNote that the value of /proc/sys/kernel/sysrq influences only the invocation via a keyboar/proc/sysrq-trigger.d.
* What are the 'command' keys?
'b' - Will immediately reboot the system without syncing or unmounting your disks.
'c' - Will perform a system crash by a NULL pointer dereference. A crashdump will be taken if configured.There are some keyboards that produce a different keycode for SysRq than the pre-defined value of 99 (see KEY_SYSRQ in include/linux/input.h), or which don't have a SysRq key at all. In these cases, run 'showkey -s' to find an appropriate scancode sequence, and use 'setkeycodes <sequence> 99' to map this sequence to the usual SysRq code (e.g., 'setkeycodes e05b 99'). It's probably best to put this command in a boot script. Oh, and by the way, you exit 'showkey' by not typing anything for ten seconds.
我们可以不用记住那些讨厌的组合键,而使用sysrq-trigger的方法:通过help命令得到支持的command,再选择使用
SysRq : HELP :
loglevel(0-9)
reBoot
Crash
terminate-all-tasks(E)
memory-full-oom-kill(F)
kill-all-tasks(I)
thaw-filesystems(J)
saK show-backtrace-all-active-cpus(L)
show-memory-usage(M)
nice-all-RT-tasks(N)
powerOff
show-registers(P)
show-all-timers(Q)
unRaw
Sync
show-task-states(T)
Unmount
show-blocked-tasks(W)
虽然,我们可以从crash dump中得到许多信息,但这需要dump 文件,当然可以手动dump.
最后是在系统运行的时候得到更多信息:
1.串口信息;
2.sysrq;
3.ftrace.
4.?