linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sysrq: showBlockedTasks is sysrq-X
@ 2007-01-05 19:06 Randy Dunlap
  2007-01-05 19:36 ` Olaf Hering
  0 siblings, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2007-01-05 19:06 UTC (permalink / raw)
  To: lkml; +Cc: akpm, kernel

From: Randy Dunlap <randy.dunlap@oracle.com>

SysRq showBlockedTasks is not done via B or T, it's done via X,
so put that in the Help message.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/char/sysrq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2620-rc3g4.orig/drivers/char/sysrq.c
+++ linux-2620-rc3g4/drivers/char/sysrq.c
@@ -215,7 +215,7 @@ static void sysrq_handle_showstate_block
 }
 static struct sysrq_key_op sysrq_showstate_blocked_op = {
 	.handler	= sysrq_handle_showstate_blocked,
-	.help_msg	= "showBlockedTasks",
+	.help_msg	= "showBlockedTasks(X)",
 	.action_msg	= "Show Blocked State",
 	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };


---
~Randy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sysrq: showBlockedTasks is sysrq-X
  2007-01-05 19:06 [PATCH] sysrq: showBlockedTasks is sysrq-X Randy Dunlap
@ 2007-01-05 19:36 ` Olaf Hering
  2007-01-05 19:41   ` Randy Dunlap
  2007-01-06 18:25   ` [PATCH] sysrq: showBlockedTasks is sysrq-W Randy Dunlap
  0 siblings, 2 replies; 12+ messages in thread
From: Olaf Hering @ 2007-01-05 19:36 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, akpm, kernel

On Fri, Jan 05, Randy Dunlap wrote:

> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> SysRq showBlockedTasks is not done via B or T, it's done via X,
> so put that in the Help message.

Weird, who failed to run this command before adding new stuff?!
find * -type f -print0 | xargs -0 env -i grep -nw register_sysrq_key

sysrq x is for xmon, see arch/powerpc/xmon/xmon.c
Better switch the new stuff to 'z' or 'w'

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sysrq: showBlockedTasks is sysrq-X
  2007-01-05 19:36 ` Olaf Hering
@ 2007-01-05 19:41   ` Randy Dunlap
  2007-01-05 19:51     ` Olaf Hering
  2007-01-06 18:25   ` [PATCH] sysrq: showBlockedTasks is sysrq-W Randy Dunlap
  1 sibling, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2007-01-05 19:41 UTC (permalink / raw)
  To: Olaf Hering; +Cc: lkml, akpm, kernel

On Fri, 5 Jan 2007 20:36:05 +0100 Olaf Hering wrote:

> On Fri, Jan 05, Randy Dunlap wrote:
> 
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> > 
> > SysRq showBlockedTasks is not done via B or T, it's done via X,
> > so put that in the Help message.
> 
> Weird, who failed to run this command before adding new stuff?!
> find * -type f -print0 | xargs -0 env -i grep -nw register_sysrq_key
> 
> sysrq x is for xmon, see arch/powerpc/xmon/xmon.c
> Better switch the new stuff to 'z' or 'w'
> -

OK.  There is also a collision on 'c':

drivers/net/ibm_emac/ibm_emac_debug.c:195:
    return register_sysrq_key('c', &emac_sysrq_op)

and sysrq_crashdump_op.  I'd say ibm_emac needs to change too.

I'll resend.
---
~Randy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sysrq: showBlockedTasks is sysrq-X
  2007-01-05 19:41   ` Randy Dunlap
@ 2007-01-05 19:51     ` Olaf Hering
  0 siblings, 0 replies; 12+ messages in thread
From: Olaf Hering @ 2007-01-05 19:51 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, akpm, kernel

On Fri, Jan 05, Randy Dunlap wrote:

> OK.  There is also a collision on 'c':
> 
> drivers/net/ibm_emac/ibm_emac_debug.c:195:
>     return register_sysrq_key('c', &emac_sysrq_op)
> 
> and sysrq_crashdump_op.  I'd say ibm_emac needs to change too.

I have seen that too.
No idea if crashdump acutally works on ppc 4xx boards,
arch/powerpc/Kconfig lists CRASH_DUMP as ppc64 only.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] sysrq: showBlockedTasks is sysrq-W
  2007-01-05 19:36 ` Olaf Hering
  2007-01-05 19:41   ` Randy Dunlap
@ 2007-01-06 18:25   ` Randy Dunlap
  2007-01-06 19:19     ` Torsten Kaiser
  1 sibling, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2007-01-06 18:25 UTC (permalink / raw)
  To: Olaf Hering; +Cc: lkml, akpm, kernel

On Fri, 5 Jan 2007 20:36:05 +0100 Olaf Hering wrote:

