diff options
author | cem <cem@FreeBSD.org> | 2016-06-09 18:27:41 +0000 |
---|---|---|
committer | cem <cem@FreeBSD.org> | 2016-06-09 18:27:41 +0000 |
commit | a9972a75afee0d3efc7bddffe276af8c792912a1 (patch) | |
tree | 1ec6a106c8c68320a225fa88fd20a2ef5f37c56b | |
parent | 5ebc37ce13cc781ebe2b412f696455def98d857b (diff) | |
download | FreeBSD-src-a9972a75afee0d3efc7bddffe276af8c792912a1.zip FreeBSD-src-a9972a75afee0d3efc7bddffe276af8c792912a1.tar.gz |
Add DDB command "kldstat"
It prints much the same information as kldstat(8) without any arguments.
Suggested by: jhibbits
Sponsored by: EMC / Isilon Storage Division
-rw-r--r-- | sys/kern/kern_linker.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 16c39f0..4758cdc 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -54,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include <sys/syscallsubr.h> #include <sys/sysctl.h> +#ifdef DDB +#include <ddb/ddb.h> +#endif + #include <net/vnet.h> #include <security/mac/mac_framework.h> @@ -1256,6 +1260,23 @@ kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat) return (0); } +#ifdef DDB +DB_COMMAND(kldstat, db_kldstat) +{ + linker_file_t lf; + +#define POINTER_WIDTH ((int)(sizeof(void *) * 2 + 2)) + db_printf("Id Refs Address%*c Size Name\n", POINTER_WIDTH - 7, ' '); +#undef POINTER_WIDTH + TAILQ_FOREACH(lf, &linker_files, link) { + if (db_pager_quit) + return; + db_printf("%2d %4d %p %-8zx %s\n", lf->id, lf->refs, + lf->address, lf->size, lf->filename); + } +} +#endif /* DDB */ + int sys_kldfirstmod(struct thread *td, struct kldfirstmod_args *uap) { |