SysRq debugger

From OpenVZ Linux Containers Wiki

Jump to: navigation, search

SysRq debugger can help you to obtain some information from oops-ed kernel. This feature is available since 026test017 kernel.

Contents

[edit] Features

SysRq debugger can do one of the following:

  1. Dump memory at specified address
  2. Write arbitrary value to memory at specified address
  3. Resolve symbol address by its name

[edit] How to use it

To enter debug mode press SysRq-g. After this the following commands will be available:

  1. SysRq-d - dump memory
  2. SysRq-w - write to memory
  3. SysRq-r - resolve symbol
  4. SysRq-x - go on dumping memory
    • ... from the latest address dumped with -d
    • ... from the address you wrote to with -w
    • ... from the begginning of the symbol resolved with -r
  5. SysRq-q - quit debugger

After entering -d, -w or -r state you must enter address to work with (and the value you want to write if you do). Simply do this by pressing according keys while holding Alt-StsRq.

If you need to enter the upper case letter or the underbar (_) while typing a symbol name then you need to press and release shift and then the letter or minus (-).

At the end press enter.

[edit] Working with proc

There is a /proc/sysrq-trigger entry which triggers sysrq events. You may write a string to it to trigger commands one by one. There is one note: the string must end with the \r character.

[edit] Examples

Here are some examples of how to use debugger

[edit] Dump memory

# echo -n -e 'gd0xc0000000\rq' > /proc/sysrq-trigger

will dump memory region of 512 bytes

# echo -n -e 'gxq' > /proc/sysrq-trigger

will dump the next 512 bytes of memory

[edit] Write to memory

# echo -n -e 'gw0xc0000000-0x12345678\rq' > /proc/sysrq-trigger

will write 0x12345678 at 0xc0000000

[edit] Resolve symbol

# echo -n -e 'grschedule\rq' > /proc/sysrq-trigger

will print you an address schedule() function starts from

# echo -n -e 'gxq' > /proc/sysrq-trigger

will dump first 512 bytes of it

Note -n and -e keys to echo command.

Personal tools
Namespaces
Variants
Actions
Navigation
Sites
Toolbox