> On Fri, Jan 05, Randy Dunlap wrote:
> 
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> > 
> > SysRq showBlockedTasks is not done via B or T, it's done via X,
> > so put that in the Help message.
> 
> Weird, who failed to run this command before adding new stuff?!
> find * -type f -print0 | xargs -0 env -i grep -nw register_sysrq_key
> 
> sysrq x is for xmon, see arch/powerpc/xmon/xmon.c
> Better switch the new stuff to 'z' or 'w'
---

From: Randy Dunlap <randy.dunlap@oracle.com>

SysRq showBlockedTasks is not done via B or T, it's done via W,
so put that in the Help message.

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

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/char/sysrq.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2620-rc3g4.orig/drivers/char/sysrq.c
+++ linux-2620-rc3g4/drivers/char/sysrq.c
@@ -215,7 +215,7 @@ static void sysrq_handle_showstate_block
 }
 static struct sysrq_key_op sysrq_showstate_blocked_op = {
 	.handler	= sysrq_handle_showstate_blocked,
-	.help_msg	= "showBlockedTasks",
+	.help_msg	= "showBlockedTasks(W)",
 	.action_msg	= "Show Blocked State",
 	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };
@@ -342,8 +342,8 @@ static struct sysrq_key_op *sysrq_key_ta
 	&sysrq_mountro_op,		/* u */
 	/* May be assigned at init time by SMP VOYAGER */
 	NULL,				/* v */
-	NULL,				/* w */
-	&sysrq_showstate_blocked_op,	/* x */
+	&sysrq_showstate_blocked_op,	/* w */
+	NULL,				/* x */
 	NULL,				/* y */
 	NULL				/* z */
 };

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sysrq: showBlockedTasks is sysrq-W
  2007-01-06 18:25   ` [PATCH] sysrq: showBlockedTasks is sysrq-W Randy Dunlap
@ 2007-01-06 19:19     ` Torsten Kaiser
  2007-01-06 20:04       ` Randy Dunlap
                         ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Torsten Kaiser @ 2007-01-06 19:19 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Olaf Hering, lkml, akpm

On Saturday 06 January 2007 19:25, Randy Dunlap wrote:
> On Fri, 5 Jan 2007 20:36:05 +0100 Olaf Hering wrote:
> >
> > Weird, who failed to run this command before adding new stuff?!
> > find * -type f -print0 | xargs -0 env -i grep -nw register_sysrq_key
> >
> > sysrq x is for xmon, see arch/powerpc/xmon/xmon.c
> > Better switch the new stuff to 'z' or 'w'

Also used: 
* c for kexec/crashdump and emac (drivers/net/ibm_emac/ibm_emac_debug.c)
* g for KGDB on ppc

> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> SysRq showBlockedTasks is not done via B or T, it's done via W,
> so put that in the Help message.
>
> It was previously done via X, but X is already used for Xmon
> on powerpc platforms and this collision needs to be avoided.

> @@ -342,8 +342,8 @@ static struct sysrq_key_op *sysrq_key_ta
>  	&sysrq_mountro_op,		/* u */
>  	/* May be assigned at init time by SMP VOYAGER */
>  	NULL,				/* v */

Nice marker that v is in use.

> -	NULL,				/* w */
> -	&sysrq_showstate_blocked_op,	/* x */
> +	&sysrq_showstate_blocked_op,	/* w */
> +	NULL,				/* x */

Wouldn't it be better to also put an marker for xmon here?
And marker for 'c' and 'g' (maybe even 'h')?

>  	NULL,				/* y */
>  	NULL				/* z */
>  };

Also Documentation/sysrq.txt is not uptodate.

It is missing c (emac meaning), d (lockdep), n (un-RT), q (timer), w 
(blocked) and x (xmon), but is documenting 'l' with no longer seems to be 
implemented.

Torsten

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] sysrq: showBlockedTasks is sysrq-W
  2007-01-06 19:19     ` Torsten Kaiser
