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 <afsconfig.h>
14 #include "afs/param.h"
18 #include "afs/sysincludes.h" /* Standard vendor system headers */
19 #include "afsincludes.h" /* Afs-based standard headers */
20 #include "afs/afs_stats.h" /* statistics */
24 * debugging routine - invoked by calling kp vnode xx
27 printflags(unsigned int flags
, char **strings
)
33 qprintf("%s ", *strings
);
41 char *tab_vcache
[] = {
48 "CSafeStore", /* 0x40 */
50 "CNSHARE", /* 0x100 */
54 idbg_prafsnode(OSI_VC_DECL(avc
))
59 qprintf(" Len %d DV %d Date %d Own %d Grp %d Mode 0%o Lnk %d\n",
60 avc
->f
.m
.Length
, avc
->f
.m
.DataVersion
, avc
->f
.m
.Date
, avc
->f
.m
.Owner
,
61 avc
->f
.m
.Group
, avc
->f
.m
.Mode
, avc
->f
.m
.LinkCount
);
62 qprintf(" flushDV %d mapDV %d truncpos 0x%x cb 0x%x cbE 0x%x\n",
63 avc
->flushDV
, avc
->mapDV
, avc
->f
.truncPos
, avc
->callback
,
65 qprintf(" opens %d ex/wr %d flckcnt %d state 0x%x ", avc
->opens
,
66 avc
->execsOrWriters
, avc
->flockCount
, avc
->f
.states
);
67 printflags(avc
->f
.states
, tab_vcache
);
70 qprintf(" mapcnt %llu, mvstat %d anyAcc 0x%x Access 0x%x\n",
71 avc
->mapcnt
, avc
->mvstat
, avc
->f
.anyAccess
, avc
->Access
);
72 qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc
->mvid
.target_root
, &avc
->lock
,
74 qprintf(" rwlock 0x%x (%d) id %llu trips %d\n", &avc
->vc_rwlock
,
75 valusema(&avc
->vc_rwlock
), avc
->vc_rwlockid
, avc
->vc_locktrips
);
77 qprintf(" mapcnt %d mvstat %d anyAcc 0x%x Access 0x%x\n", avc
->mapcnt
,
78 avc
->mvstat
, avc
->f
.anyAccess
, avc
->Access
);
79 qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc
->mvid
.target_root
, &avc
->lock
,
81 qprintf(" rwlock 0x%x (%d) id %d trips %d\n", &avc
->vc_rwlock
,
82 valusema(&avc
->vc_rwlock
), avc
->vc_rwlockid
, avc
->vc_locktrips
);
88 extern struct afs_q VLRU
; /*vcache LRU */
89 static char *tab_vtypes
[] = {
109 afs_int32 nodeid
; /* what ls prints as 'inode' */
112 for (tq
= VLRU
.prev
; tq
!= &VLRU
; tq
= uq
) {
115 nodeid
= afs_calc_inum(tvc
->f
.fid
.Cell
, tvc
->f
.fid
.Fid
.Volume
,
116 tvc
->f
.fid
.Fid
.Vnode
);
117 qprintf("avp 0x%x type %s cnt %d pg %d map %d nodeid %lu(0x%lx)\n", tvc
,
118 tab_vtypes
[((vnode_t
*) tvc
)->v_type
],
119 ((vnode_t
*) tvc
)->v_count
,
120 (int)VN_GET_PGCNT((vnode_t
*) tvc
), (int)tvc
->mapcnt
,
121 (long unsigned)nodeid
, (long unsigned)nodeid
);
127 static char *tab_userstates
[] = {
137 idbg_pruser(struct unixuser
*tu
)
139 union tokenUnion
*token
;
141 token
= afs_FindToken(tu
->tokens
, RX_SECIDX_KAD
);
143 qprintf("@0x%x nxt 0x%x uid %d (0x%x) cell 0x%x vid 0x%x ref %d\n", tu
,
144 tu
->next
, tu
->uid
, tu
->uid
, tu
->cell
, tu
->viceId
, tu
->refCount
);
145 qprintf("time %dRX_SECIDX_KADstLen %d stp 0x%x exp 0x%x ", tu
->tokenTime
,
146 (token
!= NULL
)?token
->rxkad
.ticketLen
:0,
147 (token
!= NULL
)?token
->rxkad
.ticket
:NULL
,
149 printflags(tu
->states
, tab_userstates
);
151 qprintf("ClearToken: handle 0x%x ViceID 0x%x Btime %d Etime %d\n",
152 (token
!= NULL
)?token
->rxkad
.clearToken
.AuthHandle
:0,
154 (token
!= NULL
)?token
->rxkad
.clearToken
.BeginTimestamp
:0,
155 (token
!= NULL
)?token
->rxkad
.clearToken
.EndTimestamp
:0);
158 extern struct unixuser
*afs_users
[NUSERS
];
160 idbg_afsuser(void *x
)
166 if (x
== (void *)-1L) {
167 for (i
= 0; i
< NUSERS
; i
++)
168 for (tu
= afs_users
[i
]; tu
; tu
= tu
->next
)
171 idbg_pruser((struct unixuser
*)x
);
177 #endif /* AFS_SGI62_ENV */