diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2013-02-04 10:52:14 -0500 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2013-03-02 09:52:18 -0500 |
commit | 074604af21c971cf2fcfaa0f6012b4b0c9ca891a (patch) | |
tree | 99be6f5e72b1438866e5bbce8c010fb3269eaa75 /kernel/debug | |
parent | 4eb7a66d9410927fb8fbafad8b8298b627cdd128 (diff) |
kdb_main: fix help print
The help command was chopping all the usage instructions such that
they were not readable.
Example:
bta [D|R|S|T|C|Z|E|U|I| Backtrace all processes matching state flag
per_cpu <sym> [<bytes>] [<c Display per_cpu variables
Where as it should look like:
bta [D|R|S|T|C|Z|E|U|I|M|A]
Backtrace all processes matching state flag
per_cpu <sym> [<bytes>] [<cpu>]
Display per_cpu variables
All that is needed is to check the how long the cmd_usage is and jump
to the next line when appropriate.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'kernel/debug')
-rw-r--r-- | kernel/debug/kdb/kdb_main.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index de22c8cc6c30..25908cf2f5d7 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c | |||
@@ -2442,11 +2442,15 @@ static int kdb_help(int argc, const char **argv) | |||
2442 | kdb_printf("-----------------------------" | 2442 | kdb_printf("-----------------------------" |
2443 | "-----------------------------\n"); | 2443 | "-----------------------------\n"); |
2444 | for_each_kdbcmd(kt, i) { | 2444 | for_each_kdbcmd(kt, i) { |
2445 | if (kt->cmd_name) | 2445 | char *space = ""; |
2446 | kdb_printf("%-15.15s %-20.20s %s\n", kt->cmd_name, | ||
2447 | kt->cmd_usage, kt->cmd_help); | ||
2448 | if (KDB_FLAG(CMD_INTERRUPT)) | 2446 | if (KDB_FLAG(CMD_INTERRUPT)) |
2449 | return 0; | 2447 | return 0; |
2448 | if (!kt->cmd_name) | ||
2449 | continue; | ||
2450 | if (strlen(kt->cmd_usage) > 20) | ||
2451 | space = "\n "; | ||
2452 | kdb_printf("%-15.15s %-20s%s%s\n", kt->cmd_name, | ||
2453 | kt->cmd_usage, space, kt->cmd_help); | ||
2450 | } | 2454 | } |
2451 | return 0; | 2455 | return 0; |
2452 | } | 2456 | } |