Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933347Ab3CLTmH (ORCPT ); Tue, 12 Mar 2013 15:42:07 -0400 Received: from relay1.sgi.com ([192.48.179.29]:42418 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755473Ab3CLTiZ (ORCPT ); Tue, 12 Mar 2013 15:38:25 -0400 Message-Id: <20130312193824.642842862@gulag1.americas.sgi.com> References: <20130312193823.212544181@gulag1.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Tue, 12 Mar 2013 14:38:32 -0500 From: Mike Travis To: Jason Wessel Cc: Dimitri Sivanich , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton , kgdb-bugreport@lists.sourceforge.net, x86@kernel.org, linux-kernel@vger.kernel.org, Anton Vorontsov , Sasha Levin , Rusty Russell , Greg Kroah-Hartman Subject: [PATCH 09/14] KDB: Add pshelp command. Content-Disposition: inline; filename=kdb-add-pshelp.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2288 Lines: 64 This patch restores the capability for providing help with the PS and BT arguments. Cc: Anton Vorontsov Cc: Sasha Levin Cc: Rusty Russell Cc: Greg Kroah-Hartman Reviewed-by: Dimitri Sivanich Signed-off-by: Mike Travis --- kernel/debug/kdb/kdb_main.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) --- linux.orig/kernel/debug/kdb/kdb_main.c +++ linux/kernel/debug/kdb/kdb_main.c @@ -2787,6 +2787,32 @@ static int kdb_grep_help(int argc, const } /* + * display help for the ps and bt status flag + */ +static int kdb_ps_help(int argc, const char **argv) +{ + kdb_printf("The meaning of the State flag in ps command output:\n"); + kdb_printf(" R RUNNING\n"); + kdb_printf(" D TASK_UNINTERRUPTIBLE\n"); + kdb_printf(" S TASK_INTERRUPTIBLE\n"); + kdb_printf(" T TASK_STOPPED\n"); + kdb_printf(" C TASK_TRACED\n"); + kdb_printf(" Z EXIT_ZOMBIE\n"); + kdb_printf(" E EXIT_DEAD\n"); + kdb_printf(" U UNRUNNABLE\n"); + kdb_printf(" M sleeping DAEMON\n"); + kdb_printf(" I IDLE\n"); + kdb_printf(" (note that most idles are named 'kworker/NN')\n"); + kdb_printf("\n"); + kdb_printf( + "The above can be specified to ps and bta to select tasks\n"); + kdb_printf(" A all of above\n"); + kdb_printf(" default is RDSTCZEU (not Idle or sleeping Daemon)\n"); + return 0; +} + + +/* * kdb_register_repeat - This function is used to register a kernel * debugger command. * Inputs: @@ -2972,6 +2998,8 @@ static void __init kdb_inittab(void) "Enter kgdb mode", 0, KDB_REPEAT_NONE); kdb_register_repeat("ps", kdb_ps, "[|A]", "Display active task list", 0, KDB_REPEAT_NONE); + kdb_register_repeat("pshelp", kdb_ps_help, "", + "Display help for the ps and bt task State flag", 0, KDB_REPEAT_NONE); kdb_register_repeat("pid", kdb_pid, "", "Switch to another task", 0, KDB_REPEAT_NONE); kdb_register_repeat("reboot", kdb_reboot, "", -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/