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 */
14 #include <afsconfig.h>
19 #include "../afs/sysincludes.h" /* Standard vendor system headers */
20 #include "../afs/afsincludes.h" /* Afs-based standard headers */
21 #include "../afs/afs_stats.h" /* statistics */
25 * debugging routine - invoked by calling kp vnode xx
28 printflags(register unsigned int flags, register char **strings)
30 register int mask = 1;
34 qprintf("%s ", *strings);
42 char *tab_vcache[] = {
49 "CSafeStore", /* 0x40 */
51 "CNSHARE", /* 0x100 */
55 idbg_prafsnode(OSI_VC_DECL(avc))
60 qprintf(" Len %d DV %d Date %d Own %d Grp %d Mode 0%o Lnk %d\n",
61 avc->m.Length, avc->m.DataVersion, avc->m.Date,
62 avc->m.Owner, avc->m.Group, avc->m.Mode, avc->m.LinkCount);
63 qprintf(" flushDV %d mapDV %d truncpos 0x%x cb 0x%x cbE 0x%x\n",
64 avc->flushDV, avc->mapDV, avc->truncPos,
65 avc->callback, avc->cbExpires);
66 qprintf(" opens %d ex/wr %d flckcnt %d state 0x%x ",
67 avc->opens, avc->execsOrWriters, avc->flockCount,
69 printflags(avc->states, tab_vcache);
72 qprintf(" mapcnt %llu, mvstat %d anyAcc 0x%x Access 0x%x\n",
73 avc->mapcnt, avc->mvstat, avc->anyAccess, avc->Access);
74 qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n",
75 avc->mvid, &avc->lock, avc->cred);
76 qprintf(" rwlock 0x%x (%d) id %llu trips %d\n",
77 &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid,
80 qprintf(" mapcnt %d mvstat %d anyAcc 0x%x Access 0x%x\n",
81 avc->mapcnt, avc->mvstat, avc->anyAccess, avc->Access);
82 qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n",
83 avc->mvid, &avc->lock, avc->cred);
84 qprintf(" rwlock 0x%x (%d) id %d trips %d\n",
85 &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid,
92 extern struct afs_q VLRU; /*vcache LRU*/
93 static char *tab_vtypes[] = {
111 register struct afs_q *tq;
113 afs_int32 nodeid; /* what ls prints as 'inode' */
116 for(tq = VLRU.prev; tq != &VLRU; tq = uq) {
119 nodeid = tvc->fid.Fid.Vnode + (tvc->fid.Fid.Volume << 16);
120 nodeid &= 0x7fffffff;
121 qprintf("avp 0x%x type %s cnt %d pg %d map %d nodeid %d(0x%x)\n",
122 tvc, tab_vtypes[((vnode_t *)tvc)->v_type],
123 ((vnode_t *)tvc)->v_count,
124 (int) VN_GET_PGCNT((vnode_t *)tvc),
125 (int)tvc->mapcnt, nodeid, nodeid);
131 static char *tab_userstates[] = {
141 idbg_pruser(struct unixuser *tu)
143 qprintf("@0x%x nxt 0x%x uid %d (0x%x) cell 0x%x vid 0x%x ref %d\n",
144 tu, tu->next, tu->uid, tu->uid, tu->cell,
145 tu->vid, tu->refCount);
146 qprintf("time %d stLen %d stp 0x%x exp 0x%x ",
147 tu->tokenTime, tu->stLen, tu->stp, tu->exporter);
148 printflags(tu->states, tab_userstates);
150 qprintf("ClearToken: handle 0x%x ViceID 0x%x Btime %d Etime %d\n",
151 tu->ct.AuthHandle, tu->ct.ViceId, tu->ct.BeginTimestamp,
152 tu->ct.EndTimestamp);
155 extern struct unixuser *afs_users[NUSERS];
157 idbg_afsuser(void *x)
163 if (x == (void *)-1L) {
164 for (i = 0; i < NUSERS; i++)
165 for (tu = afs_users[i]; tu; tu = tu->next)
168 idbg_pruser((struct unixuser *)x);
174 #endif /* AFS_SGI62_ENV */