OSDN Git Service

misc: kernel_debugger: Add help command
authorDmitry Shmidt <dimitrysh@google.com>
Tue, 16 Nov 2010 23:39:43 +0000 (15:39 -0800)
committerBrian Swetland <swetland@google.com>
Tue, 29 Mar 2011 20:58:00 +0000 (13:58 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/misc/kernel_debugger.c

index 20e1abb..4a9fef6 100644 (file)
@@ -65,6 +65,14 @@ static void do_sysrq(struct kdbg_ctxt *ctxt, char rq)
        }
 }
 
+static void do_help(struct kdbg_ctxt *ctxt)
+{
+       dprintf("Kernel Debugger commands:\n");
+       dprintf(" ps            Process list\n");
+       dprintf(" sysrq         sysrq options\n");
+       dprintf(" sysrq <param> Execute sysrq with <param>\n");
+}
+
 int kernel_debugger(struct kdbg_ctxt *ctxt, char *cmd)
 {
        if (!strcmp(cmd, "ps"))
@@ -73,6 +81,8 @@ int kernel_debugger(struct kdbg_ctxt *ctxt, char *cmd)
                do_sysrq(ctxt, 'h');
        if (!strncmp(cmd, "sysrq ", 6))
                do_sysrq(ctxt, cmd[6]);
+       if (!strcmp(cmd, "help"))
+               do_help(ctxt);
 
        return 0;
 }