@ 2007-01-06 20:04       ` Randy Dunlap
  2007-01-06 22:04       ` [PATCH 1/2 v3] " Randy Dunlap
  2007-01-06 22:04       ` [PATCH 2/2] sysrq: alphabetize command keys doc Randy Dunlap
  2 siblings, 0 replies; 12+ messages in thread
From: Randy Dunlap @ 2007-01-06 20:04 UTC (permalink / raw)
  To: Torsten Kaiser; +Cc: Olaf Hering, lkml, akpm

On Sat, 6 Jan 2007 20:19:29 +0100 Torsten Kaiser wrote:

> On Saturday 06 January 2007 19:25, Randy Dunlap wrote:
> > On Fri, 5 Jan 2007 20:36:05 +0100 Olaf Hering wrote:
> > >
> > > Weird, who failed to run this command before adding new stuff?!
> > > find * -type f -print0 | xargs -0 env -i grep -nw register_sysrq_key
> > >
> > > sysrq x is for xmon, see arch/powerpc/xmon/xmon.c
> > > Better switch the new stuff to 'z' or 'w'
> 
> Also used: 
> * c for kexec/crashdump and emac (drivers/net/ibm_emac/ibm_emac_debug.c)

ibm_emac is ppc 4xx only.  Does kexec/crashdump work on that
platform or are they mutually exclusive?

> * g for KGDB on ppc

Is that in mainline?


> > From: Randy Dunlap <randy.dunlap@oracle.com>
> >
> > SysRq showBlockedTasks is not done via B or T, it's done via W,
> > so put that in the Help message.
> >
> > It was previously done via X, but X is already used for Xmon
> > on powerpc platforms and this collision needs to be avoided.
> 
> > @@ -342,8 +342,8 @@ static struct sysrq_key_op *sysrq_key_ta
> >  	&sysrq_mountro_op,		/* u */
> >  	/* May be assigned at init time by SMP VOYAGER */
> >  	NULL,				/* v */
> 
> Nice marker that v is in use.
> 
> > -	NULL,				/* w */
> > -	&sysrq_showstate_blocked_op,	/* x */
> > +	&sysrq_showstate_blocked_op,	/* w */
> > +	NULL,				/* x */
> 
> Wouldn't it be better to also put an marker for xmon here?
> And marker for 'c' and 'g' (maybe even 'h')?

OK, I'll do that.

> >  	NULL,				/* y */
> >  	NULL				/* z */
> >  };
> 
> Also Documentation/sysrq.txt is not uptodate.
> 
> It is missing c (emac meaning), d (lockdep), n (un-RT), q (timer), w 
> (blocked) and x (xmon), but is documenting 'l' with no longer seems to be 
> implemented.

and I'll look into that.  Thanks.

---
~Randy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2 v3] sysrq: showBlockedTasks is sysrq-W
  2007-01-06 19:19     ` Torsten Kaiser
  2007-01-06 20:04       ` Randy Dunlap
@ 2007-01-06 22:04       ` Randy Dunlap
  2007-01-07  0:09         ` Dave Jones
  2007-01-06 22:04       ` [PATCH 2/2] sysrq: alphabetize command keys doc Randy Dunlap
  2 siblings, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2007-01-06 22:04 UTC (permalink / raw)
  To: Torsten Kaiser; +Cc: Olaf Hering, lkml, akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

SysRq showBlockedTasks is not done via B or T, it's done via W,
so put 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>
---
 Documentation/sysrq.txt |   66 +++++++++++++++++++++++++-----------------------
 drivers/char/sysrq.c    |   20 ++++++++------
 2 files changed, 46 insertions(+), 40 deletions(-)

--- linux-2620-rc3g4.orig/drivers/char/sysrq.c
+++ linux-2620-rc3g4/drivers/char/sysrq.c
@@ -215,7 +215,7 @@ static void sysrq_handle_showstate_block
 }
 static struct sysrq_key_op sysrq_showstate_blocked_op = {
 	.handler	= sysrq_handle_showstate_blocked,
-	.help_msg	= "showBlockedTasks",
+	.help_msg	= "showBlockedTasks(W)",
 	.action_msg	= "Show Blocked State",
 	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };
@@ -315,15 +315,16 @@ static struct sysrq_key_op *sysrq_key_ta
 	&sysrq_loglevel_op,		/* 9 */
 
 	/*
-	 * Don't use for system provided sysrqs, it is handled specially on
-	 * sparc and will never arrive
+	 * a: Don't use for system provided sysrqs, it is handled specially on
+	 * sparc and will never arrive.
 	 */
 	NULL,				/* a */
 	&sysrq_reboot_op,		/* b */
-	&sysrq_crashdump_op,		/* c */
+	&sysrq_crashdump_op,		/* c & ibm_emac driver debug */
 	&sysrq_showlocks_op,		/* d */
 	&sysrq_term_op,			/* e */
 	&sysrq_moom_op,			/* f */
+	/* g: May be registered by ppc for kgdb */
 	NULL,				/* g */
 	NULL,				/* h */
 	&sysrq_kill_op,			/* i */
@@ -332,18 +333,19 @@ static struct sysrq_key_op *sysrq_key_ta
 	NULL,				/* l */
 	&sysrq_showmem_op,		/* m */
 	&sysrq_unrt_op,			/* n */
-	/* This will often be registered as 'Off' at init time */
+	/* o: This will often be registered as 'Off' at init time */
 	NULL,				/* o */
 	&sysrq_showregs_op,		/* p */
 	NULL,				/* q */
