From: Ingo Molnar Add SysRq-Q to print pending timers and other timer info. Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton --- drivers/char/sysrq.c | 14 +++++++++++++- include/linux/hrtimer.h | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff -puN drivers/char/sysrq.c~debugging-feature-sysrq-q-to-print-timers drivers/char/sysrq.c --- a/drivers/char/sysrq.c~debugging-feature-sysrq-q-to-print-timers +++ a/drivers/char/sysrq.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -159,6 +160,17 @@ static struct sysrq_key_op sysrq_sync_op .enable_mask = SYSRQ_ENABLE_SYNC, }; +static void sysrq_handle_show_timers(int key, struct tty_struct *tty) +{ + sysrq_timer_list_show(); +} + +static struct sysrq_key_op sysrq_show_timers_op = { + .handler = sysrq_handle_show_timers, + .help_msg = "show-all-timers(Q)", + .action_msg = "Show Pending Timers", +}; + static void sysrq_handle_mountro(int key, struct tty_struct *tty) { emergency_remount(); @@ -335,7 +347,7 @@ static struct sysrq_key_op *sysrq_key_ta /* This will often be registered as 'Off' at init time */ NULL, /* o */ &sysrq_showregs_op, /* p */ - NULL, /* q */ + &sysrq_show_timers_op, /* q */ &sysrq_unraw_op, /* r */ &sysrq_sync_op, /* s */ &sysrq_showstate_op, /* t */ diff -puN include/linux/hrtimer.h~debugging-feature-sysrq-q-to-print-timers include/linux/hrtimer.h --- a/include/linux/hrtimer.h~debugging-feature-sysrq-q-to-print-timers +++ a/include/linux/hrtimer.h @@ -344,6 +344,9 @@ static inline void show_no_hz_stats(stru /* Bootup initialization: */ extern void __init hrtimers_init(void); +/* Show pending timers: */ +extern void sysrq_timer_list_show(void); + /* * Timer-statistics info: */ _