[Patch] sysrq-show-output, kernel 2.4.17

From: Harald Holzer (harald.holzer@eunet.at)
Date: Wed Jan 02 2002 - 18:25:06 EST


Sysrq-m didnt show memory information on the serial console.

This patch sets the console_loglevel to 7 before it calls show_mem,
show_regs and show_state, to get the output.

Harald Holzer


--- linux-2.4.17/drivers/char/sysrq.c Fri Dec 21 18:41:54 2001
+++ linux/drivers/char/sysrq.c Tue Jan 1 21:18:24 2002
@@ -246,8 +246,14 @@
 
 static void sysrq_handle_showregs(int key, struct pt_regs *pt_regs,
                 struct kbd_struct *kbd, struct tty_struct *tty) {
+ int orig_loglevel;
+
         if (pt_regs)
+ orig_loglevel = console_loglevel;
+ console_loglevel = 7;
                 show_regs(pt_regs);
+ console_loglevel = orig_loglevel;
+
 }
 static struct sysrq_key_op sysrq_showregs_op = {
         handler: sysrq_handle_showregs,
@@ -258,7 +264,12 @@
 
 static void sysrq_handle_showstate(int key, struct pt_regs *pt_regs,
                 struct kbd_struct *kbd, struct tty_struct *tty) {
+ int orig_loglevel;
+
+ orig_loglevel = console_loglevel;
+ console_loglevel = 7;
         show_state();
+ console_loglevel = orig_loglevel;
 }
 static struct sysrq_key_op sysrq_showstate_op = {
         handler: sysrq_handle_showstate,
@@ -269,7 +280,12 @@
 
 static void sysrq_handle_showmem(int key, struct pt_regs *pt_regs,
                 struct kbd_struct *kbd, struct tty_struct *tty) {
+ int orig_loglevel;
+
+ orig_loglevel = console_loglevel;
+ console_loglevel = 7;
         show_mem();
+ console_loglevel = orig_loglevel;
 }
 static struct sysrq_key_op sysrq_showmem_op = {
         handler: sysrq_handle_showmem,

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:19 EST