2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * Implementation of Irix IDBG facility for AFS.
13 #include "../afs/param.h" /* Should be always first */
15 #include "../afs/sysincludes.h" /* Standard vendor system headers */
16 #include "../afs/afsincludes.h" /* Afs-based standard headers */
17 #include "../afs/afs_stats.h" /* statistics */
21 * debugging routine - invoked by calling kp vnode xx
24 printflags(register unsigned int flags, register char **strings)
26 register int mask = 1;
30 qprintf("%s ", *strings);
38 char *tab_vcache[] = {
45 "CSafeStore", /* 0x40 */
47 "CNSHARE", /* 0x100 */
51 idbg_prafsnode(OSI_VC_DECL(avc))
56 qprintf(" Len %d DV %d Date %d Own %d Grp %d Mode 0%o Lnk %d\n",
57 avc->m.Length, avc->m.DataVersion, avc->m.Date,
58 avc->m.Owner, avc->m.Group, avc->m.Mode, avc->m.LinkCount);
59 qprintf(" flushDV %d mapDV %d truncpos 0x%x cb 0x%x cbE 0x%x\n",
60 avc->flushDV, avc->mapDV, avc->truncPos,
61 avc->callback, avc->cbExpires);
62 qprintf(" opens %d ex/wr %d flckcnt %d state 0x%x ",
63 avc->opens, avc->execsOrWriters, avc->flockCount,
65 printflags(avc->states, tab_vcache);
68 qprintf(" mapcnt %llu, 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 %llu trips %d\n",
73 &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid,
76 qprintf(" mapcnt %d mvstat %d anyAcc 0x%x Access 0x%x\n",
77 avc->mapcnt, avc->mvstat, avc->anyAccess, avc->Access);
78 qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n",
79 avc->mvid, &avc->lock, avc->cred);
80 qprintf(" rwlock 0x%x (%d) id %d trips %d\n",
81 &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid,
88 extern struct afs_q VLRU; /*vcache LRU*/
89 static char *tab_vtypes[] = {
107 register struct afs_q *tq;
109 afs_int32 nodeid; /* what ls prints as 'inode' */
112 for(tq = VLRU.prev; tq != &VLRU; tq = uq) {
115 nodeid = tvc->fid.Fid.Vnode + (tvc->fid.Fid.Volume << 16);
116 nodeid &= 0x7fffffff;
117 qprintf("avp 0x%x type %s cnt %d pg %d map %d nodeid %d(0x%x)\n",
118 tvc, tab_vtypes[((vnode_t *)tvc)->v_type],
119 ((vnode_t *)tvc)->v_count,
120 (int) VN_GET_PGCNT((vnode_t *)tvc),
121 (int)tvc->mapcnt, nodeid, nodeid);
127 static char *tab_userstates[] = {
137 idbg_pruser(struct unixuser *tu)
139 qprintf("@0x%x nxt 0x%x uid %d (0x%x) cell 0x%x vid 0x%x ref %d\n",
140 tu, tu->next, tu->uid, tu->uid, tu->cell,
141 tu->vid, tu->refCount);
142 qprintf("time %d stLen %d stp 0x%x exp 0x%x ",
143 tu->tokenTime, tu->stLen, tu->stp, tu->exporter);
144 printflags(tu->states, tab_userstates);
146 qprintf("ClearToken: handle 0x%x ViceID 0x%x Btime %d Etime %d\n",
147 tu->ct.AuthHandle, tu->ct.ViceId, tu->ct.BeginTimestamp,
148 tu->ct.EndTimestamp);
151 extern struct unixuser *afs_users[NUSERS];
153 idbg_afsuser(void *x)
159 if (x == (void *)-1L) {
160 for (i = 0; i < NUSERS; i++)
161 for (tu = afs_users[i]; tu; tu = tu->next)
164 idbg_pruser((struct unixuser *)x);
170 #endif /* AFS_SGI62_ENV */