diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2009-08-13 13:49:21 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2009-08-13 13:49:21 +0000 |
commit | 74a6604beb400e6cc433d7fda8960ce8bb0ca9ba (patch) | |
tree | 5d65e26b5bc5085f750f7b7e0e479a64fd078070 /sys/ddb | |
parent | 629efe026cb80764f620bf4e2253c0ca759cb290 (diff) |
add a show all vnodes command, use dlg's nice pool_walk() to accomplish
this.
ok beck@, dlg@
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_command.c | 17 | ||||
-rw-r--r-- | sys/ddb/db_command.h | 3 | ||||
-rw-r--r-- | sys/ddb/db_interface.h | 5 |
3 files changed, 19 insertions, 6 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index cdfbb648979..1ba56005ab8 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.c,v 1.56 2009/08/09 23:04:49 miod Exp $ */ +/* $OpenBSD: db_command.c,v 1.57 2009/08/13 13:49:20 thib Exp $ */ /* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */ /* @@ -347,6 +347,18 @@ db_show_all_mounts(db_expr_t addr, int have_addr, db_expr_t count, char *modif) vfs_mount_print(mp, full, db_printf); } +extern struct pool vnode_pool; +void +db_show_all_vnodes(db_expr_t addr, int have_addr, db_expr_t count, char *modif) +{ + boolean_t full = FALSE; + + if (modif[0] == 'f') + full = TRUE; + + pool_walk(&vnode_pool, full, db_printf, vfs_vnode_print); +} + /*ARGSUSED*/ void db_object_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) @@ -380,7 +392,7 @@ db_vnode_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) if (modif[0] == 'f') full = TRUE; - vfs_vnode_print((struct vnode *) addr, full, db_printf); + vfs_vnode_print((void *)addr, full, db_printf); } #ifdef NFSCLIENT @@ -457,6 +469,7 @@ struct db_command db_show_all_cmds[] = { { "callout", db_show_callout, 0, NULL }, { "pools", db_show_all_pools, 0, NULL }, { "mounts", db_show_all_mounts, 0, NULL }, + { "vnodes,", db_show_all_vnodes, 0, NULL }, #ifdef NFSCLIENT { "nfsreq", db_show_all_nfsreqs, 0, NULL }, #endif diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h index 5350d8204ec..b306d206428 100644 --- a/sys/ddb/db_command.h +++ b/sys/ddb/db_command.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.h,v 1.26 2009/08/09 23:04:49 miod Exp $ */ +/* $OpenBSD: db_command.h,v 1.27 2009/08/13 13:49:20 thib Exp $ */ /* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */ /* @@ -43,6 +43,7 @@ void db_map_print_cmd(db_expr_t, int, db_expr_t, char *); void db_malloc_print_cmd(db_expr_t, int, db_expr_t, char *); void db_mount_print_cmd(db_expr_t, int, db_expr_t, char *); void db_show_all_mounts(db_expr_t, int, db_expr_t, char *); +void db_show_all_vnodes(db_expr_t, int, db_expr_t, char *); void db_object_print_cmd(db_expr_t, int, db_expr_t, char *); void db_page_print_cmd(db_expr_t, int, db_expr_t, char *); void db_extent_print_cmd(db_expr_t, int, db_expr_t, char *); diff --git a/sys/ddb/db_interface.h b/sys/ddb/db_interface.h index e15ef4bbcdd..5d57ed043d9 100644 --- a/sys/ddb/db_interface.h +++ b/sys/ddb/db_interface.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.h,v 1.12 2009/06/17 01:30:30 thib Exp $ */ +/* $OpenBSD: db_interface.h,v 1.13 2009/08/13 13:49:20 thib Exp $ */ /* $NetBSD: db_interface.h,v 1.1 1996/02/05 01:57:03 christos Exp $ */ /* @@ -46,11 +46,10 @@ void db_show_all_procs(db_expr_t, int, db_expr_t, char *); void db_show_callout(db_expr_t, int, db_expr_t, char *); struct mount; -struct vnode; /* kern/vfs_subr.c */ void vfs_buf_print(struct buf *, int, int (*)(const char *, ...)); -void vfs_vnode_print(struct vnode *, int, int (*)(const char *, ...)); +void vfs_vnode_print(void *, int, int (*)(const char *, ...)); void vfs_mount_print(struct mount *, int, int (*)(const char *, ...)); /* kern/subr_pool.c */ |