Hi guys, I see that the thread is ongoing and you understand printk code much better than me or probably anybody :)
So, feel free to reuse it. Or I can send v1 with split sysrq/printk parts if you think it's worth being shaped further. I think worth to mention three "features" that you might had a chance to miss from the current code: 1. op_p->handler(key) is not printed under console_loglevel hackery. So, under RFC I preserved the behavior. Probably, you don't miss it and just looking into ways to change it, but I thought worth mentioning. 2. I've found it surprising how pr_info() interacts with pr_cont(): Basically, pr_cont() without KERN_<LEVEL> prefix will print the resulting line with default_message_loglevel AFAIU from cont.level. Which might be higher than warning. I might miss a part that corrects cont.level to the first message's level? 3. CONSOLE_LOGLEVEL_DEFAULT is config-based, so having in mind that it can be changed and (2) - it gives me hard time to understand when the sysrq message will be printed and when will be suppressed. Thanks, Dmitry