-	&sysrq_unraw_op,			/* r */
+	&sysrq_unraw_op,		/* r */
 	&sysrq_sync_op,			/* s */
 	&sysrq_showstate_op,		/* t */
 	&sysrq_mountro_op,		/* u */
-	/* May be assigned at init time by SMP VOYAGER */
+	/* v: May be registered at init time by SMP VOYAGER */
 	NULL,				/* v */
-	NULL,				/* w */
-	&sysrq_showstate_blocked_op,	/* x */
+	&sysrq_showstate_blocked_op,	/* w */
+	/* x: May be registered on ppc/powerpc for xmon */
+	NULL,				/* x */
 	NULL,				/* y */
 	NULL				/* z */
 };
--- linux-2620-rc3g4.orig/Documentation/sysrq.txt
+++ linux-2620-rc3g4/Documentation/sysrq.txt
@@ -1,6 +1,6 @@
 Linux Magic System Request Key Hacks
-Documentation for sysrq.c version 1.15
-Last update: $Date: 2001/01/28 10:15:59 $
+Documentation for sysrq.c
+Last update: 2007-JAN-06
 
 *  What is the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -35,7 +35,7 @@ You can set the value in the file by the
 
 Note that the value of /proc/sys/kernel/sysrq influences only the invocation
 via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
-allowed.
+allowed (by a user with admin privileges).
 
 *  How do I use the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (
 On other - If you know of the key combos for other architectures, please
            let me know so I can add them to this section.
 
-On all -  write a character to /proc/sysrq-trigger.  eg:
+On all -  write a character to /proc/sysrq-trigger.  e.g.:
 
 		echo t > /proc/sysrq-trigger
 
@@ -74,6 +74,8 @@ On all -  write a character to /proc/sys
 
 'c'	- Will perform a kexec reboot in order to take a crashdump.
 
+'d'	- Shows all locks that are held.
+
 'o'     - Will shut your system off (if configured and supported).
 
 's'     - Will attempt to sync all mounted filesystems.
@@ -87,38 +89,43 @@ On all -  write a character to /proc/sys
 
 'm'     - Will dump current memory info to your console.
 
+'n'	- Used to make RT tasks nice-able
+
 'v'	- Dumps Voyager SMP processor info to your console.
 
+'w'	- Dumps tasks that are in uninterruptable (blocked) state.
+
+'x'	- Used by xmon interface on ppc/powerpc platforms.
+
 '0'-'9' - Sets the console log level, controlling which kernel messages
           will be printed to your console. ('0', for example would make
           it so that only emergency messages like PANICs or OOPSes would
           make it to your console.)
 
-'f'	- Will call oom_kill to kill a memory hog process
+'f'	- Will call oom_kill to kill a memory hog process.
 
 'e'     - Send a SIGTERM to all processes, except for init.
 
-'i'     - Send a SIGKILL to all processes, except for init.
+'g'	- Used by kgdb on ppc platforms.
 
-'l'     - Send a SIGKILL to all processes, INCLUDING init. (Your system
-          will be non-functional after this.)
+'i'     - Send a SIGKILL to all processes, except for init.
 
-'h'     - Will display help ( actually any other key than those listed
+'h'     - Will display help (actually any other key than those listed
           above will display help. but 'h' is easy to remember :-)
 
 *  Okay, so what can I use them for?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Well, un'R'aw is very handy when your X server or a svgalib program crashes.
 
-sa'K' (Secure Access Key) is useful when you want to be sure there are no
-trojan program is running at console and which could grab your password
-when you would try to login. It will kill all programs on given console
-and thus letting you make sure that the login prompt you see is actually
+sa'K' (Secure Access Key) is useful when you want to be sure there is no
+trojan program running at console which could grab your password
+when you would try to login. It will kill all programs on given console,
+thus letting you make sure that the login prompt you see is actually
 the one from init, not some trojan program.
 IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT
 IMPORTANT: c2 compliant system, and it should not be mistaken as   :IMPORTANT
 IMPORTANT: such.                                                   :IMPORTANT
-       It seems other find it useful as (System Attention Key) which is
+       It seems others find it useful as (System Attention Key) which is
 useful when you want to exit a program that will not let you switch consoles.
 (For example, X or a svgalib program.)
 
@@ -139,8 +146,8 @@ OK or Done message...)
 Again, the unmount (remount read-only) hasn't taken place until you see the
 "OK" and "Done" message appear on the screen.
 
-The loglevel'0'-'9' is useful when your console is being flooded with
-kernel messages you do not want to see. Setting '0' will prevent all but
+The loglevels '0'-'9' are useful when your console is being flooded with
+kernel messages you do not want to see. Selecting '0' will prevent all but
 the most urgent kernel messages from reaching your console. (They will
 still be logged if syslogd/klogd are alive, though.)
 
@@ -152,7 +159,7 @@ processes.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 That happens to me, also. I've found that tapping shift, alt, and control
 on both sides of the keyboard, and hitting an invalid sysrq sequence again
-will fix the problem. (ie, something like alt-sysrq-z). Switching to another
+will fix the problem. (i.e., something like alt-sysrq-z). Switching to another
 virtual console (ALT+Fn) and then back again should also help.
 
 *  I hit SysRq, but nothing seems to happen, what's wrong?
@@ -174,11 +181,11 @@ handler function you will use, B) a help
 prints help, and C) an action_msg string, that will print right before your
 handler is called. Your handler must conform to the prototype in 'sysrq.h'.
 
