summaryrefslogtreecommitdiff
path: root/sys/ddb
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2009-08-17 13:11:59 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2009-08-17 13:11:59 +0000
commit778ca4e886ad04434abed49d3f251af70f76b2be (patch)
tree6318a7a9289028489177fa6dc11694b0c0d675af /sys/ddb
parent66897d65ce3cb1886f1f5190e87599dae60ce871 (diff)
dd 'show all bufs' to show all the buffers in the system
ok beck@ thib@
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_command.c17
-rw-r--r--sys/ddb/db_command.h3
-rw-r--r--sys/ddb/db_interface.h4
3 files changed, 19 insertions, 5 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 },
diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h
index 13ef6ccaab1..db97043cecf 100644
--- a/sys/ddb/db_command.h
+++ b/sys/ddb/db_command.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.h,v 1.28 2009/08/14 21:16:13 thib Exp $ */
+/* $OpenBSD: db_command.h,v 1.29 2009/08/17 13:11:58 jasper Exp $ */
/* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */
/*
@@ -44,6 +44,7 @@ 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_show_all_bufs(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 7b25667d3c6..8be1e9b3d75 100644
--- a/sys/ddb/db_interface.h
+++ b/sys/ddb/db_interface.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.h,v 1.14 2009/08/14 21:16:13 thib Exp $ */
+/* $OpenBSD: db_interface.h,v 1.15 2009/08/17 13:11:58 jasper Exp $ */
/* $NetBSD: db_interface.h,v 1.1 1996/02/05 01:57:03 christos Exp $ */
/*
@@ -48,7 +48,7 @@ void db_show_callout(db_expr_t, int, db_expr_t, char *);
struct mount;
/* kern/vfs_subr.c */
-void vfs_buf_print(struct buf *, int, int (*)(const char *, ...));
+void vfs_buf_print(void *, int, int (*)(const char *, ...));
void vfs_vnode_print(void *, int, int (*)(const char *, ...));
void vfs_mount_print(struct mount *, int, int (*)(const char *, ...));