Module Name: src Committed By: pooka Date: Sun Jul 11 12:29:08 UTC 2010
Modified Files: src/lib/libpuffs: opdump.c puffsdump.h Log Message: Export the opid -> opstr tables (for outside debugging use). To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/lib/libpuffs/opdump.c cvs rdiff -u -r1.14 -r1.15 src/lib/libpuffs/puffsdump.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libpuffs/opdump.c diff -u src/lib/libpuffs/opdump.c:1.33 src/lib/libpuffs/opdump.c:1.34 --- src/lib/libpuffs/opdump.c:1.33 Fri May 21 10:43:07 2010 +++ src/lib/libpuffs/opdump.c Sun Jul 11 12:29:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: opdump.c,v 1.33 2010/05/21 10:43:07 pooka Exp $ */ +/* $NetBSD: opdump.c,v 1.34 2010/07/11 12:29:08 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if !defined(lint) -__RCSID("$NetBSD: opdump.c,v 1.33 2010/05/21 10:43:07 pooka Exp $"); +__RCSID("$NetBSD: opdump.c,v 1.34 2010/07/11 12:29:08 pooka Exp $"); #endif /* !lint */ #include <sys/types.h> @@ -49,8 +49,7 @@ #define DINT " " -/* XXX! */ -const char *vfsop_revmap[] = { +const char *puffsdump_vfsop_revmap[] = { "PUFFS_VFS_MOUNT", "PUFFS_VFS_START", "PUFFS_VFS_UNMOUNT", @@ -67,8 +66,9 @@ "PUFFS_VFS_EXTATTRCTL", "PUFFS_VFS_SUSPEND" }; -/* XXX! */ -const char *vnop_revmap[] = { +size_t puffsdump_vfsop_count = __arraycount(puffsdump_vfsop_revmap); + +const char *puffsdump_vnop_revmap[] = { "PUFFS_VN_LOOKUP", "PUFFS_VN_CREATE", "PUFFS_VN_MKNOD", @@ -117,12 +117,14 @@ "PUFFS_VN_SETEXTATTR", "PUFFS_VN_CLOSEEXTATTR", }; +size_t puffsdump_vnop_count = __arraycount(puffsdump_vnop_revmap); + /* XXX! */ -const char *cacheop_revmap[] = { +const char *puffsdump_cacheop_revmap[] = { "PUFFS_CACHE_WRITE" }; -/* XXX! */ -const char *errnot_revmap[] = { + +const char *puffsdump_errnot_revmap[] = { "PUFFS_ERR_ERROR", "PUFFS_ERR_MAKENODE", "PUFFS_ERR_LOOKUP", @@ -134,14 +136,16 @@ "PUFFS_ERR_GETEXTATTR", "PUFFS_ERR_LISTEXTATTR", }; -/* XXX! */ -const char *flush_revmap[] = { +size_t puffsdump_errnot_count = __arraycount(puffsdump_errnot_revmap); + +const char *puffsdump_flush_revmap[] = { "PUFFS_INVAL_NAMECACHE_NODE", "PUFFS_INVAL_NAMECACHE_DIR", "PUFFS_INVAL_NAMECACHE_ALL", "PUFFS_INVAL_PAGECACHE_NODE_RANGE", "PUFFS_FLUSH_PAGECACHE_NODE_RANGE", }; +size_t puffsdump_flush_count = __arraycount(puffsdump_flush_revmap); void puffsdump_req(struct puffs_req *preq) @@ -158,25 +162,25 @@ opclass = PUFFSOP_OPCLASS(preq->preq_opclass); switch (opclass) { case PUFFSOP_VFS: - map = vfsop_revmap; - maxhandle = __arraycount(vfsop_revmap); + map = puffsdump_vfsop_revmap; + maxhandle = puffsdump_vfsop_count; break; case PUFFSOP_VN: - map = vnop_revmap; - maxhandle = __arraycount(vnop_revmap); + map = puffsdump_vnop_revmap; + maxhandle = puffsdump_vnop_count; isvn = 1; break; case PUFFSOP_CACHE: - map = cacheop_revmap; - maxhandle = __arraycount(cacheop_revmap); + map = puffsdump_cacheop_revmap; + maxhandle = __arraycount(puffsdump_cacheop_revmap); break; case PUFFSOP_ERROR: - map = errnot_revmap; - maxhandle = __arraycount(errnot_revmap); + map = puffsdump_errnot_revmap; + maxhandle = puffsdump_errnot_count; break; case PUFFSOP_FLUSH: - map = flush_revmap; - maxhandle = __arraycount(flush_revmap); + map = puffsdump_flush_revmap; + maxhandle = puffsdump_flush_count; break; default: printf("unhandled opclass %d\n", opclass); Index: src/lib/libpuffs/puffsdump.h diff -u src/lib/libpuffs/puffsdump.h:1.14 src/lib/libpuffs/puffsdump.h:1.15 --- src/lib/libpuffs/puffsdump.h:1.14 Thu Jan 7 20:47:47 2010 +++ src/lib/libpuffs/puffsdump.h Sun Jul 11 12:29:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffsdump.h,v 1.14 2010/01/07 20:47:47 pooka Exp $ */ +/* $NetBSD: puffsdump.h,v 1.15 2010/07/11 12:29:08 pooka Exp $ */ /* * Copyright (c) 2006 Antti Kantee. All Rights Reserved. @@ -55,4 +55,14 @@ void puffsdump_attr(struct puffs_req *); void puffsdump_targ(struct puffs_req *); +extern const char *puffsdump_vfsop_revmap[]; +extern const char *puffsdump_vnop_revmap[]; +extern const char *puffsdump_errnot_revmap[]; +extern const char *puffsdump_flush_revmap[]; + +extern size_t puffsdump_vfsop_count; +extern size_t puffsdump_vnop_count; +extern size_t puffsdump_errnot_count; +extern size_t puffsdump_flush_count; + #endif /* _PUFFSDUMP_H_ */