1 /* Copyright (C) 1995 Transarc Corporation - All rights reserved. */
3 * Implementation of Irix IDBG facility for AFS.
5 #include "../afs/param.h" /* Should be always first */
7 #include "../afs/sysincludes.h" /* Standard vendor system headers */
8 #include "../afs/afsincludes.h" /* Afs-based standard headers */
9 #include "../afs/afs_stats.h" /* statistics */
13 * debugging routine - invoked by calling kp vnode xx
16 printflags(register unsigned int flags, register char **strings)
18 register int mask = 1;
22 qprintf("%s ", *strings);
30 char *tab_vcache[] = {
37 "CSafeStore", /* 0x40 */
39 "CNSHARE", /* 0x100 */
43 idbg_prafsnode(OSI_VC_DECL(avc))
48 qprintf(" Len %d DV %d Date %d Own %d Grp %d Mode 0%o Lnk %d\n",
49 avc->m.Length, avc->m.DataVersion, avc->m.Date,
50 avc->m.Owner, avc->m.Group, avc->m.Mode, avc->m.LinkCount);
51 qprintf(" flushDV %d mapDV %d truncpos 0x%x cb 0x%x cbE 0x%x\n",
52 avc->flushDV, avc->mapDV, avc->truncPos,
53 avc->callback, avc->cbExpires);
54 qprintf(" opens %d ex/wr %d flckcnt %d state 0x%x ",
55 avc->opens, avc->execsOrWriters, avc->flockCount,
57 printflags(avc->states, tab_vcache);
60 qprintf(" mapcnt %llu, mvstat %d anyAcc 0x%x Access 0x%x\n",
61 avc->mapcnt, avc->mvstat, avc->anyAccess, avc->Access);
62 qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n",
63 avc->mvid, &avc->lock, avc->cred);
64 qprintf(" rwlock 0x%x (%d) id %llu trips %d\n",
65 &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid,
68 qprintf(" mapcnt %d mvstat %d anyAcc 0x%x Access 0x%x\n",
69 avc->mapcnt, avc->mvstat, avc->anyAccess, avc->Access);
70 qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n",
71 avc->mvid, &avc->lock, avc->cred);
72 qprintf(" rwlock 0x%x (%d) id %d trips %d\n",
73 &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid,
80 extern struct afs_q VLRU; /*vcache LRU*/
81 static char *tab_vtypes[] = {
99 register struct afs_q *tq;
101 afs_int32 nodeid; /* what ls prints as 'inode' */
104 for(tq = VLRU.prev; tq != &VLRU; tq = uq) {
107 nodeid = tvc->fid.Fid.Vnode + (tvc->fid.Fid.Volume << 16);
108 nodeid &= 0x7fffffff;
109 qprintf("avp 0x%x type %s cnt %d pg %d map %d nodeid %d(0x%x)\n",
110 tvc, tab_vtypes[((vnode_t *)tvc)->v_type],
111 ((vnode_t *)tvc)->v_count,
112 (int) VN_GET_PGCNT((vnode_t *)tvc),
113 (int)tvc->mapcnt, nodeid, nodeid);
119 static char *tab_userstates[] = {
129 idbg_pruser(struct unixuser *tu)
131 qprintf("@0x%x nxt 0x%x uid %d (0x%x) cell 0x%x vid 0x%x ref %d\n",
132 tu, tu->next, tu->uid, tu->uid, tu->cell,
133 tu->vid, tu->refCount);
134 qprintf("time %d stLen %d stp 0x%x exp 0x%x ",
135 tu->tokenTime, tu->stLen, tu->stp, tu->exporter);
136 printflags(tu->states, tab_userstates);
138 qprintf("ClearToken: handle 0x%x ViceID 0x%x Btime %d Etime %d\n",
139 tu->ct.AuthHandle, tu->ct.ViceId, tu->ct.BeginTimestamp,
140 tu->ct.EndTimestamp);
143 extern struct unixuser *afs_users[NUSERS];
145 idbg_afsuser(void *x)
151 if (x == (void *)-1L) {
152 for (i = 0; i < NUSERS; i++)
153 for (tu = afs_users[i]; tu; tu = tu->next)
156 idbg_pruser((struct unixuser *)x);
162 #endif /* AFS_SGI62_ENV */