forked from Minki/linux
kdb: Rename members of struct kdbtab_t
Remove redundant prefix "cmd_" from name of members in struct kdbtab_t for better readibility. Suggested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20210712134620.276667-5-sumit.garg@linaro.org Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
This commit is contained in:
parent
9a5db530aa
commit
e868f0a3c4
@ -68,12 +68,12 @@ typedef int (*kdb_func_t)(int, const char **);
|
|||||||
|
|
||||||
/* The KDB shell command table */
|
/* The KDB shell command table */
|
||||||
typedef struct _kdbtab {
|
typedef struct _kdbtab {
|
||||||
char *cmd_name; /* Command name */
|
char *name; /* Command name */
|
||||||
kdb_func_t cmd_func; /* Function to execute command */
|
kdb_func_t func; /* Function to execute command */
|
||||||
char *cmd_usage; /* Usage String for this command */
|
char *usage; /* Usage String for this command */
|
||||||
char *cmd_help; /* Help message for this command */
|
char *help; /* Help message for this command */
|
||||||
short cmd_minlen; /* Minimum legal # cmd chars required */
|
short minlen; /* Minimum legal # cmd chars required */
|
||||||
kdb_cmdflags_t cmd_flags; /* Command behaviour flags */
|
kdb_cmdflags_t flags; /* Command behaviour flags */
|
||||||
struct list_head list_node; /* Command list */
|
struct list_head list_node; /* Command list */
|
||||||
} kdbtab_t;
|
} kdbtab_t;
|
||||||
|
|
||||||
|
@ -523,51 +523,51 @@ static int kdb_ss(int argc, const char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static kdbtab_t bptab[] = {
|
static kdbtab_t bptab[] = {
|
||||||
{ .cmd_name = "bp",
|
{ .name = "bp",
|
||||||
.cmd_func = kdb_bp,
|
.func = kdb_bp,
|
||||||
.cmd_usage = "[<vaddr>]",
|
.usage = "[<vaddr>]",
|
||||||
.cmd_help = "Set/Display breakpoints",
|
.help = "Set/Display breakpoints",
|
||||||
.cmd_flags = KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "bl",
|
{ .name = "bl",
|
||||||
.cmd_func = kdb_bp,
|
.func = kdb_bp,
|
||||||
.cmd_usage = "[<vaddr>]",
|
.usage = "[<vaddr>]",
|
||||||
.cmd_help = "Display breakpoints",
|
.help = "Display breakpoints",
|
||||||
.cmd_flags = KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "bc",
|
{ .name = "bc",
|
||||||
.cmd_func = kdb_bc,
|
.func = kdb_bc,
|
||||||
.cmd_usage = "<bpnum>",
|
.usage = "<bpnum>",
|
||||||
.cmd_help = "Clear Breakpoint",
|
.help = "Clear Breakpoint",
|
||||||
.cmd_flags = KDB_ENABLE_FLOW_CTRL,
|
.flags = KDB_ENABLE_FLOW_CTRL,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "be",
|
{ .name = "be",
|
||||||
.cmd_func = kdb_bc,
|
.func = kdb_bc,
|
||||||
.cmd_usage = "<bpnum>",
|
.usage = "<bpnum>",
|
||||||
.cmd_help = "Enable Breakpoint",
|
.help = "Enable Breakpoint",
|
||||||
.cmd_flags = KDB_ENABLE_FLOW_CTRL,
|
.flags = KDB_ENABLE_FLOW_CTRL,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "bd",
|
{ .name = "bd",
|
||||||
.cmd_func = kdb_bc,
|
.func = kdb_bc,
|
||||||
.cmd_usage = "<bpnum>",
|
.usage = "<bpnum>",
|
||||||
.cmd_help = "Disable Breakpoint",
|
.help = "Disable Breakpoint",
|
||||||
.cmd_flags = KDB_ENABLE_FLOW_CTRL,
|
.flags = KDB_ENABLE_FLOW_CTRL,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "ss",
|
{ .name = "ss",
|
||||||
.cmd_func = kdb_ss,
|
.func = kdb_ss,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Single Step",
|
.help = "Single Step",
|
||||||
.cmd_minlen = 1,
|
.minlen = 1,
|
||||||
.cmd_flags = KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static kdbtab_t bphcmd = {
|
static kdbtab_t bphcmd = {
|
||||||
.cmd_name = "bph",
|
.name = "bph",
|
||||||
.cmd_func = kdb_bp,
|
.func = kdb_bp,
|
||||||
.cmd_usage = "[<vaddr>]",
|
.usage = "[<vaddr>]",
|
||||||
.cmd_help = "[datar [length]|dataw [length]] Set hw brk",
|
.help = "[datar [length]|dataw [length]] Set hw brk",
|
||||||
.cmd_flags = KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Initialize the breakpoint table and register breakpoint commands. */
|
/* Initialize the breakpoint table and register breakpoint commands. */
|
||||||
|
@ -711,10 +711,9 @@ static int kdb_defcmd(int argc, const char **argv)
|
|||||||
struct kdb_macro_statement *kms;
|
struct kdb_macro_statement *kms;
|
||||||
|
|
||||||
list_for_each_entry(kp, &kdb_cmds_head, list_node) {
|
list_for_each_entry(kp, &kdb_cmds_head, list_node) {
|
||||||
if (kp->cmd_func == kdb_exec_defcmd) {
|
if (kp->func == kdb_exec_defcmd) {
|
||||||
kdb_printf("defcmd %s \"%s\" \"%s\"\n",
|
kdb_printf("defcmd %s \"%s\" \"%s\"\n",
|
||||||
kp->cmd_name, kp->cmd_usage,
|
kp->name, kp->usage, kp->help);
|
||||||
kp->cmd_help);
|
|
||||||
kmp = container_of(kp, struct kdb_macro, cmd);
|
kmp = container_of(kp, struct kdb_macro, cmd);
|
||||||
list_for_each_entry(kms, &kmp->statements,
|
list_for_each_entry(kms, &kmp->statements,
|
||||||
list_node)
|
list_node)
|
||||||
@ -735,34 +734,34 @@ static int kdb_defcmd(int argc, const char **argv)
|
|||||||
goto fail_defcmd;
|
goto fail_defcmd;
|
||||||
|
|
||||||
mp = &kdb_macro->cmd;
|
mp = &kdb_macro->cmd;
|
||||||
mp->cmd_func = kdb_exec_defcmd;
|
mp->func = kdb_exec_defcmd;
|
||||||
mp->cmd_minlen = 0;
|
mp->minlen = 0;
|
||||||
mp->cmd_flags = KDB_ENABLE_ALWAYS_SAFE;
|
mp->flags = KDB_ENABLE_ALWAYS_SAFE;
|
||||||
mp->cmd_name = kdb_strdup(argv[1], GFP_KDB);
|
mp->name = kdb_strdup(argv[1], GFP_KDB);
|
||||||
if (!mp->cmd_name)
|
if (!mp->name)
|
||||||
goto fail_name;
|
goto fail_name;
|
||||||
mp->cmd_usage = kdb_strdup(argv[2], GFP_KDB);
|
mp->usage = kdb_strdup(argv[2], GFP_KDB);
|
||||||
if (!mp->cmd_usage)
|
if (!mp->usage)
|
||||||
goto fail_usage;
|
goto fail_usage;
|
||||||
mp->cmd_help = kdb_strdup(argv[3], GFP_KDB);
|
mp->help = kdb_strdup(argv[3], GFP_KDB);
|
||||||
if (!mp->cmd_help)
|
if (!mp->help)
|
||||||
goto fail_help;
|
goto fail_help;
|
||||||
if (mp->cmd_usage[0] == '"') {
|
if (mp->usage[0] == '"') {
|
||||||
strcpy(mp->cmd_usage, argv[2]+1);
|
strcpy(mp->usage, argv[2]+1);
|
||||||
mp->cmd_usage[strlen(mp->cmd_usage)-1] = '\0';
|
mp->usage[strlen(mp->usage)-1] = '\0';
|
||||||
}
|
}
|
||||||
if (mp->cmd_help[0] == '"') {
|
if (mp->help[0] == '"') {
|
||||||
strcpy(mp->cmd_help, argv[3]+1);
|
strcpy(mp->help, argv[3]+1);
|
||||||
mp->cmd_help[strlen(mp->cmd_help)-1] = '\0';
|
mp->help[strlen(mp->help)-1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_LIST_HEAD(&kdb_macro->statements);
|
INIT_LIST_HEAD(&kdb_macro->statements);
|
||||||
defcmd_in_progress = true;
|
defcmd_in_progress = true;
|
||||||
return 0;
|
return 0;
|
||||||
fail_help:
|
fail_help:
|
||||||
kfree(mp->cmd_usage);
|
kfree(mp->usage);
|
||||||
fail_usage:
|
fail_usage:
|
||||||
kfree(mp->cmd_name);
|
kfree(mp->name);
|
||||||
fail_name:
|
fail_name:
|
||||||
kfree(kdb_macro);
|
kfree(kdb_macro);
|
||||||
fail_defcmd:
|
fail_defcmd:
|
||||||
@ -790,7 +789,7 @@ static int kdb_exec_defcmd(int argc, const char **argv)
|
|||||||
return KDB_ARGCOUNT;
|
return KDB_ARGCOUNT;
|
||||||
|
|
||||||
list_for_each_entry(kp, &kdb_cmds_head, list_node) {
|
list_for_each_entry(kp, &kdb_cmds_head, list_node) {
|
||||||
if (strcmp(kp->cmd_name, argv[0]) == 0)
|
if (strcmp(kp->name, argv[0]) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (list_entry_is_head(kp, &kdb_cmds_head, list_node)) {
|
if (list_entry_is_head(kp, &kdb_cmds_head, list_node)) {
|
||||||
@ -804,7 +803,7 @@ static int kdb_exec_defcmd(int argc, const char **argv)
|
|||||||
* Recursive use of kdb_parse, do not use argv after this point.
|
* Recursive use of kdb_parse, do not use argv after this point.
|
||||||
*/
|
*/
|
||||||
argv = NULL;
|
argv = NULL;
|
||||||
kdb_printf("[%s]kdb> %s\n", kmp->cmd.cmd_name, kms->statement);
|
kdb_printf("[%s]kdb> %s\n", kmp->cmd.name, kms->statement);
|
||||||
ret = kdb_parse(kms->statement);
|
ret = kdb_parse(kms->statement);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@ -1016,11 +1015,11 @@ int kdb_parse(const char *cmdstr)
|
|||||||
* If this command is allowed to be abbreviated,
|
* If this command is allowed to be abbreviated,
|
||||||
* check to see if this is it.
|
* check to see if this is it.
|
||||||
*/
|
*/
|
||||||
if (tp->cmd_minlen && (strlen(argv[0]) <= tp->cmd_minlen) &&
|
if (tp->minlen && (strlen(argv[0]) <= tp->minlen) &&
|
||||||
(strncmp(argv[0], tp->cmd_name, tp->cmd_minlen) == 0))
|
(strncmp(argv[0], tp->name, tp->minlen) == 0))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (strcmp(argv[0], tp->cmd_name) == 0)
|
if (strcmp(argv[0], tp->name) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1031,8 +1030,7 @@ int kdb_parse(const char *cmdstr)
|
|||||||
*/
|
*/
|
||||||
if (list_entry_is_head(tp, &kdb_cmds_head, list_node)) {
|
if (list_entry_is_head(tp, &kdb_cmds_head, list_node)) {
|
||||||
list_for_each_entry(tp, &kdb_cmds_head, list_node) {
|
list_for_each_entry(tp, &kdb_cmds_head, list_node) {
|
||||||
if (strncmp(argv[0], tp->cmd_name,
|
if (strncmp(argv[0], tp->name, strlen(tp->name)) == 0)
|
||||||
strlen(tp->cmd_name)) == 0)
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1040,19 +1038,19 @@ int kdb_parse(const char *cmdstr)
|
|||||||
if (!list_entry_is_head(tp, &kdb_cmds_head, list_node)) {
|
if (!list_entry_is_head(tp, &kdb_cmds_head, list_node)) {
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (!kdb_check_flags(tp->cmd_flags, kdb_cmd_enabled, argc <= 1))
|
if (!kdb_check_flags(tp->flags, kdb_cmd_enabled, argc <= 1))
|
||||||
return KDB_NOPERM;
|
return KDB_NOPERM;
|
||||||
|
|
||||||
KDB_STATE_SET(CMD);
|
KDB_STATE_SET(CMD);
|
||||||
result = (*tp->cmd_func)(argc-1, (const char **)argv);
|
result = (*tp->func)(argc-1, (const char **)argv);
|
||||||
if (result && ignore_errors && result > KDB_CMD_GO)
|
if (result && ignore_errors && result > KDB_CMD_GO)
|
||||||
result = 0;
|
result = 0;
|
||||||
KDB_STATE_CLEAR(CMD);
|
KDB_STATE_CLEAR(CMD);
|
||||||
|
|
||||||
if (tp->cmd_flags & KDB_REPEAT_WITH_ARGS)
|
if (tp->flags & KDB_REPEAT_WITH_ARGS)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
argc = tp->cmd_flags & KDB_REPEAT_NO_ARGS ? 1 : 0;
|
argc = tp->flags & KDB_REPEAT_NO_ARGS ? 1 : 0;
|
||||||
if (argv[argc])
|
if (argv[argc])
|
||||||
*(argv[argc]) = '\0';
|
*(argv[argc]) = '\0';
|
||||||
return result;
|
return result;
|
||||||
@ -2419,12 +2417,12 @@ static int kdb_help(int argc, const char **argv)
|
|||||||
char *space = "";
|
char *space = "";
|
||||||
if (KDB_FLAG(CMD_INTERRUPT))
|
if (KDB_FLAG(CMD_INTERRUPT))
|
||||||
return 0;
|
return 0;
|
||||||
if (!kdb_check_flags(kt->cmd_flags, kdb_cmd_enabled, true))
|
if (!kdb_check_flags(kt->flags, kdb_cmd_enabled, true))
|
||||||
continue;
|
continue;
|
||||||
if (strlen(kt->cmd_usage) > 20)
|
if (strlen(kt->usage) > 20)
|
||||||
space = "\n ";
|
space = "\n ";
|
||||||
kdb_printf("%-15.15s %-20s%s%s\n", kt->cmd_name,
|
kdb_printf("%-15.15s %-20s%s%s\n", kt->name,
|
||||||
kt->cmd_usage, space, kt->cmd_help);
|
kt->usage, space, kt->help);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2633,9 +2631,9 @@ int kdb_register(kdbtab_t *cmd)
|
|||||||
kdbtab_t *kp;
|
kdbtab_t *kp;
|
||||||
|
|
||||||
list_for_each_entry(kp, &kdb_cmds_head, list_node) {
|
list_for_each_entry(kp, &kdb_cmds_head, list_node) {
|
||||||
if (strcmp(kp->cmd_name, cmd->cmd_name) == 0) {
|
if (strcmp(kp->name, cmd->name) == 0) {
|
||||||
kdb_printf("Duplicate kdb cmd: %s, func %p help %s\n",
|
kdb_printf("Duplicate kdb cmd: %s, func %p help %s\n",
|
||||||
cmd->cmd_name, cmd->cmd_func, cmd->cmd_help);
|
cmd->name, cmd->func, cmd->help);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2672,218 +2670,218 @@ void kdb_unregister(kdbtab_t *cmd)
|
|||||||
EXPORT_SYMBOL_GPL(kdb_unregister);
|
EXPORT_SYMBOL_GPL(kdb_unregister);
|
||||||
|
|
||||||
static kdbtab_t maintab[] = {
|
static kdbtab_t maintab[] = {
|
||||||
{ .cmd_name = "md",
|
{ .name = "md",
|
||||||
.cmd_func = kdb_md,
|
.func = kdb_md,
|
||||||
.cmd_usage = "<vaddr>",
|
.usage = "<vaddr>",
|
||||||
.cmd_help = "Display Memory Contents, also mdWcN, e.g. md8c1",
|
.help = "Display Memory Contents, also mdWcN, e.g. md8c1",
|
||||||
.cmd_minlen = 1,
|
.minlen = 1,
|
||||||
.cmd_flags = KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "mdr",
|
{ .name = "mdr",
|
||||||
.cmd_func = kdb_md,
|
.func = kdb_md,
|
||||||
.cmd_usage = "<vaddr> <bytes>",
|
.usage = "<vaddr> <bytes>",
|
||||||
.cmd_help = "Display Raw Memory",
|
.help = "Display Raw Memory",
|
||||||
.cmd_flags = KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "mdp",
|
{ .name = "mdp",
|
||||||
.cmd_func = kdb_md,
|
.func = kdb_md,
|
||||||
.cmd_usage = "<paddr> <bytes>",
|
.usage = "<paddr> <bytes>",
|
||||||
.cmd_help = "Display Physical Memory",
|
.help = "Display Physical Memory",
|
||||||
.cmd_flags = KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "mds",
|
{ .name = "mds",
|
||||||
.cmd_func = kdb_md,
|
.func = kdb_md,
|
||||||
.cmd_usage = "<vaddr>",
|
.usage = "<vaddr>",
|
||||||
.cmd_help = "Display Memory Symbolically",
|
.help = "Display Memory Symbolically",
|
||||||
.cmd_flags = KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "mm",
|
{ .name = "mm",
|
||||||
.cmd_func = kdb_mm,
|
.func = kdb_mm,
|
||||||
.cmd_usage = "<vaddr> <contents>",
|
.usage = "<vaddr> <contents>",
|
||||||
.cmd_help = "Modify Memory Contents",
|
.help = "Modify Memory Contents",
|
||||||
.cmd_flags = KDB_ENABLE_MEM_WRITE | KDB_REPEAT_NO_ARGS,
|
.flags = KDB_ENABLE_MEM_WRITE | KDB_REPEAT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "go",
|
{ .name = "go",
|
||||||
.cmd_func = kdb_go,
|
.func = kdb_go,
|
||||||
.cmd_usage = "[<vaddr>]",
|
.usage = "[<vaddr>]",
|
||||||
.cmd_help = "Continue Execution",
|
.help = "Continue Execution",
|
||||||
.cmd_minlen = 1,
|
.minlen = 1,
|
||||||
.cmd_flags = KDB_ENABLE_REG_WRITE |
|
.flags = KDB_ENABLE_REG_WRITE |
|
||||||
KDB_ENABLE_ALWAYS_SAFE_NO_ARGS,
|
KDB_ENABLE_ALWAYS_SAFE_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "rd",
|
{ .name = "rd",
|
||||||
.cmd_func = kdb_rd,
|
.func = kdb_rd,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Display Registers",
|
.help = "Display Registers",
|
||||||
.cmd_flags = KDB_ENABLE_REG_READ,
|
.flags = KDB_ENABLE_REG_READ,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "rm",
|
{ .name = "rm",
|
||||||
.cmd_func = kdb_rm,
|
.func = kdb_rm,
|
||||||
.cmd_usage = "<reg> <contents>",
|
.usage = "<reg> <contents>",
|
||||||
.cmd_help = "Modify Registers",
|
.help = "Modify Registers",
|
||||||
.cmd_flags = KDB_ENABLE_REG_WRITE,
|
.flags = KDB_ENABLE_REG_WRITE,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "ef",
|
{ .name = "ef",
|
||||||
.cmd_func = kdb_ef,
|
.func = kdb_ef,
|
||||||
.cmd_usage = "<vaddr>",
|
.usage = "<vaddr>",
|
||||||
.cmd_help = "Display exception frame",
|
.help = "Display exception frame",
|
||||||
.cmd_flags = KDB_ENABLE_MEM_READ,
|
.flags = KDB_ENABLE_MEM_READ,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "bt",
|
{ .name = "bt",
|
||||||
.cmd_func = kdb_bt,
|
.func = kdb_bt,
|
||||||
.cmd_usage = "[<vaddr>]",
|
.usage = "[<vaddr>]",
|
||||||
.cmd_help = "Stack traceback",
|
.help = "Stack traceback",
|
||||||
.cmd_minlen = 1,
|
.minlen = 1,
|
||||||
.cmd_flags = KDB_ENABLE_MEM_READ | KDB_ENABLE_INSPECT_NO_ARGS,
|
.flags = KDB_ENABLE_MEM_READ | KDB_ENABLE_INSPECT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "btp",
|
{ .name = "btp",
|
||||||
.cmd_func = kdb_bt,
|
.func = kdb_bt,
|
||||||
.cmd_usage = "<pid>",
|
.usage = "<pid>",
|
||||||
.cmd_help = "Display stack for process <pid>",
|
.help = "Display stack for process <pid>",
|
||||||
.cmd_flags = KDB_ENABLE_INSPECT,
|
.flags = KDB_ENABLE_INSPECT,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "bta",
|
{ .name = "bta",
|
||||||
.cmd_func = kdb_bt,
|
.func = kdb_bt,
|
||||||
.cmd_usage = "[D|R|S|T|C|Z|E|U|I|M|A]",
|
.usage = "[D|R|S|T|C|Z|E|U|I|M|A]",
|
||||||
.cmd_help = "Backtrace all processes matching state flag",
|
.help = "Backtrace all processes matching state flag",
|
||||||
.cmd_flags = KDB_ENABLE_INSPECT,
|
.flags = KDB_ENABLE_INSPECT,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "btc",
|
{ .name = "btc",
|
||||||
.cmd_func = kdb_bt,
|
.func = kdb_bt,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Backtrace current process on each cpu",
|
.help = "Backtrace current process on each cpu",
|
||||||
.cmd_flags = KDB_ENABLE_INSPECT,
|
.flags = KDB_ENABLE_INSPECT,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "btt",
|
{ .name = "btt",
|
||||||
.cmd_func = kdb_bt,
|
.func = kdb_bt,
|
||||||
.cmd_usage = "<vaddr>",
|
.usage = "<vaddr>",
|
||||||
.cmd_help = "Backtrace process given its struct task address",
|
.help = "Backtrace process given its struct task address",
|
||||||
.cmd_flags = KDB_ENABLE_MEM_READ | KDB_ENABLE_INSPECT_NO_ARGS,
|
.flags = KDB_ENABLE_MEM_READ | KDB_ENABLE_INSPECT_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "env",
|
{ .name = "env",
|
||||||
.cmd_func = kdb_env,
|
.func = kdb_env,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Show environment variables",
|
.help = "Show environment variables",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "set",
|
{ .name = "set",
|
||||||
.cmd_func = kdb_set,
|
.func = kdb_set,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Set environment variables",
|
.help = "Set environment variables",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "help",
|
{ .name = "help",
|
||||||
.cmd_func = kdb_help,
|
.func = kdb_help,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Display Help Message",
|
.help = "Display Help Message",
|
||||||
.cmd_minlen = 1,
|
.minlen = 1,
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "?",
|
{ .name = "?",
|
||||||
.cmd_func = kdb_help,
|
.func = kdb_help,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Display Help Message",
|
.help = "Display Help Message",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "cpu",
|
{ .name = "cpu",
|
||||||
.cmd_func = kdb_cpu,
|
.func = kdb_cpu,
|
||||||
.cmd_usage = "<cpunum>",
|
.usage = "<cpunum>",
|
||||||
.cmd_help = "Switch to new cpu",
|
.help = "Switch to new cpu",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE_NO_ARGS,
|
.flags = KDB_ENABLE_ALWAYS_SAFE_NO_ARGS,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "kgdb",
|
{ .name = "kgdb",
|
||||||
.cmd_func = kdb_kgdb,
|
.func = kdb_kgdb,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Enter kgdb mode",
|
.help = "Enter kgdb mode",
|
||||||
.cmd_flags = 0,
|
.flags = 0,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "ps",
|
{ .name = "ps",
|
||||||
.cmd_func = kdb_ps,
|
.func = kdb_ps,
|
||||||
.cmd_usage = "[<flags>|A]",
|
.usage = "[<flags>|A]",
|
||||||
.cmd_help = "Display active task list",
|
.help = "Display active task list",
|
||||||
.cmd_flags = KDB_ENABLE_INSPECT,
|
.flags = KDB_ENABLE_INSPECT,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "pid",
|
{ .name = "pid",
|
||||||
.cmd_func = kdb_pid,
|
.func = kdb_pid,
|
||||||
.cmd_usage = "<pidnum>",
|
.usage = "<pidnum>",
|
||||||
.cmd_help = "Switch to another task",
|
.help = "Switch to another task",
|
||||||
.cmd_flags = KDB_ENABLE_INSPECT,
|
.flags = KDB_ENABLE_INSPECT,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "reboot",
|
{ .name = "reboot",
|
||||||
.cmd_func = kdb_reboot,
|
.func = kdb_reboot,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Reboot the machine immediately",
|
.help = "Reboot the machine immediately",
|
||||||
.cmd_flags = KDB_ENABLE_REBOOT,
|
.flags = KDB_ENABLE_REBOOT,
|
||||||
},
|
},
|
||||||
#if defined(CONFIG_MODULES)
|
#if defined(CONFIG_MODULES)
|
||||||
{ .cmd_name = "lsmod",
|
{ .name = "lsmod",
|
||||||
.cmd_func = kdb_lsmod,
|
.func = kdb_lsmod,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "List loaded kernel modules",
|
.help = "List loaded kernel modules",
|
||||||
.cmd_flags = KDB_ENABLE_INSPECT,
|
.flags = KDB_ENABLE_INSPECT,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_MAGIC_SYSRQ)
|
#if defined(CONFIG_MAGIC_SYSRQ)
|
||||||
{ .cmd_name = "sr",
|
{ .name = "sr",
|
||||||
.cmd_func = kdb_sr,
|
.func = kdb_sr,
|
||||||
.cmd_usage = "<key>",
|
.usage = "<key>",
|
||||||
.cmd_help = "Magic SysRq key",
|
.help = "Magic SysRq key",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_PRINTK)
|
#if defined(CONFIG_PRINTK)
|
||||||
{ .cmd_name = "dmesg",
|
{ .name = "dmesg",
|
||||||
.cmd_func = kdb_dmesg,
|
.func = kdb_dmesg,
|
||||||
.cmd_usage = "[lines]",
|
.usage = "[lines]",
|
||||||
.cmd_help = "Display syslog buffer",
|
.help = "Display syslog buffer",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
{ .cmd_name = "defcmd",
|
{ .name = "defcmd",
|
||||||
.cmd_func = kdb_defcmd,
|
.func = kdb_defcmd,
|
||||||
.cmd_usage = "name \"usage\" \"help\"",
|
.usage = "name \"usage\" \"help\"",
|
||||||
.cmd_help = "Define a set of commands, down to endefcmd",
|
.help = "Define a set of commands, down to endefcmd",
|
||||||
/*
|
/*
|
||||||
* Macros are always safe because when executed each
|
* Macros are always safe because when executed each
|
||||||
* internal command re-enters kdb_parse() and is safety
|
* internal command re-enters kdb_parse() and is safety
|
||||||
* checked individually.
|
* checked individually.
|
||||||
*/
|
*/
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "kill",
|
{ .name = "kill",
|
||||||
.cmd_func = kdb_kill,
|
.func = kdb_kill,
|
||||||
.cmd_usage = "<-signal> <pid>",
|
.usage = "<-signal> <pid>",
|
||||||
.cmd_help = "Send a signal to a process",
|
.help = "Send a signal to a process",
|
||||||
.cmd_flags = KDB_ENABLE_SIGNAL,
|
.flags = KDB_ENABLE_SIGNAL,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "summary",
|
{ .name = "summary",
|
||||||
.cmd_func = kdb_summary,
|
.func = kdb_summary,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Summarize the system",
|
.help = "Summarize the system",
|
||||||
.cmd_minlen = 4,
|
.minlen = 4,
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "per_cpu",
|
{ .name = "per_cpu",
|
||||||
.cmd_func = kdb_per_cpu,
|
.func = kdb_per_cpu,
|
||||||
.cmd_usage = "<sym> [<bytes>] [<cpu>]",
|
.usage = "<sym> [<bytes>] [<cpu>]",
|
||||||
.cmd_help = "Display per_cpu variables",
|
.help = "Display per_cpu variables",
|
||||||
.cmd_minlen = 3,
|
.minlen = 3,
|
||||||
.cmd_flags = KDB_ENABLE_MEM_READ,
|
.flags = KDB_ENABLE_MEM_READ,
|
||||||
},
|
},
|
||||||
{ .cmd_name = "grephelp",
|
{ .name = "grephelp",
|
||||||
.cmd_func = kdb_grep_help,
|
.func = kdb_grep_help,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Display help on | grep",
|
.help = "Display help on | grep",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static kdbtab_t nmicmd = {
|
static kdbtab_t nmicmd = {
|
||||||
.cmd_name = "disable_nmi",
|
.name = "disable_nmi",
|
||||||
.cmd_func = kdb_disable_nmi,
|
.func = kdb_disable_nmi,
|
||||||
.cmd_usage = "",
|
.usage = "",
|
||||||
.cmd_help = "Disable NMI entry to KDB",
|
.help = "Disable NMI entry to KDB",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Initialize the kdb command table. */
|
/* Initialize the kdb command table. */
|
||||||
|
@ -148,11 +148,11 @@ static int kdb_ftdump(int argc, const char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static kdbtab_t ftdump_cmd = {
|
static kdbtab_t ftdump_cmd = {
|
||||||
.cmd_name = "ftdump",
|
.name = "ftdump",
|
||||||
.cmd_func = kdb_ftdump,
|
.func = kdb_ftdump,
|
||||||
.cmd_usage = "[skip_#entries] [cpu]",
|
.usage = "[skip_#entries] [cpu]",
|
||||||
.cmd_help = "Dump ftrace log; -skip dumps last #entries",
|
.help = "Dump ftrace log; -skip dumps last #entries",
|
||||||
.cmd_flags = KDB_ENABLE_ALWAYS_SAFE,
|
.flags = KDB_ENABLE_ALWAYS_SAFE,
|
||||||
};
|
};
|
||||||
|
|
||||||
static __init int kdb_ftrace_register(void)
|
static __init int kdb_ftrace_register(void)
|
||||||
|
@ -29,10 +29,10 @@ static int kdb_hello_cmd(int argc, const char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static kdbtab_t hello_cmd = {
|
static kdbtab_t hello_cmd = {
|
||||||
.cmd_name = "hello",
|
.name = "hello",
|
||||||
.cmd_func = kdb_hello_cmd,
|
.func = kdb_hello_cmd,
|
||||||
.cmd_usage = "[string]",
|
.usage = "[string]",
|
||||||
.cmd_help = "Say Hello World or Hello [string]",
|
.help = "Say Hello World or Hello [string]",
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init kdb_hello_cmd_init(void)
|
static int __init kdb_hello_cmd_init(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user