Created
March 7, 2013 17:22
-
-
Save tuxillo/5109889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sys/kern/lwkt_token.c b/sys/kern/lwkt_token.c | |
index 059bc18..dc9504e 100644 | |
--- a/sys/kern/lwkt_token.c | |
+++ b/sys/kern/lwkt_token.c | |
@@ -53,6 +53,7 @@ | |
#include <sys/queue.h> | |
#include <sys/sysctl.h> | |
#include <sys/ktr.h> | |
+#include <ddb/ddb.h> | |
#include <sys/kthread.h> | |
#include <machine/cpu.h> | |
#include <sys/lock.h> | |
@@ -931,3 +932,27 @@ lwkt_token_swap(void) | |
crit_exit(); | |
} | |
+ | |
+DB_SHOW_COMMAND(tokens, db_tok_all) | |
+{ | |
+ struct lwkt_token *tok, **ptr; | |
+ struct lwkt_token *toklist[16] = { | |
+ &mp_token, | |
+ &pmap_token, | |
+ &dev_token, | |
+ &vm_token, | |
+ &vmspace_token, | |
+ &kvm_token, | |
+ &proc_token, | |
+ &tty_token, | |
+ &vnode_token, | |
+ &vmobj_token, | |
+ NULL }; | |
+ | |
+ ptr = toklist; | |
+ for (tok = *ptr; tok; tok = *(++ptr)) { | |
+ db_printf("tok=%p tr_owner=%p t_colissions=%ld t_desc=%s\n", tok, | |
+ (tok->t_ref ? tok->t_ref->tr_owner : NULL), | |
+ tok->t_collisions, tok->t_desc); | |
+ } | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment