| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: db_command.c,v 1.171 2020/10/30 06:57:08 skrll Exp $ */ | | 1 | /* $NetBSD: db_command.c,v 1.172 2020/10/30 07:03:50 skrll Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009, 2019 | | 4 | * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009, 2019 |
5 | * The NetBSD Foundation, Inc. | | 5 | * The NetBSD Foundation, Inc. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * This code is derived from software contributed to The NetBSD Foundation | | 8 | * This code is derived from software contributed to The NetBSD Foundation |
9 | * by Adam Hamsik, and by Andrew Doran. | | 9 | * by Adam Hamsik, and by Andrew Doran. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -51,27 +51,27 @@ | | | @@ -51,27 +51,27 @@ |
51 | * School of Computer Science | | 51 | * School of Computer Science |
52 | * Carnegie Mellon University | | 52 | * Carnegie Mellon University |
53 | * Pittsburgh PA 15213-3890 | | 53 | * Pittsburgh PA 15213-3890 |
54 | * | | 54 | * |
55 | * any improvements or extensions that they make and grant Carnegie the | | 55 | * any improvements or extensions that they make and grant Carnegie the |
56 | * rights to redistribute these changes. | | 56 | * rights to redistribute these changes. |
57 | */ | | 57 | */ |
58 | | | 58 | |
59 | /* | | 59 | /* |
60 | * Command dispatcher. | | 60 | * Command dispatcher. |
61 | */ | | 61 | */ |
62 | | | 62 | |
63 | #include <sys/cdefs.h> | | 63 | #include <sys/cdefs.h> |
64 | __KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.171 2020/10/30 06:57:08 skrll Exp $"); | | 64 | __KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.172 2020/10/30 07:03:50 skrll Exp $"); |
65 | | | 65 | |
66 | #ifdef _KERNEL_OPT | | 66 | #ifdef _KERNEL_OPT |
67 | #include "opt_aio.h" | | 67 | #include "opt_aio.h" |
68 | #include "opt_ddb.h" | | 68 | #include "opt_ddb.h" |
69 | #include "opt_kgdb.h" | | 69 | #include "opt_kgdb.h" |
70 | #include "opt_mqueue.h" | | 70 | #include "opt_mqueue.h" |
71 | #include "opt_inet.h" | | 71 | #include "opt_inet.h" |
72 | #include "opt_kernhist.h" | | 72 | #include "opt_kernhist.h" |
73 | #include "opt_ddbparam.h" | | 73 | #include "opt_ddbparam.h" |
74 | #include "opt_multiprocessor.h" | | 74 | #include "opt_multiprocessor.h" |
75 | #endif | | 75 | #endif |
76 | | | 76 | |
77 | #include <sys/param.h> | | 77 | #include <sys/param.h> |
| @@ -211,45 +211,47 @@ static void db_socket_print_cmd(db_expr_ | | | @@ -211,45 +211,47 @@ static void db_socket_print_cmd(db_expr_ |
211 | static void db_stack_trace_cmd(db_expr_t, bool, db_expr_t, const char *); | | 211 | static void db_stack_trace_cmd(db_expr_t, bool, db_expr_t, const char *); |
212 | static void db_sync_cmd(db_expr_t, bool, db_expr_t, const char *); | | 212 | static void db_sync_cmd(db_expr_t, bool, db_expr_t, const char *); |
213 | static void db_whatis_cmd(db_expr_t, bool, db_expr_t, const char *); | | 213 | static void db_whatis_cmd(db_expr_t, bool, db_expr_t, const char *); |
214 | static void db_uvmexp_print_cmd(db_expr_t, bool, db_expr_t, const char *); | | 214 | static void db_uvmexp_print_cmd(db_expr_t, bool, db_expr_t, const char *); |
215 | #ifdef KERNHIST | | 215 | #ifdef KERNHIST |
216 | static void db_kernhist_print_cmd(db_expr_t, bool, db_expr_t, const char *); | | 216 | static void db_kernhist_print_cmd(db_expr_t, bool, db_expr_t, const char *); |
217 | #endif | | 217 | #endif |
218 | static void db_vnode_print_cmd(db_expr_t, bool, db_expr_t, const char *); | | 218 | static void db_vnode_print_cmd(db_expr_t, bool, db_expr_t, const char *); |
219 | static void db_vnode_lock_print_cmd(db_expr_t, bool, db_expr_t, | | 219 | static void db_vnode_lock_print_cmd(db_expr_t, bool, db_expr_t, |
220 | const char *); | | 220 | const char *); |
221 | static void db_vmem_print_cmd(db_expr_t, bool, db_expr_t, const char *); | | 221 | static void db_vmem_print_cmd(db_expr_t, bool, db_expr_t, const char *); |
222 | | | 222 | |
223 | static const struct db_command db_show_cmds[] = { | | 223 | static const struct db_command db_show_cmds[] = { |
224 | /*added from all sub cmds*/ | | 224 | /* added from all sub cmds */ |
225 | { DDB_ADD_CMD("callout", db_show_callout, | | 225 | { DDB_ADD_CMD("callout", db_show_callout, |
226 | 0 ,"List all used callout functions.",NULL,NULL) }, | | 226 | 0 ,"List all used callout functions.",NULL,NULL) }, |
| | | 227 | /* added from all sub cmds */ |
227 | { DDB_ADD_CMD("pages", db_show_all_pages, | | 228 | { DDB_ADD_CMD("pages", db_show_all_pages, |
228 | 0 ,"List all used memory pages.",NULL,NULL) }, | | 229 | 0 ,"List all used memory pages.",NULL,NULL) }, |
229 | { DDB_ADD_CMD("proc", db_show_proc, | | 230 | { DDB_ADD_CMD("proc", db_show_proc, |
230 | 0 ,"Print process information.",NULL,NULL) }, | | 231 | 0 ,"Print process information.",NULL,NULL) }, |
| | | 232 | /* added from all sub cmds */ |
231 | { DDB_ADD_CMD("procs", db_show_all_procs, | | 233 | { DDB_ADD_CMD("procs", db_show_all_procs, |
232 | 0 ,"List all processes.",NULL,NULL) }, | | 234 | 0 ,"List all processes.",NULL,NULL) }, |
| | | 235 | /* added from all sub cmds */ |
233 | { DDB_ADD_CMD("pools", db_show_all_pools, | | 236 | { DDB_ADD_CMD("pools", db_show_all_pools, |
234 | 0 ,"Show all pools",NULL,NULL) }, | | 237 | 0 ,"Show all pools",NULL,NULL) }, |
235 | { DDB_ADD_CMD("locks", db_show_all_locks, | | 238 | { DDB_ADD_CMD("locks", db_show_all_locks, |
236 | 0 ,"Show all held locks", "[/t]", NULL) }, | | 239 | 0 ,"Show all held locks", "[/t]", NULL) }, |
237 | { DDB_ADD_CMD("mount", db_show_all_mount, 0, | | 240 | { DDB_ADD_CMD("mount", db_show_all_mount, 0, |
238 | "Print all mount structures.", "[/f]", NULL) }, | | 241 | "Print all mount structures.", "[/f]", NULL) }, |
239 | { DDB_ADD_CMD("freelists", db_show_all_freelists, | | 242 | { DDB_ADD_CMD("freelists", db_show_all_freelists, |
240 | 0 ,"Show all freelists", NULL, NULL) }, | | 243 | 0 ,"Show all freelists", NULL, NULL) }, |
241 | #ifdef AIO | | 244 | #ifdef AIO |
242 | /*added from all sub cmds*/ | | | |
243 | { DDB_ADD_CMD("aio_jobs", db_show_aio_jobs, 0, | | 245 | { DDB_ADD_CMD("aio_jobs", db_show_aio_jobs, 0, |
244 | "Show aio jobs",NULL,NULL) }, | | 246 | "Show aio jobs",NULL,NULL) }, |
245 | #endif | | 247 | #endif |
246 | { DDB_ADD_CMD("all", NULL, | | 248 | { DDB_ADD_CMD("all", NULL, |
247 | CS_COMPAT, NULL,NULL,NULL) }, | | 249 | CS_COMPAT, NULL,NULL,NULL) }, |
248 | #if defined(INET) | | 250 | #if defined(INET) |
249 | { DDB_ADD_CMD("routes", db_show_routes, 0,NULL,NULL,NULL) }, | | 251 | { DDB_ADD_CMD("routes", db_show_routes, 0,NULL,NULL,NULL) }, |
250 | #endif | | 252 | #endif |
251 | #ifdef _KERNEL | | 253 | #ifdef _KERNEL |
252 | { DDB_ADD_CMD("breaks", db_listbreak_cmd, 0, | | 254 | { DDB_ADD_CMD("breaks", db_listbreak_cmd, 0, |
253 | "Display all breaks.",NULL,NULL) }, | | 255 | "Display all breaks.",NULL,NULL) }, |
254 | #endif | | 256 | #endif |
255 | { DDB_ADD_CMD("buf", db_buf_print_cmd, 0, | | 257 | { DDB_ADD_CMD("buf", db_buf_print_cmd, 0, |