Editing SysRq debugger
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | |||
− | |||
''SysRq debugger'' can help you to obtain some information from oops-ed kernel. This feature is available since 026test017 kernel. | ''SysRq debugger'' can help you to obtain some information from oops-ed kernel. This feature is available since 026test017 kernel. | ||
− | == Features == | + | == Features == |
''SysRq debugger'' can do one of the following: | ''SysRq debugger'' can do one of the following: | ||
# Dump memory at specified address | # Dump memory at specified address | ||
Line 9: | Line 7: | ||
# Resolve symbol address by its name | # Resolve symbol address by its name | ||
− | == How to use it == | + | == How to use it == |
To enter debug mode press ''SysRq-g''. | To enter debug mode press ''SysRq-g''. | ||
After this the following commands will be available: | After this the following commands will be available: | ||
Line 21: | Line 19: | ||
# ''SysRq-q'' - quit debugger | # ''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''. | 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 (<code>_</code>) while typing a symbol name then you need to press and release ''shift'' and then the letter or minus (<code>-</code>). | If you need to enter the upper case letter or the underbar (<code>_</code>) while typing a symbol name then you need to press and release ''shift'' and then the letter or minus (<code>-</code>). | ||
− | |||
At the end press ''enter''. | At the end press ''enter''. | ||
− | == Working with proc == | + | == Working with proc == |
There is a <code>/proc/sysrq-trigger</code> entry which triggers sysrq events. | There is a <code>/proc/sysrq-trigger</code> entry which triggers sysrq events. | ||
You may write a string to it to trigger commands one by one. | You may write a string to it to trigger commands one by one. | ||
There is one note: the string must end with the <code>\r</code> character. | There is one note: the string must end with the <code>\r</code> character. | ||
− | == Examples == | + | == Examples == |
Here are some examples of how to use debugger | Here are some examples of how to use debugger | ||
− | === Dump memory === | + | === Dump memory === |
<pre> | <pre> | ||
# echo -n -e 'gd0xc0000000\rq' > /proc/sysrq-trigger | # echo -n -e 'gd0xc0000000\rq' > /proc/sysrq-trigger | ||
Line 44: | Line 39: | ||
will dump memory region of 512 bytes | will dump memory region of 512 bytes | ||
− | |||
<pre> | <pre> | ||
# echo -n -e 'gxq' > /proc/sysrq-trigger | # echo -n -e 'gxq' > /proc/sysrq-trigger | ||
Line 50: | Line 44: | ||
will dump the next 512 bytes of memory | will dump the next 512 bytes of memory | ||
− | === Write to memory === | + | === Write to memory === |
<pre> | <pre> | ||
# echo -n -e 'gw0xc0000000-0x12345678\rq' > /proc/sysrq-trigger | # echo -n -e 'gw0xc0000000-0x12345678\rq' > /proc/sysrq-trigger | ||
Line 56: | Line 50: | ||
will write ''0x12345678'' at ''0xc0000000'' | will write ''0x12345678'' at ''0xc0000000'' | ||
− | === Resolve symbol === | + | === Resolve symbol === |
<pre> | <pre> | ||
# echo -n -e 'grschedule\rq' > /proc/sysrq-trigger | # echo -n -e 'grschedule\rq' > /proc/sysrq-trigger | ||
Line 62: | Line 56: | ||
will print you an address ''schedule()'' function starts from | will print you an address ''schedule()'' function starts from | ||
− | |||
<pre> | <pre> | ||
# echo -n -e 'gxq' > /proc/sysrq-trigger | # echo -n -e 'gxq' > /proc/sysrq-trigger | ||
Line 68: | Line 61: | ||
will dump first 512 bytes of it | will dump first 512 bytes of it | ||
− | |||
Note <i>''-n''</i> and <i>''-e''</i> keys to ''echo'' command. | Note <i>''-n''</i> and <i>''-e''</i> keys to ''echo'' command. | ||
− | |||
[[Category:HOWTO]] | [[Category:HOWTO]] | ||
[[Category:Kernel]] | [[Category:Kernel]] |