diff options
| author | 2008-03-23 12:31:56 +0000 | |
|---|---|---|
| committer | 2008-03-23 12:31:56 +0000 | |
| commit | 918b11b6f61ae343caa9721c257607b8f62a60de (patch) | |
| tree | d54192a47e05a5ddd31a8c9640002ebebf1f9bdd | |
| parent | Use new defines from pcidevs to match Expert3D. (diff) | |
| download | wireguard-openbsd-918b11b6f61ae343caa9721c257607b8f62a60de.tar.xz wireguard-openbsd-918b11b6f61ae343caa9721c257607b8f62a60de.zip | |
show all mounts command for ddb. From mickey a long time ago.
| -rw-r--r-- | share/man/man4/ddb.4 | 15 | ||||
| -rw-r--r-- | sys/ddb/db_command.c | 17 | ||||
| -rw-r--r-- | sys/ddb/db_command.h | 3 |
3 files changed, 31 insertions, 4 deletions
diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 05726373f24..d48dc4a3291 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ddb.4,v 1.51 2007/05/31 19:19:50 jmc Exp $ +.\" $OpenBSD: ddb.4,v 1.52 2008/03/23 12:31:56 miod Exp $ .\" $NetBSD: ddb.4,v 1.5 1994/11/30 16:22:09 jtc Exp $ .\" .\" Mach Operating System @@ -25,7 +25,7 @@ .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: March 23 2008 $ .Dt DDB 4 .Os .Sh NAME @@ -776,6 +776,7 @@ wait channel address, and wait channel message. .\" -------------------- .It Ic show all callout Display the contents of the callout table. +.\" -------------------- .It Ic show all pools Op Cm /a Display information about all system pools in a format similar to .Xr vmstat 8 . @@ -786,6 +787,16 @@ Displays .Dq interesting address information. .El +.\" -------------------- +.It Ic show all mounts Op Cm /f +Display information on all mounted filesystems. +.Pp +.Bl -tag -width foo -compact +.It Cm /f +For each filesystem, list all its struct vnode addresses. +These addresses can be used in the +.Ic show vnode +command. .El .It Ic callout A synonym for the diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 9eb3bf028cf..2c87db84340 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.c,v 1.48 2007/11/14 17:52:36 miod Exp $ */ +/* $OpenBSD: db_command.c,v 1.49 2008/03/23 12:31:57 miod Exp $ */ /* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */ /* @@ -38,6 +38,7 @@ #include <sys/pool.h> #include <sys/msgbuf.h> #include <sys/malloc.h> +#include <sys/mount.h> #include <uvm/uvm_extern.h> #include <machine/db_machdep.h> /* type definitions */ @@ -333,6 +334,19 @@ db_mount_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) vfs_mount_print((struct mount *) addr, full, db_printf); } +void +db_show_all_mounts(db_expr_t addr, int have_addr, db_expr_t count, char *modif) +{ + boolean_t full = FALSE; + struct mount *mp; + + if (modif[0] == 'f') + full = TRUE; + + CIRCLEQ_FOREACH(mp, &mountlist, mnt_list) + vfs_mount_print(mp, full, db_printf); +} + /*ARGSUSED*/ void db_object_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) @@ -418,6 +432,7 @@ struct db_command db_show_all_cmds[] = { { "procs", db_show_all_procs, 0, NULL }, { "callout", db_show_callout, 0, NULL }, { "pools", db_show_all_pools, 0, NULL }, + { "mounts", db_show_all_mounts, 0, NULL }, { NULL, NULL, 0, NULL } }; diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h index e1413bffcbc..4662acf7b6c 100644 --- a/sys/ddb/db_command.h +++ b/sys/ddb/db_command.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.h,v 1.20 2006/07/11 21:17:58 mickey Exp $ */ +/* $OpenBSD: db_command.h,v 1.21 2008/03/23 12:31:58 miod Exp $ */ /* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */ /* @@ -42,6 +42,7 @@ void db_buf_print_cmd(db_expr_t, int, db_expr_t, char *); 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_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 *); |