-After the sysrq_key_op is created, you can call the macro 
-register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in
-sysrq.h, this will register the operation pointed to by 'op_p' at table
-key 'key', if that slot in the table is blank. At module unload time, you must
-call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
+After the sysrq_key_op is created, you can call the kernel function
+register_sysrq_key(int key, struct sysrq_key_op *op_p); this will
+register the operation pointed to by 'op_p' at table key 'key',
+if that slot in the table is blank. At module unload time, you must call
+the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
 will remove the key op pointed to by 'op_p' from the key 'key', if and only if
 it is currently registered in that slot. This is in case the slot has been
 overwritten since you registered it.
@@ -186,15 +193,12 @@ overwritten since you registered it.
 The Magic SysRQ system works by registering key operations against a key op
 lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
 a number of operations registered into it at compile time, but is mutable,
-and 4 functions are exported for interface to it: __sysrq_lock_table,
-__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The
-functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined
-in the header itself, and the REGISTER and UNREGISTER macros are built from
-these. More complex (and dangerous!) manipulations of the table are possible
-using these functions, but you must be careful to always lock the table before
-you read or write from it, and to unlock it again when you are done. (And of
-course, to never ever leave an invalid pointer in the table). Null pointers in
-the table are always safe :)
+and 2 functions are exported for interface to it:
+	register_sysrq_key and unregister_sysrq_key.
+Of course, never ever leave an invalid pointer in the table. I.e., when
+your module that called register_sysrq_key() exits, it must call
+unregister_sysrq_key() to clean up the sysrq key table entry that it used.
+Null pointers in the table are always safe. :)
 
 If for some reason you feel the need to call the handle_sysrq function from
 within a function called by handle_sysrq, you must be aware that you are in


---

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/2] sysrq: alphabetize command keys doc.
  2007-01-06 19:19     ` Torsten Kaiser
  2007-01-06 20:04       ` Randy Dunlap
  2007-01-06 22:04       ` [PATCH 1/2 v3] " Randy Dunlap
@ 2007-01-06 22:04       ` Randy Dunlap
  2 siblings, 0 replies; 12+ messages in thread
From: Randy Dunlap @ 2007-01-06 22:04 UTC (permalink / raw)
  To: Torsten Kaiser; +Cc: Olaf Hering, lkml, akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

Alphabetize the sysrq command keys list.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 Documentation/sysrq.txt |   44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

--- linux-2620-rc3g4.orig/Documentation/sysrq.txt
+++ linux-2620-rc3g4/Documentation/sysrq.txt
@@ -64,11 +64,6 @@ On all -  write a character to /proc/sys
 
 *  What are the 'command' keys?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-'r'     - Turns off keyboard raw mode and sets it to XLATE.
-
-'k'     - Secure Access Key (SAK) Kills all programs on the current virtual
-          console. NOTE: See important comments below in SAK section.
-
 'b'     - Will immediately reboot the system without syncing or unmounting
           your disks.
 
@@ -76,21 +71,37 @@ On all -  write a character to /proc/sys
 
 'd'	- Shows all locks that are held.
 
-'o'     - Will shut your system off (if configured and supported).
+'e'     - Send a SIGTERM to all processes, except for init.
 
-'s'     - Will attempt to sync all mounted filesystems.
+'f'	- Will call oom_kill to kill a memory hog process.
 
-'u'     - Will attempt to remount all mounted filesystems read-only.
+'g'	- Used by kgdb on ppc platforms.
 
-'p'     - Will dump the current registers and flags to your console.
+'h'     - Will display help (actually any other key than those listed
+          above will display help. but 'h' is easy to remember :-)
 
-'t'     - Will dump a list of current tasks and their information to your
-          console.
+'i'     - Send a SIGKILL to all processes, except for init.
+
+'k'     - Secure Access Key (SAK) Kills all programs on the current virtual
+          console. NOTE: See important comments below in SAK section.
 
 'm'     - Will dump current memory info to your console.
 
 'n'	- Used to make RT tasks nice-able
 
