Skip to contentSkip to conversation

leave loglevel at 7 through sysrq output so you can actually read it

PATCH In review Martin Bligh 2 participants 5 messages Apr 5, 2007 – Apr 6, 2007 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leave loglevel at 7 through sysrq output so you can actually read it

We carefully set loglevel to 7, and print the sysrq messsage as to what event we're doing, but we can't actually see the output as it sets it back before calling the handler, rather than after.

Move the assignment down one line.

drivers/char/sysrq.c +1 -1
diff -aurpN -X /home/mbligh/.diff.exclude linux-2.6.21-rc5-git10/drivers/char/sysrq.c linux-2.6.21-rc5-git10-loglevel/drivers/char/sysrq.c
@@ -421,8 +421,8 @@ void __handle_sysrq(int key, struct tty_
 		 */
 		if (!check_mask || sysrq_on_mask(op_p->enable_mask)) {
 			printk("%s\n", op_p->action_msg);
-			console_loglevel = orig_log_level;
 			op_p->handler(key, tty);
+			console_loglevel = orig_log_level;
 		} else {
 			printk("This sysrq operation is disabled.\n");
 		}
#1 lore raw
Quoted 6 lines · Martin Bligh

We carefully set loglevel to 7, and print the sysrq messsage as to what event we're doing, but we can't actually see the output as it sets it back before calling the handler, rather than after.

Move the assignment down one line.

I think you have to tell sysrq_handle_loglevel() about this too...

bye, Roman

#2 lore raw
Quoted 11 lines · Roman Zippel
Quoted 6 lines · Martin Bligh

We carefully set loglevel to 7, and print the sysrq messsage as to what event we're doing, but we can't actually see the output as it sets it back before calling the handler, rather than after.

Move the assignment down one line.

I think you have to tell sysrq_handle_loglevel() about this too...

Not sure why? That just changes the current loglevel, and seems unaffected.

I did test the patch, and it works fine.

M.

#3 lore raw

Hi,

Quoted 4 lines · Martin Bligh
Quoted 1 line

I think you have to tell sysrq_handle_loglevel() about this too...

Not sure why? That just changes the current loglevel, and seems unaffected.

Who's the last to set console_loglevel?

Quoted 1 line

I did test the patch, and it works fine.

Did you check /proc/sys/kernel/printk?

bye, Roman

#4 lore raw

Hi,

Quoted 3 lines · Roman Zippel
Quoted 1 line

I did test the patch, and it works fine.

Did you check /proc/sys/kernel/printk?

BTW for even more fun check this with "echo 4 > /proc/sys/kernel/sysrq".

bye, Roman