Module Name: src
Committed By: pooka
Date: Sat May 1 14:44:48 UTC 2010
Modified Files:
src/lib/libp2k: p2k.c
Log Message:
If P2K_DEBUG is given, also dump rump kernel event counters when
file system is unmounted.
To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/libp2k/p2k.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libp2k/p2k.c
diff -u src/lib/libp2k/p2k.c:1.35 src/lib/libp2k/p2k.c:1.36
--- src/lib/libp2k/p2k.c:1.35 Thu Apr 29 22:34:21 2010
+++ src/lib/libp2k/p2k.c Sat May 1 14:44:48 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: p2k.c,v 1.35 2010/04/29 22:34:21 pooka Exp $ */
+/* $NetBSD: p2k.c,v 1.36 2010/05/01 14:44:48 pooka Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Antti Kantee. All Rights Reserved.
@@ -79,6 +79,7 @@
struct mount *p2m_mp;
int p2m_nvnodes;
int p2m_imtmpfsman;
+ bool p2m_hasdebug;
};
struct p2k_node {
@@ -273,6 +274,7 @@
struct p2k_mount *p2m;
char *envbuf;
bool dodaemon;
+ bool hasdebug;
PUFFSOP_INIT(pops);
@@ -315,6 +317,7 @@
if (getenv("P2K_DEBUG") != NULL) {
puffs_flags |= PUFFS_FLAG_OPDUMP;
dodaemon = false;
+ hasdebug = true;
}
if (getenv("P2K_NODETACH") != NULL) {
dodaemon = false;
@@ -346,6 +349,7 @@
errno = sverrno;
return NULL;
}
+ p2m->p2m_hasdebug = hasdebug;
if (dodaemon) {
if (puffs_daemon(p2m->p2m_pu, 1, 1) == -1) {
@@ -567,6 +571,12 @@
}
p2m->p2m_ukfs = NULL;
+ if (p2m->p2m_hasdebug) {
+ printf("-- rump kernel event counters --\n");
+ rump_printevcnts();
+ printf("-- end of event counters --\n");
+ }
+
rump_pub_lwp_alloc_and_switch(0, 0);
return error;
}