From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 30 Aug 2017 08:25:59 +0000 Subject: Initial file dump from open source release --- drivers/tty/sprdrq.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 drivers/tty/sprdrq.c (limited to 'drivers/tty/sprdrq.c') diff --git a/drivers/tty/sprdrq.c b/drivers/tty/sprdrq.c new file mode 100644 index 00000000..b07da2a3 --- /dev/null +++ b/drivers/tty/sprdrq.c @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2012 Spreadtrum Communications Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include + +void show_state_group(unsigned long state_filter) +{ + struct task_struct *p, *g; + + rcu_read_lock(); + do_each_thread(g, p) { + touch_nmi_watchdog(); + if (p->state & state_filter){ + printk(KERN_INFO "\nGroup: %s - %d\n", g->comm, g->pid); + /* dump all threads stack in same group */ + p = g; + do{ + sched_show_task(p); + }while_each_thread(g, p); + break; + } + } while_each_thread(g, p); + rcu_read_unlock(); +} + +static void sysrq_handle_show_blocked_group(int key) +{ + show_state_group(TASK_UNINTERRUPTIBLE); +} + +struct sysrq_key_op sysrq_show_blocked_group_op = { + .handler = sysrq_handle_show_blocked_group, + .help_msg = "show-blocked-group(x)", + .action_msg = "Show Blocked Group State", + .enable_mask = SYSRQ_ENABLE_DUMP, +}; + -- cgit v1.3.1