Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] sysrq: showBlockedTasks is sysrq-W

Change SysRq showBlockedTasks from sysrq-X to sysrq-W and show that in the
Help message.

It was previously done via X, but X is already used for Xmon on ppc & powerpc
platforms and this collision needs to be avoided.

All callers of register_sysrq_key() are now marked in the sysrq op/key table.
I didn't mark 'h' as Help because Help is just printed for any unknown key,
such as '?'.

Added some omitted sysrq key entries in the sysrq.txt file.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Randy Dunlap and committed by
Linus Torvalds
d346cce3 7d895244

+46 -40
+35 -31
Documentation/sysrq.txt
··· 1 1 Linux Magic System Request Key Hacks 2 - Documentation for sysrq.c version 1.15 3 - Last update: $Date: 2001/01/28 10:15:59 $ 2 + Documentation for sysrq.c 3 + Last update: 2007-JAN-06 4 4 5 5 * What is the magic SysRq key? 6 6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ··· 35 35 36 36 Note that the value of /proc/sys/kernel/sysrq influences only the invocation 37 37 via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always 38 - allowed. 38 + allowed (by a user with admin privileges). 39 39 40 40 * How do I use the magic SysRq key? 41 41 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ··· 58 58 On other - If you know of the key combos for other architectures, please 59 59 let me know so I can add them to this section. 60 60 61 - On all - write a character to /proc/sysrq-trigger. eg: 61 + On all - write a character to /proc/sysrq-trigger. e.g.: 62 62 63 63 echo t > /proc/sysrq-trigger 64 64 ··· 74 74 75 75 'c' - Will perform a kexec reboot in order to take a crashdump. 76 76 77 + 'd' - Shows all locks that are held. 78 + 77 79 'o' - Will shut your system off (if configured and supported). 78 80 79 81 's' - Will attempt to sync all mounted filesystems. ··· 89 87 90 88 'm' - Will dump current memory info to your console. 91 89 90 + 'n' - Used to make RT tasks nice-able 91 + 92 92 'v' - Dumps Voyager SMP processor info to your console. 93 + 94 + 'w' - Dumps tasks that are in uninterruptable (blocked) state. 95 + 96 + 'x' - Used by xmon interface on ppc/powerpc platforms. 93 97 94 98 '0'-'9' - Sets the console log level, controlling which kernel messages 95 99 will be printed to your console. ('0', for example would make 96 100 it so that only emergency messages like PANICs or OOPSes would 97 101 make it to your console.) 98 102 99 - 'f' - Will call oom_kill to kill a memory hog process 103 + 'f' - Will call oom_kill to kill a memory hog process. 100 104 101 105 'e' - Send a SIGTERM to all processes, except for init. 102 106 107 + 'g' - Used by kgdb on ppc platforms. 108 + 103 109 'i' - Send a SIGKILL to all processes, except for init. 104 110 105 - 'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system 106 - will be non-functional after this.) 107 - 108 - 'h' - Will display help ( actually any other key than those listed 111 + 'h' - Will display help (actually any other key than those listed 109 112 above will display help. but 'h' is easy to remember :-) 110 113 111 114 * Okay, so what can I use them for? 112 115 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 116 Well, un'R'aw is very handy when your X server or a svgalib program crashes. 114 117 115 - sa'K' (Secure Access Key) is useful when you want to be sure there are no 116 - trojan program is running at console and which could grab your password 117 - when you would try to login. It will kill all programs on given console 118 - and thus letting you make sure that the login prompt you see is actually 118 + sa'K' (Secure Access Key) is useful when you want to be sure there is no 119 + trojan program running at console which could grab your password 120 + when you would try to login. It will kill all programs on given console, 121 + thus letting you make sure that the login prompt you see is actually 119 122 the one from init, not some trojan program. 120 123 IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT 121 124 IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT 122 125 IMPORTANT: such. :IMPORTANT 123 - It seems other find it useful as (System Attention Key) which is 126 + It seems others find it useful as (System Attention Key) which is 124 127 useful when you want to exit a program that will not let you switch consoles. 125 128 (For example, X or a svgalib program.) 126 129 ··· 146 139 Again, the unmount (remount read-only) hasn't taken place until you see the 147 140 "OK" and "Done" message appear on the screen. 148 141 149 - The loglevel'0'-'9' is useful when your console is being flooded with 150 - kernel messages you do not want to see. Setting '0' will prevent all but 142 + The loglevels '0'-'9' are useful when your console is being flooded with 143 + kernel messages you do not want to see. Selecting '0' will prevent all but 151 144 the most urgent kernel messages from reaching your console. (They will 152 145 still be logged if syslogd/klogd are alive, though.) 153 146 ··· 159 152 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 160 153 That happens to me, also. I've found that tapping shift, alt, and control 161 154 on both sides of the keyboard, and hitting an invalid sysrq sequence again 162 - will fix the problem. (ie, something like alt-sysrq-z). Switching to another 155 + will fix the problem. (i.e., something like alt-sysrq-z). Switching to another 163 156 virtual console (ALT+Fn) and then back again should also help. 164 157 165 158 * I hit SysRq, but nothing seems to happen, what's wrong? ··· 181 174 prints help, and C) an action_msg string, that will print right before your 182 175 handler is called. Your handler must conform to the prototype in 'sysrq.h'. 183 176 184 - After the sysrq_key_op is created, you can call the macro 185 - register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in 186 - sysrq.h, this will register the operation pointed to by 'op_p' at table 187 - key 'key', if that slot in the table is blank. At module unload time, you must 188 - call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which 177 + After the sysrq_key_op is created, you can call the kernel function 178 + register_sysrq_key(int key, struct sysrq_key_op *op_p); this will 179 + register the operation pointed to by 'op_p' at table key 'key', 180 + if that slot in the table is blank. At module unload time, you must call 181 + the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which 189 182 will remove the key op pointed to by 'op_p' from the key 'key', if and only if 190 183 it is currently registered in that slot. This is in case the slot has been 191 184 overwritten since you registered it. ··· 193 186 The Magic SysRQ system works by registering key operations against a key op 194 187 lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has 195 188 a number of operations registered into it at compile time, but is mutable, 196 - and 4 functions are exported for interface to it: __sysrq_lock_table, 197 - __sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The 198 - functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined 199 - in the header itself, and the REGISTER and UNREGISTER macros are built from 200 - these. More complex (and dangerous!) manipulations of the table are possible 201 - using these functions, but you must be careful to always lock the table before 202 - you read or write from it, and to unlock it again when you are done. (And of 203 - course, to never ever leave an invalid pointer in the table). Null pointers in 204 - the table are always safe :) 189 + and 2 functions are exported for interface to it: 190 + register_sysrq_key and unregister_sysrq_key. 191 + Of course, never ever leave an invalid pointer in the table. I.e., when 192 + your module that called register_sysrq_key() exits, it must call 193 + unregister_sysrq_key() to clean up the sysrq key table entry that it used. 194 + Null pointers in the table are always safe. :) 205 195 206 196 If for some reason you feel the need to call the handle_sysrq function from 207 197 within a function called by handle_sysrq, you must be aware that you are in
+11 -9
drivers/char/sysrq.c
··· 215 215 } 216 216 static struct sysrq_key_op sysrq_showstate_blocked_op = { 217 217 .handler = sysrq_handle_showstate_blocked, 218 - .help_msg = "showBlockedTasks", 218 + .help_msg = "shoW-blocked-tasks", 219 219 .action_msg = "Show Blocked State", 220 220 .enable_mask = SYSRQ_ENABLE_DUMP, 221 221 }; ··· 315 315 &sysrq_loglevel_op, /* 9 */ 316 316 317 317 /* 318 - * Don't use for system provided sysrqs, it is handled specially on 319 - * sparc and will never arrive 318 + * a: Don't use for system provided sysrqs, it is handled specially on 319 + * sparc and will never arrive. 320 320 */ 321 321 NULL, /* a */ 322 322 &sysrq_reboot_op, /* b */ 323 - &sysrq_crashdump_op, /* c */ 323 + &sysrq_crashdump_op, /* c & ibm_emac driver debug */ 324 324 &sysrq_showlocks_op, /* d */ 325 325 &sysrq_term_op, /* e */ 326 326 &sysrq_moom_op, /* f */ 327 + /* g: May be registered by ppc for kgdb */ 327 328 NULL, /* g */ 328 329 NULL, /* h */ 329 330 &sysrq_kill_op, /* i */ ··· 333 332 NULL, /* l */ 334 333 &sysrq_showmem_op, /* m */ 335 334 &sysrq_unrt_op, /* n */ 336 - /* This will often be registered as 'Off' at init time */ 335 + /* o: This will often be registered as 'Off' at init time */ 337 336 NULL, /* o */ 338 337 &sysrq_showregs_op, /* p */ 339 338 NULL, /* q */ 340 - &sysrq_unraw_op, /* r */ 339 + &sysrq_unraw_op, /* r */ 341 340 &sysrq_sync_op, /* s */ 342 341 &sysrq_showstate_op, /* t */ 343 342 &sysrq_mountro_op, /* u */ 344 - /* May be assigned at init time by SMP VOYAGER */ 343 + /* v: May be registered at init time by SMP VOYAGER */ 345 344 NULL, /* v */ 346 - NULL, /* w */ 347 - &sysrq_showstate_blocked_op, /* x */ 345 + &sysrq_showstate_blocked_op, /* w */ 346 + /* x: May be registered on ppc/powerpc for xmon */ 347 + NULL, /* x */ 348 348 NULL, /* y */ 349 349 NULL /* z */ 350 350 };