+'o'     - Will shut your system off (if configured and supported).
+
+'p'     - Will dump the current registers and flags to your console.
+
+'r'     - Turns off keyboard raw mode and sets it to XLATE.
+
+'s'     - Will attempt to sync all mounted filesystems.
+
+'t'     - Will dump a list of current tasks and their information to your
+          console.
+
+'u'     - Will attempt to remount all mounted filesystems read-only.
+
 'v'	- Dumps Voyager SMP processor info to your console.
 
 'w'	- Dumps tasks that are in uninterruptable (blocked) state.
@@ -102,17 +113,6 @@ On all -  write a character to /proc/sys
           it so that only emergency messages like PANICs or OOPSes would
           make it to your console.)
 
-'f'	- Will call oom_kill to kill a memory hog process.
-
-'e'     - Send a SIGTERM to all processes, except for init.
-
-'g'	- Used by kgdb on ppc platforms.
-
-'i'     - Send a SIGKILL to all processes, except for init.
-
-'h'     - Will display help (actually any other key than those listed
-          above will display help. but 'h' is easy to remember :-)
-
 *  Okay, so what can I use them for?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Well, un'R'aw is very handy when your X server or a svgalib program crashes.

---

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2 v3] sysrq: showBlockedTasks is sysrq-W
  2007-01-06 22:04       ` [PATCH 1/2 v3] " Randy Dunlap
@ 2007-01-07  0:09         ` Dave Jones
  2007-01-07  2:36           ` [PATCH 1/2 v4] " Randy Dunlap
  0 siblings, 1 reply; 12+ messages in thread
From: Dave Jones @ 2007-01-07  0:09 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Torsten Kaiser, Olaf Hering, lkml, akpm

On Sat, Jan 06, 2007 at 02:04:24PM -0800, Randy Dunlap wrote:

 > +	.help_msg	= "showBlockedTasks(W)",

Why not the same scheme as the existing help msgs..

shoWblockedtasks  ?

		Dave

-- 
http://www.codemonkey.org.uk

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2 v4] sysrq: showBlockedTasks is sysrq-W
  2007-01-07  0:09         ` Dave Jones
@ 2007-01-07  2:36           ` Randy Dunlap
  2007-01-07  2:41             ` Dave Jones
  0 siblings, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2007-01-07  2:36 UTC (permalink / raw)
  To: Dave Jones; +Cc: Torsten Kaiser, Olaf Hering, lkml, akpm

On Sat, 6 Jan 2007 19:09:45 -0500 Dave Jones wrote:

> On Sat, Jan 06, 2007 at 02:04:24PM -0800, Randy Dunlap wrote:
> 
>  > +	.help_msg	= "showBlockedTasks(W)",
> 
> Why not the same scheme as the existing help msgs..

Yes.  Thanks.

> shoWblockedtasks  ?

Would shoW-blocked-tasks be OK?

---
From: Randy Dunlap <randy.dunlap@oracle.com>

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>
---
 Documentation/sysrq.txt |   66 +++++++++++++++++++++++++-----------------------
 drivers/char/sysrq.c    |   20 ++++++++------
 2 files changed, 46 insertions(+), 40 deletions(-)

--- linux-2620-rc3g4.orig/drivers/char/sysrq.c
+++ linux-2620-rc3g4/drivers/char/sysrq.c
@@ -215,7 +215,7 @@ static void sysrq_handle_showstate_block
 }
 static struct sysrq_key_op sysrq_showstate_blocked_op = {
 	.handler	= sysrq_handle_showstate_blocked,
-	.help_msg	= "showBlockedTasks",
+	.help_msg	= "shoW-blocked-tasks",
 	.action_msg	= "Show Blocked State",
 	.enable_mask	= SYSRQ_ENABLE_DUMP,
 };
@@ -315,15 +315,16 @@ static struct sysrq_key_op *sysrq_key_ta
 	&sysrq_loglevel_op,		/* 9 */
 
 	/*
-	 * Don't use for system provided sysrqs, it is handled specially on
-	 * sparc and will never arrive
+	 * a: Don't use for system provided sysrqs, it is handled specially on
+	 * sparc and will never arrive.
 	 */
 	NULL,				/* a */
 	&sysrq_reboot_op,		/* b */
-	&sysrq_crashdump_op,		/* c */
+	&sysrq_crashdump_op,		/* c & ibm_emac driver debug */
 	&sysrq_showlocks_op,		/* d */
 	&sysrq_term_op,			/* e */
 	&sysrq_moom_op,			/* f */
+	/* g: May be registered by ppc for kgdb */
 	NULL,				/* g */
 	NULL,				/* h */
 	&sysrq_kill_op,			/* i */
@@ -332,18 +333,19 @@ static struct sysrq_key_op *sysrq_key_ta
 	NULL,				/* l */
 	&sysrq_showmem_op,		/* m */
 	&sysrq_unrt_op,			/* n */
