diff options
| author | 2009-08-17 13:11:58 +0000 | |
|---|---|---|
| committer | 2009-08-17 13:11:58 +0000 | |
| commit | da59dcae7e4431fb5a3bc5fe82c15923f912e796 (patch) | |
| tree | fbf7bfbcf405291b75e8174c91526e2e97f5e272 /sys/ddb/db_command.c | |
| parent | initialize retry to zero; otherwise if firmware sends odd val16 (diff) | |
| download | wireguard-openbsd-da59dcae7e4431fb5a3bc5fe82c15923f912e796.tar.xz wireguard-openbsd-da59dcae7e4431fb5a3bc5fe82c15923f912e796.zip | |
dd 'show all bufs' to show all the buffers in the system
ok beck@ thib@
Diffstat (limited to 'sys/ddb/db_command.c')
| -rw-r--r-- | sys/ddb/db_command.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 1115a45d70b..9d09f4cd4e7 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.c,v 1.59 2009/08/14 21:16:13 thib Exp $ */ +/* $OpenBSD: db_command.c,v 1.60 2009/08/17 13:11:58 jasper Exp $ */ /* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */ /* @@ -291,7 +291,7 @@ db_buf_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) if (modif[0] == 'f') full = TRUE; - vfs_buf_print((struct buf *) addr, full, db_printf); + vfs_buf_print((void *) addr, full, db_printf); } /*ARGSUSED*/ @@ -359,6 +359,18 @@ db_show_all_vnodes(db_expr_t addr, int have_addr, db_expr_t count, char *modif) pool_walk(&vnode_pool, full, db_printf, vfs_vnode_print); } +extern struct pool bufpool; +void +db_show_all_bufs(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(&bufpool, full, db_printf, vfs_buf_print); +} + /*ARGSUSED*/ void db_object_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) @@ -484,6 +496,7 @@ struct db_command db_show_all_cmds[] = { { "pools", db_show_all_pools, 0, NULL }, { "mounts", db_show_all_mounts, 0, NULL }, { "vnodes", db_show_all_vnodes, 0, NULL }, + { "bufs", db_show_all_bufs, 0, NULL }, #ifdef NFSCLIENT { "nfsreqs", db_show_all_nfsreqs, 0, NULL }, { "nfsnodes", db_show_all_nfsnodes, 0, NULL }, |
