From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbdHGImB (ORCPT ); Mon, 7 Aug 2017 04:42:01 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2549 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752408AbdHGIl4 (ORCPT ); Mon, 7 Aug 2017 04:41:56 -0400 From: Xie XiuQi To: , CC: , , , Subject: [PATCH 0/2] sched/debug: show task state on /proc/sched_debug Date: Mon, 7 Aug 2017 16:44:21 +0800 Message-ID: <1502095463-160172-1-git-send-email-xiexiuqi@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.598827D3.002F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 3a11d74177b9efdbc5fe62bf34944a99 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, we print the runnable task in /proc/sched_debug, but there is no task state information. We don't know which task is in runqueue, and which task is in sleep. For the convenience of debugging, in this patch, we add task state in runnable task list, like this: runnable tasks: S task PID tree-key switches prio wait-time sum-exec sum-sleep ----------------------------------------------------------------------------------------------------------- S watchdog/239 1452 -11.917445 2811 0 0.000000 8.949306 0.000000 7 0 / S migration/239 1453 20686.367740 8 0 0.000000 16215.720897 0.000000 7 0 / S ksoftirqd/239 1454 115383.841071 12 120 0.000000 0.200683 0.000000 7 0 / >R test 21287 4872.190970 407 120 0.000000 4874.911790 0.000000 7 0 /autogroup-150 R test 21288 4868.385454 401 120 0.000000 3672.341489 0.000000 7 0 /autogroup-150 R test 21289 4868.326776 384 120 0.000000 3424.934159 0.000000 7 0 /autogroup-150 Xie XiuQi (2): sched/debug: show task state on /proc/sched_debug sched/debug: intruduce task_state_to_char helper function include/linux/sched.h | 13 +++++++++++++ kernel/sched/core.c | 15 ++++----------- kernel/sched/debug.c | 10 ++++++---- 3 files changed, 23 insertions(+), 15 deletions(-) -- 1.8.3.1