-	/* This will often be registered as 'Off' at init time */
+	/* o: This will often be registered as 'Off' at init time */
 	NULL,				/* o */
 	&sysrq_showregs_op,		/* p */
 	NULL,				/* q */
-	&sysrq_unraw_op,			/* r */
+	&sysrq_unraw_op,		/* r */
 	&sysrq_sync_op,			/* s */
 	&sysrq_showstate_op,		/* t */
 	&sysrq_mountro_op,		/* u */
-	/* May be assigned at init time by SMP VOYAGER */
+	/* v: May be registered at init time by SMP VOYAGER */
 	NULL,				/* v */
-	NULL,				/* w */
-	&sysrq_showstate_blocked_op,	/* x */
+	&sysrq_showstate_blocked_op,	/* w */
+	/* x: May be registered on ppc/powerpc for xmon */
+	NULL,				/* x */
 	NULL,				/* y */
 	NULL				/* z */
 };
--- linux-2620-rc3g4.orig/Documentation/sysrq.txt
+++ linux-2620-rc3g4/Documentation/sysrq.txt
@@ -1,6 +1,6 @@
 Linux Magic System Request Key Hacks
-Documentation for sysrq.c version 1.15
-Last update: $Date: 2001/01/28 10:15:59 $
+Documentation for sysrq.c
+Last update: 2007-JAN-06
 
 *  What is the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -35,7 +35,7 @@ You can set the value in the file by the
 
 Note that the value of /proc/sys/kernel/sysrq influences only the invocation
 via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
-allowed.
+allowed (by a user with admin privileges).
 
 *  How do I use the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (
 On other - If you know of the key combos for other architectures, please
            let me know so I can add them to this section.
 
-On all -  write a character to /proc/sysrq-trigger.  eg:
+On all -  write a character to /proc/sysrq-trigger.  e.g.:
 
 		echo t > /proc/sysrq-trigger
 
@@ -74,6 +74,8 @@ On all -  write a character to /proc/sys
 
 'c'	- Will perform a kexec reboot in order to take a crashdump.
 
+'d'	- Shows all locks that are held.
+
 'o'     - Will shut your system off (if configured and supported).
 
 's'     - Will attempt to sync all mounted filesystems.
@@ -87,38 +89,43 @@ On all -  write a character to /proc/sys
 
 'm'     - Will dump current memory info to your console.
 
+'n'	- Used to make RT tasks nice-able
+
 'v'	- Dumps Voyager SMP processor info to your console.
 
+'w'	- Dumps tasks that are in uninterruptable (blocked) state.
+
+'x'	- Used by xmon interface on ppc/powerpc platforms.
+
 '0'-'9' - Sets the console log level, controlling which kernel messages
           will be printed to your console. ('0', for example would make
           it so that only emergency messages like PANICs or OOPSes would
           make it to your console.)
 
-'f'	- Will call oom_kill to kill a memory hog process
+'f'	- Will call oom_kill to kill a memory hog process.
 
 'e'     - Send a SIGTERM to all processes, except for init.
 
-'i'     - Send a SIGKILL to all processes, except for init.
+'g'	- Used by kgdb on ppc platforms.
 
-'l'     - Send a SIGKILL to all processes, INCLUDING init. (Your system
-          will be non-functional after this.)
+'i'     - Send a SIGKILL to all processes, except for init.
 
-'h'     - Will display help ( actually any other key than those listed
+'h'     - Will display help (actually any other key than those listed
           above will display help. but 'h' is easy to remember :-)
 
 *  Okay, so what can I use them for?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Well, un'R'aw is very handy when your X server or a svgalib program crashes.
 
-sa'K' (Secure Access Key) is useful when you want to be sure there are no
-trojan program is running at console and which could grab your password
-when you would try to login. It will kill all programs on given console
-and thus letting you make sure that the login prompt you see is actually
+sa'K' (Secure Access Key) is useful when you want to be sure there is no
+trojan program running at console which could grab your password
+when you would try to login. It will kill all programs on given console,
+thus letting you make sure that the login prompt you see is actually
 the one from init, not some trojan program.
 IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT
 IMPORTANT: c2 compliant system, and it should not be mistaken as   :IMPORTANT
 IMPORTANT: such.                                                   :IMPORTANT
-       It seems other find it useful as (System Attention Key) which is
+       It seems others find it useful as (System Attention Key) which is
 useful when you want to exit a program that will not let you switch consoles.
 (For example, X or a svgalib program.)
 
@@ -139,8 +146,8 @@ OK or Done message...)
 Again, the unmount (remount read-only) hasn't taken place until you see the
 "OK" and "Done" message appear on the screen.
 
-The loglevel'0'-'9' is useful when your console is being flooded with
-kernel messages you do not want to see. Setting '0' will prevent all but
+The loglevels '0'-'9' are useful when your console is being flooded with
+kernel messages you do not want to see. Selecting '0' will prevent all but
 the most urgent kernel messages from reaching your console. (They will
 still be logged if syslogd/klogd are alive, though.)
 
@@ -152,7 +159,7 @@ processes.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 That happens to me, also. I've found that tapping shift, alt, and control
 on both sides of the keyboard, and hitting an invalid sysrq sequence again
-will fix the problem. (ie, something like alt-sysrq-z). Switching to another
+will fix the problem. (i.e., something like alt-sysrq-z). Switching to another
 virtual console (ALT+Fn) and then back again should also help.
 
 *  I hit SysRq, but nothing seems to happen, what's wrong?
@@ -174,11 +181,11 @@ handler function you will use, B) a help
 prints help, and C) an action_msg string, that will print right before your
 handler is called. Your handler must conform to the prototype in 'sysrq.h'.
 
