summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2002-01-02 22:22:04 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2002-01-02 22:22:04 +0000
commit0e27c9b9c4315a03de0692896112b5a700e52439 (patch)
tree22639e1dc81842b3dad24318a68a1ebad5a97817
parent8a40a040b12586e355e4687df3a8753f5603fbb9 (diff)
Add more vocabulary (commands) to ddb, from NetBSD.
ok art@ (manual page update coming soon)
-rw-r--r--sys/ddb/db_command.c54
-rw-r--r--sys/ddb/db_command.h5
-rw-r--r--sys/uvm/uvm_ddb.h4
-rw-r--r--sys/uvm/uvm_stat.c4
4 files changed, 56 insertions, 11 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 3f88d110a24..38b1f27105f 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.c,v 1.24 2001/11/28 16:13:29 art Exp $ */
+/* $OpenBSD: db_command.c,v 1.25 2002/01/02 22:22:00 miod Exp $ */
/* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */
/*
@@ -35,6 +35,7 @@
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/extent.h>
+#include <sys/pool.h>
#include <uvm/uvm_extern.h>
#include <machine/db_machdep.h> /* type definitions */
@@ -330,6 +331,22 @@ db_object_print_cmd(addr, have_addr, count, modif)
/*ARGSUSED*/
void
+db_page_print_cmd(addr, have_addr, count, modif)
+ db_expr_t addr;
+ int have_addr;
+ db_expr_t count;
+ char * modif;
+{
+ boolean_t full = FALSE;
+
+ if (modif[0] == 'f')
+ full = TRUE;
+
+ uvm_page_printit((struct vm_page *) addr, full, db_printf);
+}
+
+/*ARGSUSED*/
+void
db_extent_print_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
@@ -339,6 +356,28 @@ db_extent_print_cmd(addr, have_addr, count, modif)
extent_print_all();
}
+/*ARGSUSED*/
+void
+db_pool_print_cmd(addr, have_addr, count, modif)
+ db_expr_t addr;
+ int have_addr;
+ db_expr_t count;
+ char * modif;
+{
+ pool_printit((struct pool *)addr, modif, db_printf);
+}
+
+/*ARGSUSED*/
+void
+db_uvmexp_print_cmd(addr, have_addr, count, modif)
+ db_expr_t addr;
+ int have_addr;
+ db_expr_t count;
+ char * modif;
+{
+ uvmexp_print(db_printf);
+}
+
/*
* 'show' commands
*/
@@ -351,14 +390,17 @@ struct db_command db_show_all_cmds[] = {
struct db_command db_show_cmds[] = {
{ "all", NULL, 0, db_show_all_cmds },
- { "registers", db_show_regs, 0, NULL },
{ "breaks", db_listbreak_cmd, 0, NULL },
- { "watches", db_listwatch_cmd, 0, NULL },
- { "map", db_map_print_cmd, 0, NULL },
- { "object", db_object_print_cmd, 0, NULL },
{ "extents", db_extent_print_cmd, 0, NULL },
{ "malloc", db_malloc_print_cmd, 0, NULL },
- { NULL, NULL, 0, NULL, }
+ { "map", db_map_print_cmd, 0, NULL },
+ { "object", db_object_print_cmd, 0, NULL },
+ { "page", db_page_print_cmd, 0, NULL },
+ { "pool", db_pool_print_cmd, 0, NULL },
+ { "registers", db_show_regs, 0, NULL },
+ { "uvmexp", db_uvmexp_print_cmd, 0, NULL },
+ { "watches", db_listwatch_cmd, 0, NULL },
+ { NULL, NULL, 0, NULL }
};
struct db_command db_boot_cmds[] = {
diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h
index 7a75b833032..fc81cb0e4a0 100644
--- a/sys/ddb/db_command.h
+++ b/sys/ddb/db_command.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.h,v 1.11 2001/04/18 23:17:25 art Exp $ */
+/* $OpenBSD: db_command.h,v 1.12 2002/01/02 22:22:00 miod Exp $ */
/* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */
/*
@@ -41,7 +41,10 @@ void db_command __P((struct db_command **, struct db_command *));
void db_map_print_cmd __P((db_expr_t, int, db_expr_t, char *));
void db_malloc_print_cmd __P((db_expr_t, int, db_expr_t, char *));
void db_object_print_cmd __P((db_expr_t, int, db_expr_t, char *));
+void db_page_print_cmd __P((db_expr_t, int, db_expr_t, char *));
void db_extent_print_cmd __P((db_expr_t, int, db_expr_t, char *));
+void db_pool_print_cmd __P((db_expr_t, int, db_expr_t, char *));
+void db_uvmexp_print_cmd __P((db_expr_t, int, db_expr_t, char *));
void db_machine_commands_install __P((struct db_command *));
void db_help_cmd __P((db_expr_t, int, db_expr_t, char *));
void db_command_loop __P((void));
diff --git a/sys/uvm/uvm_ddb.h b/sys/uvm/uvm_ddb.h
index 469b381a6df..727a22b60fc 100644
--- a/sys/uvm/uvm_ddb.h
+++ b/sys/uvm/uvm_ddb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_ddb.h,v 1.9 2001/12/19 08:58:07 art Exp $ */
+/* $OpenBSD: uvm_ddb.h,v 1.10 2002/01/02 22:22:03 miod Exp $ */
/* $NetBSD: uvm_ddb.h,v 1.5 2000/11/25 06:27:59 chs Exp $ */
/*
@@ -47,7 +47,7 @@ void uvm_object_printit __P((struct uvm_object *, boolean_t,
int (*) __P((const char *, ...))));
void uvm_page_printit __P((struct vm_page *, boolean_t,
int (*) __P((const char *, ...))));
-void uvmexp_print(void (*)(const char *, ...));
+void uvmexp_print(int (*) __P((const char *, ...)));
#endif /* DDB */
#endif /* _KERNEL */
diff --git a/sys/uvm/uvm_stat.c b/sys/uvm/uvm_stat.c
index 801d240fdf0..92cda53ccc3 100644
--- a/sys/uvm/uvm_stat.c
+++ b/sys/uvm/uvm_stat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_stat.c,v 1.11 2001/12/19 08:58:07 art Exp $ */
+/* $OpenBSD: uvm_stat.c,v 1.12 2002/01/02 22:22:03 miod Exp $ */
/* $NetBSD: uvm_stat.c,v 1.18 2001/03/09 01:02:13 chs Exp $ */
/*
@@ -206,7 +206,7 @@ uvmcnt_dump()
* uvmexp_print: ddb hook to print interesting uvm counters
*/
void
-uvmexp_print(void (*pr)(const char *, ...))
+uvmexp_print(int (*pr) __P((const char *, ...)))
{
(*pr)("Current UVM status:\n");