-After the sysrq_key_op is created, you can call the macro 
-register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in
-sysrq.h, this will register the operation pointed to by 'op_p' at table
-key 'key', if that slot in the table is blank. At module unload time, you must
-call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
+After the sysrq_key_op is created, you can call the kernel function
+register_sysrq_key(int key, struct sysrq_key_op *op_p); this will
+register the operation pointed to by 'op_p' at table key 'key',
+if that slot in the table is blank. At module unload time, you must call
+the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
 will remove the key op pointed to by 'op_p' from the key 'key', if and only if
 it is currently registered in that slot. This is in case the slot has been
 overwritten since you registered it.
@@ -186,15 +193,12 @@ overwritten since you registered it.
 The Magic SysRQ system works by registering key operations against a key op
 lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
 a number of operations registered into it at compile time, but is mutable,
-and 4 functions are exported for interface to it: __sysrq_lock_table,
-__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The
-functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined
-in the header itself, and the REGISTER and UNREGISTER macros are built from
-these. More complex (and dangerous!) manipulations of the table are possible
-using these functions, but you must be careful to always lock the table before
-you read or write from it, and to unlock it again when you are done. (And of
-course, to never ever leave an invalid pointer in the table). Null pointers in
-the table are always safe :)
+and 2 functions are exported for interface to it:
+	register_sysrq_key and unregister_sysrq_key.
+Of course, never ever leave an invalid pointer in the table. I.e., when
+your module that called register_sysrq_key() exits, it must call
+unregister_sysrq_key() to clean up the sysrq key table entry that it used.
+Null pointers in the table are always safe. :)
 
 If for some reason you feel the need to call the handle_sysrq function from
 within a function called by handle_sysrq, you must be aware that you are in

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2 v4] sysrq: showBlockedTasks is sysrq-W
  2007-01-07  2:36           ` [PATCH 1/2 v4] " Randy Dunlap
@ 2007-01-07  2:41             ` Dave Jones
  0 siblings, 0 replies; 12+ messages in thread
From: Dave Jones @ 2007-01-07  2:41 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Torsten Kaiser, Olaf Hering, lkml, akpm

On Sat, Jan 06, 2007 at 06:36:28PM -0800, Randy Dunlap wrote:
 > On Sat, 6 Jan 2007 19:09:45 -0500 Dave Jones wrote:
 > 
 > > On Sat, Jan 06, 2007 at 02:04:24PM -0800, Randy Dunlap wrote:
 > > 
 > >  > +	.help_msg	= "showBlockedTasks(W)",
 > > 
 > > Why not the same scheme as the existing help msgs..
 > 
 > Yes.  Thanks.
 > 
 > > shoWblockedtasks  ?
 > 
 > Would shoW-blocked-tasks be OK?

Works for me.

thanks,

		Dave

-- 
http://www.codemonkey.org.uk

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-01-07  2:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-05 19:06 [PATCH] sysrq: showBlockedTasks is sysrq-X Randy Dunlap
2007-01-05 19:36 ` Olaf Hering
2007-01-05 19:41   ` Randy Dunlap
2007-01-05 19:51     ` Olaf Hering
2007-01-06 18:25   ` [PATCH] sysrq: showBlockedTasks is sysrq-W Randy Dunlap
2007-01-06 19:19     ` Torsten Kaiser
2007-01-06 20:04       ` Randy Dunlap
2007-01-06 22:04       ` [PATCH 1/2 v3] " Randy Dunlap
2007-01-07  0:09         ` Dave Jones
2007-01-07  2:36           ` [PATCH 1/2 v4] " Randy Dunlap
2007-01-07  2:41             ` Dave Jones
2007-01-06 22:04       ` [PATCH 2/2] sysrq: alphabetize command keys doc Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).