afs-getcell-pioctl-should-be-able-to-provide-complete-list-20020731
[openafs.git] / src / venus / kdump.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 #include <afsconfig.h>
11 #include <afs/param.h>
12
13 RCSID("$Header$");
14
15 #include <stdio.h>
16 #include <stdlib.h>     /* for malloc() */
17
18 #ifdef AFS_LINUX24_ENV
19 #define __KERNEL__
20 #include <linux/string.h>
21 #define _STRING_H 1
22 #endif
23
24 #include <string.h>
25
26 #ifdef __linux__
27 #define _CFS_HEADER_
28 #define _AFFS_FS_I
29 #define _NFS_FS_I
30 #define _SYSV_FS_SB
31 #define _AFFS_FS_SB
32 #define _NFS_FS_SB
33 #define __LINUX_UFS_FS_SB_H
34 #define _SYSV_FS_I
35 #define _LINUX_CODA_FS_I
36 #define _LINUX_NTFS_FS_SB_H
37 #define _LINUX_NTFS_FS_I_H
38 #define _NCP_FS_SB
39 struct sysv_sb_info {};
40 struct affs_sb_info {};
41 struct ufs_sb_info {};
42 struct nfs_sb_info {};
43 struct nfs_inode_info {};
44 struct sysv_inode_info {};
45 struct coda_inode_info{};
46 struct affs_inode_info {};
47 struct nfs_lock_info {};
48 struct ntfs_sb_info{};
49 struct ntfs_inode_info{};
50 struct ncp_sb_info{};
51 #include <linux/types.h>
52 #define u32 unsigned int
53 #define s32 int
54 #define u16 unsigned short
55 #include <features.h>
56 #if __GLIBC_MINOR__ >= 2
57 #define _SYS_TYPES_H
58 #endif
59 #define __KERNEL__
60 #endif
61
62 /* This tells afs.h to pick up afs_args from the dest tree. */
63 #define KDUMP_KERNEL
64
65 /*
66  * Need to include <netdb.h> before _KERNEL is defined since on IRIX 6.5
67  * <netdb.h> includes <netinet/in.h>, which in turn declares inet_addr()
68  * if _KERNEL is defined.  This declaration conflicts with that in
69  * <arpa/inet.h>.
70  */
71 #if     ! defined(AFS_AIX_ENV)
72 #include <netdb.h>
73 #endif
74
75 /* For AFS_SGI61_ENV and a 64 bit OS, _KMEMUSER should be defined on the
76  * compile line for kdump.o in the Makefile. This lets us pick up
77  * app32_ptr_t from types.h when included from afs/param.h.
78  */
79 #ifdef AFS_SGI62_ENV
80 #define _KERNEL 1
81 #endif
82
83 #ifndef AFS_OSF_ENV
84 #include <sys/param.h>
85 #endif
86
87 #ifndef AFS_LINUX20_ENV
88 #include <nlist.h>
89 #endif
90
91 #ifdef AFS_HPUX_ENV
92 #include <a.out.h>
93 #endif
94
95 #include <afs/stds.h>
96 #include <sys/types.h>
97
98 #if defined(AFS_OSF_ENV)
99 #define KERNEL
100 #define UNIX_LOCKS
101 #define _KERNEL 1
102 #ifdef  _KERN_LOCK_H_
103 #include FFFFF
104 #endif
105 #include <sys/time.h>
106 #include <kern/lock.h>
107 #include <sys/vnode.h>
108 #include <arch/alpha/pmap.h>
109
110 /*
111  * beginning with DUX 4.0A, the system header files define the macros
112  *
113  * KSEG_TO_PHYS()
114  * IS_KSEG_VA()
115  * IS_SEG1_VA()
116  *
117  * to be calls to the kernel functions
118  *
119  * kseg_to_phys()
120  * is_kseg_va()
121  * is_seg1_va()
122  * 
123  * when _KERNEL is defined, and expressions otherwise.  Since need
124  * to define _KERNEL, we redefine these kernel functions as macros
125  * for the expressions that we would have gotten if _KERNEL had not
126  * been defined.  Yes, this duplicates code from the header files, but
127  * there's no simple way around it.
128  */
129
130 #define kseg_to_phys(addr) ((vm_offset_t)(addr) - UNITY_BASE)
131 #define is_kseg_va(x)   (((unsigned long)(x) & SEG1_BASE) == UNITY_BASE)
132 #define is_seg1_va(x)   (((unsigned long)(x) & SEG1_BASE) == SEG1_BASE)
133
134 #undef  KERNEL
135 #undef  _KERNEL
136 #endif
137
138 #ifdef  AFS_SUN5_ENV            /*XXXXX*/
139 #include <sys/t_lock.h>
140 struct vnode foo;
141 #ifdef  AFS_SUN54_ENV
142 #else
143 #ifdef  AFS_SUN52_ENV
144 typedef struct stat_mutex       stat_mutex_t;
145 #define kmutex_t                stat_mutex_t
146 #else
147 typedef struct adaptive_mutex2  adaptive_mutex2_t;
148 #define kmutex_t        adaptive_mutex2_t
149 #endif
150 #endif
151 #endif
152
153 #ifdef AFS_SGI53_ENV
154 #define _KERNEL 1
155 #include <sys/sema.h>
156 #ifndef AFS_SGI62_ENV
157 #undef _KERNEL 1
158 #endif
159 #endif
160
161 #include <sys/file.h>
162
163 #ifdef AFS_SGI62_ENV
164 #include <sys/fcntl.h>
165 #ifndef L_SET
166 #define L_SET 0
167 #endif
168 #endif
169
170 #include <sys/param.h>
171
172 #ifndef AFS_SGI64_ENV
173 #include <sys/user.h>
174 #endif
175
176 #ifndef AFS_LINUX20_ENV
177 #include <sys/socket.h>
178 #endif
179
180 /*
181  * On SGIs, when _KERNEL is defined, <netinet/in.h> declares inet_addr()
182  * in a way that conflicts with the declaration in <arpa/inet.h>.
183  *
184  * Here we bring in <netinet/in.h> without _KERNEL defined and restore
185  * _KERNEL afterwards if needed.
186  *
187  * A better solution might be to straighten out which #includes are
188  * sensitive to _KERNEL on SGIs....
189  */
190 #if defined(AFS_SGI_ENV) && defined(_KERNEL)
191 # undef _KERNEL
192 # include <netinet/in.h>        /* struct in_addr */
193 # define _KERNEL 1
194 #else
195 # include <netinet/in.h>        /* struct in_addr */
196 #endif
197
198 #include <arpa/inet.h>          /* inet_ntoa() */
199
200 #if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
201 #ifdef       AFS_SGI_ENV
202 #include <sys/vnode.h>
203 #endif /* AFS_SGI_ENV */
204 #else
205 #ifdef       AFS_MACH_ENV
206 #include <vfs/vfs.h>
207 #include <vfs/vnode.h>
208 #include <sys/inode.h>
209 #else /* AFS_MACH_ENV */
210 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
211 #include <sys/vnode.h>
212 #include <sys/mount.h>
213 #include <ufs/ufs/quota.h> 
214 #include <ufs/ufs/inode.h>
215 #include <ufs/ffs/fs.h> 
216 #else
217 #include "sys/vfs.h"
218 #ifdef AFS_LINUX20_ENV
219 #define UIO_MAXIOV 1 /* don't care */
220 #if __GLIBC_MINOR__ == 0
221 #include <iovec.h>
222 #endif
223 /*#define _TIME_H*/
224 /*#define _SYS_UIO_H */
225 #define _LINUX_SOCKET_H
226 #undef INT_MAX
227 #undef UINT_MAX
228 #undef LONG_MAX
229 #undef ULONG_MAX
230 #define _LINUX_TIME_H
231 #define _LINUX_FCNTL_H
232 #ifdef AFS_S390_LINUX20_ENV
233 #define _S390_STATFS_H
234 #else
235 #ifdef AFS_SPARC64_LINUX20_ENV
236 #define _SPARC64_STATFS_H
237 #define _SPARC_STATFS_H
238 #else
239 #ifdef AFS_SPARC_LINUX20_ENV
240 #define _SPARC_STATFS_H
241 #else
242 #ifdef AFS_ALPHA_LINUX20_ENV
243 #define _ALPHA_STATFS_H
244 #else
245 #define _I386_STATFS_H
246 #endif /* AFS_ALPHA_LINUX20_ENV */
247 #endif /* AFS_SPARC_LINUX20_ENV */
248 #endif /* AFS_SPARC64_LINUX20_ENV */
249 #endif /* AFS_S390_LINUX20_ENV */
250 struct timezone {
251     int a,b;
252 };
253 #if 0/*ndef AFS_ALPHA_LINUX20_ENV*/
254 typedef struct timeval {
255     int tv_sec;
256     int tv_usec;
257 } timeval_t; /* Needed here since KERNEL defined. */
258 #endif /*AFS_ALPHA_LINUX20_ENV*/
259 #if defined(AFSBIG_ENDIAN)
260 #define _LINUX_BYTEORDER_BIG_ENDIAN_H
261 #else
262 #define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
263 #endif
264 /* Avoid problems with timer_t redefinition */
265 #ifndef timer_t
266 #define timer_t ktimer_t
267 #define timer_t_redefined
268 #endif
269 #include <linux/version.h>
270 #include <linux/fs.h>
271 #include <osi_vfs.h>
272 #ifdef timer_t_redefined
273 #undef timer_t
274 #undef timer_t_redefined
275 #endif
276 #else /* AFS_LINUX20_ENV */
277 #ifdef AFS_HPUX110_ENV
278 #define  KERNEL
279 #define  _KERNEL 1
280 /* Declare following so sys/vnode.h will compile with KERNEL defined */
281 #define FILE FILe
282 typedef enum _spustate {        /* FROM /etc/conf/h/_types.h */
283     SPUSTATE_NONE = 0,      /* must be 0 for proper initialization */
284     SPUSTATE_IDLE,          /* spu is idle */
285     SPUSTATE_USER,          /* spu is in user mode */
286     SPUSTATE_SYSTEM,        /* spu is in system mode */
287     SPUSTATE_UNKNOWN,       /* utility code for NEW_INTERVAL() */
288     SPUSTATE_NOCHANGE       /* utility code for NEW_INTERVAL() */
289 } spustate_t;
290 #define k_off_t off_t
291 #include "sys/vnode.h"
292 #undef KERNEL
293 #undef _KERNEL
294 #else  /* AFS_HPUX110_ENV */
295 #include "sys/vnode.h"
296 #endif /* else AFS_HPUX110_ENV */
297 #endif /* else AFS_LINUX20_ENV */
298 #ifdef  AFS_HPUX_ENV
299 #include "sys/inode.h"
300 #else
301 #ifndef AFS_AIX_ENV
302 #ifdef  AFS_SUN5_ENV
303 #include "sys/fs/ufs_inode.h"
304 #else
305 #ifndef AFS_LINUX20_ENV
306 #include "ufs/inode.h"
307 #endif
308 #endif
309 #endif
310 #endif
311 #endif
312 #endif /* AFS_MACH_ENV */
313 #include <signal.h>
314 #endif
315
316 /* AFS includes */
317 #ifdef AFS_AIX41_ENV
318 /* This definition is in rx_machdep.h, currently only for AIX 41 */
319 #define RX_ENABLE_LOCKS
320 /* The following two defines are from rx_machdep.h and are used in rx_
321  * structures.
322  */
323 #define afs_kmutex_t int
324 #define afs_kcondvar_t int
325 #endif /* AFS_AIX41_ENV */
326
327
328 #ifdef AFS_SUN5_ENV
329
330 #define RX_ENABLE_LOCKS
331
332 /**
333   * Removed redefinitions of afs_kmutex_t and afs_kcondvar_t and included
334   * the system header files in which they are defined
335   */
336 #include <sys/mutex.h>
337 #include <sys/condvar.h>
338 typedef kmutex_t afs_kmutex_t;
339 typedef kcondvar_t afs_kcondvar_t;
340 #endif /* AFS_SUN5_ENV */
341
342 #ifdef AFS_DUX40_ENV
343 #define RX_ENABLE_LOCKS
344 typedef struct {
345      unsigned long lock;
346      void *owner;
347 } afs_kmutex_t;
348 typedef int afs_kcondvar_t;
349 #endif /* AFS_DUX40_ENV */
350
351 #ifdef AFS_HPUX110_ENV
352 #define RX_ENABLE_LOCKS
353 typedef struct {
354         void  *s_lock;
355         int     count;
356         long sa_fill1;
357         void *wait_list;
358         void *sa_fill2[2];
359         int sa_fill2b[2];
360         long  sa_fill2c[3];
361         int sa_fill2d[16];
362         int order;
363         int sa_fill3;
364 } afs_kmutex_t;
365 typedef char *afs_kcondvar_t;
366 #endif /* AFS_HPUX110_ENV */
367
368 #ifdef AFS_SGI65_ENV
369 #define RX_ENABLE_LOCKS 1
370 typedef struct {
371     __psunsigned_t opaque1;
372     void *opaque2;
373 } afs_kmutex_t;
374 typedef struct {
375     __psunsigned_t opaque;
376 } afs_kcondvar_t;
377 #endif /* AFS_SGI65_ENV */
378
379 #ifdef AFS_LINUX20_ENV
380 #include <asm/atomic.h>
381 #include <asm/semaphore.h>
382 #define RX_ENABLE_LOCKS 1
383 typedef struct {
384     struct semaphore opaque1;
385     int opaque2;
386 } afs_kmutex_t;
387 typedef void *afs_kcondvar_t;
388 #endif /* AFS_LINUX20_ENV */
389
390 #include <afs/exporter.h>
391 #include <afs/nfsclient.h>
392 /*#include "afs/osi.h"*/
393
394 typedef struct {
395     int tv_sec;
396     int tv_usec;
397 } osi_timeval_t; /* Needed here since KERNEL defined. */
398
399 /*#include "afs/volerrors.h"*/
400 #ifdef AFS_LINUX20_ENV
401 #define _SYS_TIME_H
402 #endif
403
404 #include <afs/afsint.h>
405 #include "../vlserver/vldbint.h"
406 #include "../afs/lock.h"
407
408 #define KERNEL
409
410 #ifndef notdef
411 #define AFS34
412 #define AFS33
413 #define AFS32a
414 #else
415 #define AFS32
416 #endif
417
418
419 #ifdef AFS_SGI61_ENV
420 extern off64_t lseek64();
421 #define KDUMP_SIZE_T size_t
422 #else /* AFS_SGI61_ENV */
423 #define KDUMP_SIZE_T int
424 #endif /* AFS_SGI61_ENV */
425
426 #include "../afs/afs.h"         /* XXXX Getting it from the obj tree XXX */
427 #include "../afs/afs_axscache.h" /* XXXX Getting it from the obj tree XXX */
428 #include <afs/afs_stats.h>
429
430 #include <afs/cmd.h>
431 #include <rx/rx.h>
432
433
434 #undef  KERNEL
435
436 #if defined(AFS_OSF_ENV) && !defined(v_count)
437 #define v_count         v_usecount
438 #endif
439
440 #ifdef  AFS_OSF_ENV
441 #define KERNELBASE      0x80000000
442 #define coreadj(x)      ((int)x - KERNELBASE)
443 #endif
444
445 #if defined(AFS_SGI_ENV)
446 #define UNIX "/unix"
447 #else
448 #if     defined(AFS_HPUX100_ENV)
449 #define UNIX "/stand/vmunix"
450 #else
451 #ifdef  AFS_HPUX_ENV
452 #define UNIX  "/hp-ux"
453 #else
454 #ifdef  AFS_SUN5_ENV
455 #define UNIX  "/dev/ksyms"
456 #else
457 #define UNIX  "/vmunix"
458 #endif
459 #endif  /* AFS_HPUX_ENV */
460 #endif  /* AFS_HPUX100_ENV */
461 #endif  /* AFS_SGI_ENV */
462
463 #if     defined(AFS_SUN5_ENV)
464 #define CORE "/dev/mem"
465 #else
466 #define CORE "/dev/kmem"
467 #endif
468
469 /* Forward declarations */
470 void print_Conns();
471 void print_cbHash();
472 void print_DindexTimes();
473 void print_DdvnextTbl();
474 void print_DdcnextTbl();
475 void print_DindexFlags();
476 void print_buffers();
477 void print_allocs();
478 void kread(int kmem,off_t loc,void *buf,KDUMP_SIZE_T len);
479 void print_exporter();
480 void print_nfsclient();
481 void print_unixuser();
482 void print_cell();
483 void print_server();
484 void print_conns();
485 void print_conn();
486 void print_volume();
487 void print_venusfid();
488 void print_vnode();
489 void print_vcache();
490 void print_dcache();
491 void print_bkg();
492 void print_vlru();
493 void print_dlru();
494 void print_callout();
495 void print_dnlc();
496 void print_global_locks();
497 void print_global_afs_resource();
498 void print_global_afs_cache();
499 void print_rxstats();
500 void print_rx();
501 void print_services();
502 #ifdef KDUMP_RX_LOCK
503 void print_peertable_lock();
504 void print_conntable_lock();
505 void print_calltable_lock();
506 #endif
507 void print_peertable();
508 void print_conntable();
509 void print_calltable();
510 void print_eventtable();
511 void print_upDownStats();
512 void print_cmperfstats();
513 void print_cmstats();
514
515
516
517
518 #ifndef AFS_KDUMP_LIB
519 extern struct cmd_syndesc *cmd_CreateSyntax();
520 #endif
521 extern int errno;
522 int opencore();
523
524 /* Note: this should agree with the definition in afs_buffer.c */
525 #if     defined(AFS_OSF_ENV)
526 #define AFS_USEBUFFERS  1
527 #endif
528
529 struct buffer {
530 #ifdef AFS_SGI62_ENV
531     ino64_t fid[1];
532 #else
533     afs_int32 fid[1];
534 #endif
535     afs_int32 page;
536     afs_int32 accesstime;
537     struct buffer *hashNext;
538     char *data;
539     char lockers;
540     char b_dirty;
541     char hashIndex;
542 #if AFS_USEBUFFERS
543     struct buf *bufp;
544 #endif
545     afs_rwlock_t lock;          /* the lock for this structure */
546 };
547
548
549 #if     defined(AFS_HPUX_ENV) && defined(__LP64__)
550 #define afs_nlist nlist64
551 #define AFSNLIST(N, C) nlist64((N), (C))
552 #else   /* defined(AFS_HPUX_ENV) && defined(__LP64__) */
553 #ifdef AFS_SGI61_ENV
554 #ifdef AFS_32BIT_KERNEL_ENV
555 #define afs_nlist nlist
556 #define AFSNLIST(N, C) nlist((N), (C))
557 #else
558 #define afs_nlist nlist64
559 #define AFSNLIST(N, C) nlist64((N), (C))
560 #endif /* AFS_32BIT_KERNEL_ENV */
561 #else /* AFS_SGI61_ENV */
562 #ifdef AFS_LINUX20_ENV
563 struct afs_nlist {
564     char *n_name;
565     unsigned long n_value;
566 };
567 #else /* AFS_LINUX20_ENV */
568 #define afs_nlist nlist
569 #endif /* AFS_LINUX20_ENV */
570 #define AFSNLIST(N, C) nlist((N), (C))
571 #endif /* AFS_SGI61_ENV */
572 #endif  /* defined(AFS_HPUX_ENV) && defined(__LP64__) */
573
574 char *obj = UNIX, *core = CORE;
575 int kmem;
576
577 int Dcells = 0, Dusers = 0, Dservers = 0, Dconns = 0, Dvols = 0, Ddvols = 0, mem = 0;
578 int Dvstats = 0, Ddstats = 0, Dnfs = 0, Dglobals = 0, Dstats = 0, Dlocks = 0, Dall = 1;
579 int Dindextimes = 0, Dindexflags = 0, Dvnodes = 0, Dbuffers=0, DCallbacks = 0, Dallocs=0, UserLevel=0;
580 int DdvnextTbl = 0, DdcnextTbl = 0;
581 int Nconns = 0, Drxstats = 0, Drx = 0, Dbkg=0, Dvlru=0, Ddlru=0, Dcallout=0;
582 int Ddnlc = 0;
583 int Dgcpags = 0;
584
585 #if     defined(AFS_SUN5_ENV)
586 #include <string.h>
587 #include <sys/types.h>
588 #include <sys/signal.h>
589 #include <sys/elf.h>
590 #include <libelf.h>
591 #include <sys/elf_M32.h>
592 #ifndef AFS_SUN54_ENV
593 typedef ulong_t k_fltset_t;             /* XXXXXXXXXXX */
594 #endif  /* !AFS_SUN54_ENV */
595 #include <sys/proc.h>
596 #include <sys/file.h>
597 #define _NLIST_H                        /* XXXXXXXXXXXXX */
598 #include <kvm.h>
599 kvm_t *kd;
600 #endif  /* defined(AFS_SUN5_ENV) */
601
602 /* Pretty Printers - print real IP addresses and the like if running
603  * in interpret_mode.
604  */
605 int pretty = 1;
606
607 char *PrintIPAddr(int addr)
608 {
609     static char str[32];
610     struct in_addr in_addr;
611
612     if (pretty) {
613        if (addr == 1) {
614           strcpy(str, "local");
615        } else {
616           in_addr.s_addr = addr;
617           (void) strcpy(str, inet_ntoa(in_addr));
618        }
619     } else {
620        (void) sprintf(str, "%x", addr);
621     }
622     return (char*)str;
623 }
624
625 #ifdef AFS_LINUX20_ENV
626 /* Find symbols in a live kernel. */
627 #include <stdio.h>
628 #include <stdlib.h>
629 #include <string.h>
630
631 #define KSYMS "/proc/ksyms"
632
633 /* symlist_t contains all the kernel symbols. Forcing a 64 byte array is
634  * a bit wasteful, but simple.
635  */
636 #define MAXNAMELEN 64
637 typedef struct symlist {
638     char s_name[MAXNAMELEN];
639     int s_value;
640 } symlist_t;
641
642 #define KSYM_ALLOC_STEP 128
643 #define KSYM_ALLOC_BASE 1024
644 symlist_t *ksyms = NULL;
645 int nksyms = 0;
646 int availksyms = 0;
647
648 #define MAXLINE 1024
649
650 int compare_strings(const void *a, const void *b)
651 {
652     symlist_t *syma = (symlist_t*)a;
653     symlist_t *symb = (symlist_t*)b;
654     return strcmp(syma->s_name, symb->s_name);
655 }
656
657 /* Read in all the kernel symbols */
658 void read_ksyms(void)
659 {
660     FILE *fp;
661     char line[MAXLINE];
662     char *p, *q;
663
664     if (ksyms)
665         return;
666
667     fp = fopen(KSYMS, "r");
668     if (fp == NULL) {
669         printf("Can't open %s, exiting.\n", KSYMS);
670         exit(1);
671     }
672
673     availksyms = KSYM_ALLOC_BASE;
674     ksyms = (symlist_t*)malloc(availksyms * sizeof(symlist_t));
675     if (!ksyms) {
676         printf("Can't malloc %d elements for symbol list.\n", availksyms);
677         exit(1);
678     }
679
680     /* proc is organized as <addr> <name> <module> */
681     while (fgets(line, MAXLINE, fp)) {
682         if (nksyms >= availksyms) {
683             availksyms += KSYM_ALLOC_STEP;
684             ksyms = (symlist_t*)realloc(ksyms, availksyms * sizeof(symlist_t));
685             if (!ksyms) {
686                 printf("Failed to realloc %d symbols.\n", availksyms);
687                 exit(1);
688             }
689         }
690         ksyms[nksyms].s_value = (int)strtoul(line, &p, 16);
691         p++;
692         q = strchr(p, '\t');
693         if (q) *q = '\0';
694         if (strlen(p) >= MAXLINE) {
695             printf("Symbol '%s' too long, ignoring it.\n", p);
696             continue;
697         }
698         (void) strcpy(ksyms[nksyms].s_name, p);
699         nksyms++;
700     }
701
702     /* Sort them in lexical order */
703     qsort(ksyms, nksyms, sizeof(symlist_t), compare_strings);
704
705
706
707
708 /* find_symbol returns 0 if not found, otherwise value for symbol */
709 int find_symbol(char *name)
710 {
711     symlist_t *tmp;
712     symlist_t entry;
713
714     if (!ksyms)
715         read_ksyms();
716
717     (void) strcpy(entry.s_name, name);
718     tmp = (symlist_t*)bsearch(&entry, ksyms, nksyms, sizeof(symlist_t),
719                               compare_strings);
720
721     return tmp ? tmp->s_value : 0;
722 }
723
724 /* nlist fills in values in list until a null name is found. */
725 int nlist(void *notused, struct afs_nlist *nlp)
726 {
727     for ( ; nlp->n_name && *nlp->n_name; nlp++)
728         nlp->n_value = find_symbol(nlp->n_name);
729
730     return 0;
731 }
732
733 #endif
734
735 #if     defined(AFS_SUN5_ENV)
736 #ifdef  _LP64
737 Elf64_Sym       *tbl;
738 #else
739 Elf32_Sym       *tbl;   /* symbol tbl */
740 #endif
741 char *tblp;     /* ptr to symbol tbl */
742 int scnt = 0;
743
744 #ifdef  _LP64
745 Elf64_Sym *symsrch(s)
746     char *s;
747 {
748     Elf64_Sym *sp;
749 #else
750 Elf32_Sym *symsrch(s)
751     char *s;
752 {
753     Elf32_Sym *sp;
754 #endif  /** _LP64 **/
755     char *name;
756     unsigned char type;
757
758     for (sp = tbl; sp < &tbl[scnt]; sp++) {
759 #ifdef _LP64
760         type = ELF64_ST_TYPE(sp->st_info);
761 #else
762         type = ELF32_ST_TYPE(sp->st_info);
763 #endif  /** _LP64 **/
764         if (((type == STB_LOCAL) || (type == STB_GLOBAL) ||
765              (type == STB_WEAK)) && ((afs_uint32)sp->st_value >= 0x10000)) {
766             name = tblp + sp->st_name;
767             if (!strcmp(name, s)) 
768                 return (sp);
769         }
770     }
771     return (0);
772 }
773
774 #endif  /*defined(AFS_SUN5_ENV)*/
775
776
777 #ifndef AFS_KDUMP_LIB
778 static cmdproc(as, arock)
779 register struct cmd_syndesc *as;
780 afs_int32 arock; {
781     register afs_int32 code = 0;
782
783     if (as->parms[0].items) { /* -kobj */
784         obj = as->parms[0].items->data;
785     } 
786     if (as->parms[1].items) { /* -kcore */
787         core = as->parms[1].items->data;
788     } 
789     if (as->parms[2].items) { /* -cells */
790         Dcells = 1, Dall = 0;
791     } 
792     if (as->parms[3].items) { /* -users */
793         Dusers = 1, Dall = 0;
794     } 
795     if (as->parms[4].items) { /* -servers */
796         Dservers = 1, Dall = 0;
797     } 
798     if (as->parms[5].items) { /* -conns */
799         Dconns = 1, Dall = 0;
800     } 
801     if (as->parms[6].items) { /* -volumes */
802         Dvols = 1, Dall = 0;
803     } 
804     if (as->parms[7].items) { /* -dvolumes */
805         Ddvols = 1, Dall = 0;
806     } 
807     if (as->parms[8].items) { /* -vstats */
808         Dvstats = 1, Dall = 0;
809     } 
810     if (as->parms[9].items) { /* -dstats */
811         Ddstats = 1, Dall = 0;
812     } 
813     if (as->parms[10].items) { /* -nfstats */
814         Dnfs = 1, Dall = 0;
815     } 
816     if (as->parms[11].items) { /* -globals */
817         Dglobals = 1, Dall = 0;
818     } 
819     if (as->parms[12].items) { /* -stats */
820         Dstats = 1, Dall = 0;
821     } 
822     if (as->parms[13].items) { /* -locks */
823         Dlocks = 1, Dall = 0;
824     } 
825     if (as->parms[14].items) { /* -mem */
826         mem = 1;
827     } 
828     if (as->parms[15].items) { /* -rxstats */
829         Drxstats = 1, Dall = 0;
830     } 
831     if (as->parms[16].items) { /* -rx */
832         Drx = 1, Dall = 0;
833     } 
834     if (as->parms[17].items) { /* -timestable */
835         Dindextimes = 1, Dall = 0;
836     } 
837     if (as->parms[18].items) { /* -flagstable */
838         Dindexflags = 1, Dall = 0;
839     } 
840     if (as->parms[19].items) { /* -cbhash */
841         DCallbacks = 1, Dall = 0;
842     } 
843     if (as->parms[20].items) { /* -vnodes */
844         Dvnodes = 1, Dall = 0;
845     } 
846     if (as->parms[21].items) { /* -buffers */
847         Dbuffers = 1, Dall = 0;
848     } 
849     if (as->parms[22].items) { /* -allocedmem */
850         Dallocs = 1, Dall = 0;
851     } 
852     if (as->parms[23].items) { /* -user */
853         UserLevel = 1;
854     } 
855     if (as->parms[24].items) { /* -bkg */
856         Dbkg = 1, Dall = 0;
857     } 
858     if (as->parms[25].items) { /* -vlru */
859         Dvlru = 1, Dall = 0;
860     } 
861     if (as->parms[26].items) { /* -callout */
862         Dcallout = 1, Dall = 0;
863     } 
864     if (as->parms[27].items) { /* -dnlc */
865         Ddnlc = 1, Dall = 0;
866     } 
867     if (as->parms[28].items) { /* -dlru */
868         Ddlru = 1, Dall = 0;
869     }
870
871     if (as->parms[29].items) { /* -raw */
872         pretty = 0;
873     }
874
875     if (as->parms[30].items) { /* -gcpags */
876         Dgcpags = 1, Dall = 0;
877     }
878
879     if (as->parms[31].items) { /* -dhash */
880         DdvnextTbl = 1, DdcnextTbl = 1, Dall = 0;
881     }
882
883     code = kdump();
884     return code;
885 }
886
887 #include "AFS_component_version_number.c"
888
889 main(argc, argv)
890 int argc;
891 char **argv; {
892     register struct cmd_syndesc *ts;
893     register afs_int32 code;
894
895 #ifdef  AFS_AIX32_ENV
896     struct sigaction nsa;
897     
898     sigemptyset(&nsa.sa_mask);
899     nsa.sa_handler = SIG_DFL;
900     nsa.sa_flags = SA_FULLDUMP;
901     sigaction(SIGSEGV, &nsa, NULL);
902 #endif
903
904     ts = cmd_CreateSyntax((char *) 0, cmdproc, 0, "Read internal cache manager structs");
905     cmd_AddParm(ts, "-kobj", CMD_SINGLE, CMD_OPTIONAL, "kernel object (default /vmunix)");
906     cmd_AddParm(ts, "-kcore", CMD_SINGLE, CMD_OPTIONAL, "kernel core image (default /dev/kmem)");
907     cmd_AddParm(ts, "-cells", CMD_FLAG, CMD_OPTIONAL, "cell state");
908     cmd_AddParm(ts, "-users", CMD_FLAG, CMD_OPTIONAL, "users state");
909     cmd_AddParm(ts, "-servers", CMD_FLAG, CMD_OPTIONAL, "servers state");
910     cmd_AddParm(ts, "-conns", CMD_FLAG, CMD_OPTIONAL, "conns state");
911     cmd_AddParm(ts, "-volumes", CMD_FLAG, CMD_OPTIONAL, "incore volume state");
912     cmd_AddParm(ts, "-dvolumes", CMD_FLAG, CMD_OPTIONAL, "disk volume state");
913     cmd_AddParm(ts, "-vstats", CMD_FLAG, CMD_OPTIONAL, "stat file state");
914     cmd_AddParm(ts, "-dstats", CMD_FLAG, CMD_OPTIONAL, "file data state");
915     cmd_AddParm(ts, "-nfstats", CMD_FLAG, CMD_OPTIONAL, "nfs translator state");
916     cmd_AddParm(ts, "-globals", CMD_FLAG, CMD_OPTIONAL, "general global state");
917     cmd_AddParm(ts, "-stats", CMD_FLAG, CMD_OPTIONAL, "general cm performance state");
918     cmd_AddParm(ts, "-locks", CMD_FLAG, CMD_OPTIONAL, "global cm related locks state");
919     cmd_AddParm(ts, "-mem", CMD_FLAG, CMD_OPTIONAL, "core represents the physical mem (i.e. /dev/mem) and not virtual");
920     cmd_AddParm(ts, "-rxstats", CMD_FLAG, CMD_OPTIONAL, "general rx statistics");
921     cmd_AddParm(ts, "-rx", CMD_FLAG, CMD_OPTIONAL, "all info about rx");
922     cmd_AddParm(ts, "-timestable", CMD_FLAG, CMD_OPTIONAL, "dcache LRU info table");
923     cmd_AddParm(ts, "-flagstable", CMD_FLAG, CMD_OPTIONAL, "dcache flags info table");
924     cmd_AddParm(ts, "-cbhash", CMD_FLAG, CMD_OPTIONAL, "vcache hashed by cbExpires");
925     cmd_AddParm(ts, "-vnodes", CMD_FLAG, CMD_OPTIONAL, "afs vnodes");
926     cmd_AddParm(ts, "-buffers", CMD_FLAG, CMD_OPTIONAL, "afs dir buffer cache");
927     cmd_AddParm(ts, "-allocedmem", CMD_FLAG, CMD_OPTIONAL, "allocated memory");
928     cmd_AddParm(ts, "-user", CMD_FLAG, CMD_OPTIONAL, "core is from a user-level program");
929     cmd_AddParm(ts, "-bkg", CMD_FLAG, CMD_OPTIONAL, "background daemon info");
930     cmd_AddParm(ts, "-vlru", CMD_FLAG, CMD_OPTIONAL, "vcache lru list");
931     cmd_AddParm(ts, "-callout", CMD_FLAG, CMD_OPTIONAL, "callout info (aix only)");
932     cmd_AddParm(ts, "-dnlc", CMD_FLAG, CMD_OPTIONAL, "DNLC table,freelist,trace");
933     cmd_AddParm(ts, "-dlru", CMD_FLAG, CMD_OPTIONAL, "dcache lru list");
934
935
936     cmd_AddParm(ts, "-raw", CMD_FLAG, CMD_OPTIONAL, "show raw values");
937     cmd_AddParm(ts, "-gcpags", CMD_FLAG, CMD_OPTIONAL, "PAG garbage collection info");
938     cmd_AddParm(ts, "-dhash", CMD_FLAG, CMD_OPTIONAL, "show dcache hash chains");
939
940     code = cmd_Dispatch(argc, argv);
941     return code;
942 }
943 #endif /* !AFS_KDUMP_LIB */
944
945 #ifdef  AFS_AIX_ENV
946 #ifndef AFS_KDUMP_LIB
947 Knlist(sp, cnt, size) 
948 struct afs_nlist *sp;
949 int cnt, size;
950 {
951     register int code;
952
953     if (UserLevel)
954         code = nlist(obj, sp);
955     else
956         code = knlist(sp, cnt, size);
957     return code;
958 }
959 #endif /*AFS_KDUMP_LIB */
960 #endif
961
962 #if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
963 int
964 findsym( char *sname, off_t *offset )
965 {
966 #if     defined(AFS_SUN5_ENV)
967 #ifdef  _LP64
968         Elf64_Sym *ss_ans;
969 #else
970         Elf32_Sym *ss_ans;
971 #endif
972         ss_ans = symsrch(sname);
973         if (!ss_ans) {
974             printf("(WARNING) Couldn't find %s in %s. Proceeding..\n",
975                     sname, obj);
976             *offset = 0;
977             return 0;
978         }
979         *offset = ss_ans->st_value;
980         return 1;
981 #else   /* defined(AFS_SUN5_ENV) */
982 #if     defined(AFS_AIX_ENV)
983         if (!UserLevel) {
984             struct afs_nlist nl;
985             nl.n_name = sname;
986             if (Knlist(&nl, 1, sizeof nl) == -1 ) {
987                 printf("(WARNING) knlist: couldn't find %s. Proceeding...",
988                         sname); 
989                 *offset = 0;
990                 return 0;
991             }
992             *offset = nl.n_value;
993             return 1;
994         }
995 #endif  /* defined(AFS_AIX_ENV) */
996         {
997             struct afs_nlist request[2];
998
999             memset(request, 0, sizeof request);
1000             request[0].n_name = sname;
1001             if (AFSNLIST(obj, request) < 0) {
1002                 fprintf(stderr, "nlist(%s, %s) failure: %d (%s)\n",
1003                         obj, sname,
1004                         errno, strerror(errno));
1005                 exit(1);
1006             }
1007
1008 #if     defined(AFS_OSF_ENV)
1009             if (mem) {
1010                 long X;
1011
1012                 X = coreadj(request[0].n_value);
1013                 request[0].n_value = X;
1014             }
1015 #endif  /* defined(AFS_OSF_ENV) */
1016
1017             *offset = request[0].n_value;           
1018             if (!request[0].n_value) {
1019                 printf("(WARNING) Couldn't find %s in %s. Proceeding..\n",
1020                         sname, obj);
1021                 return 0;
1022             }
1023             return 1;
1024         }
1025 #endif  /* defined(AFS_SUN5_ENV) */
1026 }
1027 #endif
1028
1029 #define CBHTSIZE 128
1030
1031 kdump()
1032 {
1033     int cell, cnt, cnt1;
1034 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
1035    printf("Kdump not supported\n");
1036 #else
1037 #ifndef AFS_KDUMP_LIB
1038
1039     kmem = opencore(core);
1040
1041 #endif /* AFS_KDUMP_LIB */
1042
1043 #ifdef KDUMP_RX_LOCK
1044     /* Test to see if kernel is using RX_ENABLE_LOCKS in rx structs. */
1045 #ifdef AFS_SGI53_ENV
1046 #ifdef AFS_SGI64_ENV
1047     use_rx_lock = 1; /* Always using fine gain locking. */
1048 #else
1049     use_rx_lock = (sysmp(MP_NPROCS) > 1) ? 1 : 0;
1050 #endif
1051 #endif /* AFS_SGI53_ENV */
1052 #endif /* KDUMP_RX_LOCK */
1053
1054     if (Dcells || Dall) {
1055         print_cells(1); /* Handle the afs_cells structures */
1056     }
1057
1058     if (Dusers || Dall) {
1059         print_users(1); /* Handle the afs_users structs */
1060     }   
1061
1062     if (Dservers || Dall) {
1063         print_servers(1);/* Handle the afs_servers structs */
1064     }
1065
1066     if (Dconns) {
1067         print_Conns(1); /* Handle the afs_servers structs */
1068     }
1069
1070     if (Dvols || Dall) {
1071         print_volumes(1);       /* Handle the afs_volumes structs */
1072     }
1073
1074     if (Ddvols || Dall) {
1075         printf("\n\nIGNORE reading the 'volumeinfo' file for now (NOT IMPORTANT)!\n");
1076     }
1077
1078     if (DCallbacks || Dall) {
1079         print_cbHash(1);      /* Handle the cbHashT table of queued vcaches */
1080     }
1081
1082     if (Dvstats || Dall || Dvnodes) {
1083         print_vcaches(1);       /* Handle the afs_vcaches structs */
1084     }
1085
1086     if (Ddstats || Dall) {
1087         print_dcaches(1);
1088     }
1089
1090     if (Dindextimes || Dall) {
1091         print_DindexTimes(1);   
1092     }
1093
1094     if (Dindexflags || Dall) {
1095         print_DindexFlags(1);   
1096     }
1097
1098     if (DdvnextTbl || Dall) {
1099         print_DdvnextTbl(1);    
1100     }
1101
1102     if (DdcnextTbl || Dall) {
1103         print_DdcnextTbl(1);    
1104     }
1105
1106     if (Dbuffers || Dall) {
1107         print_buffers(1);
1108     }
1109
1110     if (Dnfs || Dall) {
1111         print_nfss(1);
1112     }
1113
1114     if (Dstats || Dall) {
1115         off_t symoff;
1116         struct afs_CMStats afs_cmstats;
1117         struct afs_stats_CMPerf afs_cmperfstats;
1118
1119         printf("\n\nPrinting count references to cm-related functions..\n\n");
1120         findsym( "afs_cmstats", &symoff);
1121         kread(kmem, symoff, (char *) &afs_cmstats, sizeof afs_cmstats);
1122         print_cmstats(&afs_cmstats);
1123         printf("\n\nPrinting some cm struct performance stats..\n\n");
1124         findsym( "afs_stats_cmperf", &symoff);
1125         kread(kmem, symoff, (char *) &afs_cmperfstats, sizeof afs_cmperfstats);
1126         print_cmperfstats(&afs_cmperfstats);
1127
1128     }
1129     if (Dlocks || Dall) {
1130         print_global_locks(kmem);
1131     }
1132     if (Dglobals || Dall) {
1133         printf("\n\nPrinting Misc afs globals...\n");
1134         print_global_afs_resource(kmem);
1135         print_global_afs_cache(kmem);
1136     }
1137     if (Dbkg || Dall) {
1138         print_bkg(kmem);
1139     }
1140     if (Dvlru || Dall) {
1141         print_vlru(kmem);
1142     }
1143     if (Ddlru || Dall) {
1144         print_dlru(kmem);
1145     }
1146     if (Drxstats || Dall) {
1147         print_rxstats(kmem);
1148     }    
1149     if (Drx || Dall) {
1150         print_rx(kmem);
1151     }
1152 #ifndef AFS_KDUMP_LIB
1153     if (Dallocs || Dall) {
1154         print_allocs(1);
1155     }
1156 #endif
1157     if (Dcallout || Dall) {
1158         print_callout(kmem);
1159     }
1160     if (Ddnlc || Dall) {
1161         print_dnlc(kmem);
1162     }
1163     if (Dgcpags || Dall) {
1164         print_gcpags(1);
1165     }
1166 #endif
1167     return 0;
1168 }
1169
1170 #if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
1171 int Sum_cellnames=0, Sum_userstp=0, Sum_volnames=0, Sum_exps=0, Sum_nfssysnames=0;
1172 int Sum_vcachemvids=0, Sum_vcachelinkData=0, Sum_vcacheacc=0, Sum_vcachelocks=0;
1173
1174 int print_cells(pnt)
1175 int pnt;
1176 {
1177     off_t symoff;
1178     struct cell *cells, cle, *clentry = &cle, *clep; 
1179     long j=0, cell;
1180     struct afs_q CellLRU, lru, *vu = &lru, *tq, *uq;
1181     u_long lru_addr;
1182
1183     if (pnt) printf("\n\nPrinting Cells' LRU list...\n");
1184     findsym( "CellLRU", &symoff);
1185     kread(kmem, symoff, (char *) &CellLRU, sizeof CellLRU);
1186     lru_addr = (u_long)symoff;
1187     for (tq = CellLRU.next; (u_long)tq != lru_addr; tq = uq) {
1188         clep = QTOC(tq);
1189         kread(kmem, (off_t)tq, (char *)vu, sizeof CellLRU);
1190         uq = vu->next;
1191         kread(kmem, (off_t)clep, (char *) clentry, sizeof *clentry);
1192         print_cell(kmem, clentry, clep, pnt);
1193         j++;
1194     }
1195     if (pnt) printf("... found %d 'afs_cells' entries\n", j);
1196     return j;
1197 }
1198
1199 int print_users(pnt)
1200 int pnt;
1201 {
1202     off_t symoff;
1203     struct unixuser *afs_users[NUSERS], ue,*uentry= &ue, *uep;
1204     int i, j;
1205
1206     if (pnt) printf("\n\nPrinting 'afs_users' structures...\n");
1207     findsym( "afs_users", &symoff);
1208     kread(kmem, symoff, (char *) afs_users, sizeof afs_users);
1209     for (i=0,j=0; i < NUSERS; i++) {
1210         for (uep = afs_users[i]; uep; uep = uentry->next, j++) {
1211             kread(kmem, (off_t) uep, (char *)uentry, sizeof *uentry);
1212             print_unixuser(kmem, uentry, uep, pnt);
1213         }
1214     }
1215     if (pnt) printf("... found %d 'afs_users' entries\n", j);
1216     return j;
1217 }
1218
1219 struct server **serversFound = NULL;
1220 afs_int32 NserversFound = 0;
1221 #define SF_ALLOCATION_STEP 500
1222
1223 int add_found_server(sep)
1224 struct server *sep;
1225 {
1226     static afs_int32 NserversAllocated = 0;
1227     static afs_int32 failed = 0;
1228
1229     if (failed)
1230         return -1;
1231
1232     if (NserversFound >= NserversAllocated) {
1233         NserversAllocated += SF_ALLOCATION_STEP;
1234         if (!serversFound) {
1235             serversFound =
1236                 (struct server **)malloc(NserversAllocated
1237                                         * sizeof(struct server *));
1238         } else {
1239             serversFound =
1240                 (struct server **)realloc((char*)serversFound,
1241                                          NserversAllocated
1242                                          * sizeof(struct server *));
1243         }
1244         if (!serversFound) {
1245             printf("Can't allocate %lu bytes for list of found servers.\n",
1246                 NserversAllocated *  sizeof(struct server *));  
1247             failed = 1;
1248             NserversFound = 0;
1249             return -1;
1250         }
1251     }
1252     serversFound[NserversFound++] = sep;
1253     return 0;
1254 }
1255
1256 int find_server(sep)
1257 struct server *sep;
1258 {
1259     int i;
1260
1261     for (i=0; i<NserversFound; i++) {
1262         if (sep == serversFound[i])
1263             return 1;
1264     }
1265     return 0;
1266 }
1267         
1268 int print_servers(pnt)
1269 int pnt;
1270 {
1271     off_t symoff;
1272     struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep;
1273     struct srvAddr *afs_srvAddrs[NSERVERS], sa, *sap;
1274     afs_int32 i, nServers, nSrvAddrs, nSrvAddrStructs;
1275     afs_int32 afs_totalServers, afs_totalSrvAddrs;
1276     int failed = 0;
1277     int chainCount[NSERVERS];
1278
1279     if (pnt) {
1280         memset((char*)chainCount, 0, sizeof(chainCount));
1281         printf("\n\nPrinting 'afs_servers' structures...\n");
1282     }
1283     findsym( "afs_servers", &symoff);
1284     kread(kmem, symoff, (char *) afs_servers, NSERVERS * sizeof(long));
1285     for (i=0, nServers=0; i < NSERVERS; i++) {
1286         if (pnt)
1287             printf(" --- Chain %d ---\n", i);
1288         for (sep = afs_servers[i]; sep; sep = sentry->next, nServers++) {
1289             kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
1290             if (pnt && !failed) {
1291                 if (add_found_server(sep)<0)
1292                     failed = 1;
1293             }
1294             if (pnt)
1295                 chainCount[i]++;
1296             if (Dconns || Dall || !pnt)
1297                 print_server(kmem, sentry, sep, 1, pnt);
1298             else
1299                 print_server(kmem, sentry, sep, 0, pnt);
1300         }
1301     }
1302     if (pnt) {
1303         if (Dconns || Dall)
1304             printf("... found %d 'afs_servers' entries (total conns = %d)\n",
1305                    nServers, Nconns);
1306         else
1307             printf("... found %d 'afs_servers' entries\n", nServers);
1308         printf("Chain lengths:\n");
1309         for (i=0; i<NSERVERS; i++) {
1310             printf("%2d: %5d\n", i, chainCount[i]);
1311         }
1312     }
1313     Dconns = 0;
1314
1315
1316     /* Verify against afs_totalServers. */
1317     if (pnt) {
1318         memset((char*)chainCount, 0, sizeof(chainCount));
1319         if (findsym( "afs_totalServers", &symoff)) {
1320             kread(kmem, symoff, (char*)&afs_totalServers, sizeof(afs_int32));
1321             if (afs_totalServers != nServers) {
1322                 printf("ERROR: afs_totalServers = %d, differs from # of servers in hash table.\n", afs_totalServers);
1323             }
1324             else {
1325                 printf("afs_totalServers = %d, matches hash chain count.\n", afs_totalServers);
1326             }
1327         }
1328         
1329         printf("\n\nPrinting 'afs_srvAddr' structures...\n");
1330         if (findsym( "afs_srvAddrs", &symoff)) {
1331             kread(kmem, symoff, (char *) afs_srvAddrs,
1332                   NSERVERS * sizeof(long));
1333             nSrvAddrStructs = 0;
1334             for (i=0, nSrvAddrs=0; i < NSERVERS; i++) {
1335                 printf(" --- Chain %d ---\n", i);
1336                 for (sap = afs_srvAddrs[i]; sap; sap = sa.next_bkt) {
1337                     kread(kmem, (off_t) sap, (char *)&sa,
1338                           sizeof(sa));
1339                     printf("%lx: sa_ip=%s, sa_port=%d, sa_iprank=%d, sa_flags=%x, conns=%lx, server=%lx, nexth=%lx\n",
1340                            sap, PrintIPAddr(sa.sa_ip), sa.sa_portal, sa.sa_iprank,
1341                            sa.sa_flags, sa.conns, sa.server, sa.next_bkt);
1342                     if (sap != (struct srvAddr*)sa.server) {
1343                         /* only count ones not in a server struct. */
1344                         nSrvAddrStructs ++;
1345                     }
1346                     nSrvAddrs ++;
1347                     chainCount[i]++;
1348                     if (!failed) {
1349                         if (!find_server(sa.server)) {
1350                             kread(kmem, (off_t)sa.server, (char *)sentry,
1351                                   sizeof *sentry);
1352                             printf("ERROR: Server missing from hash chain: server=%lx, server->next=%lx\n",
1353                                    sa.server, sentry->next);
1354                             print_server(kmem, sentry, sa.server, 1, pnt);
1355                             printf("----------------------------------------------------\n");
1356                         }
1357                     }
1358
1359                 }
1360             }
1361             printf("... found %d 'afs_srvAddr' entries, %d alloc'd (not in server struct)\n",
1362                    nSrvAddrs, nSrvAddrStructs);
1363             printf("Chain lengths:\n");
1364             for (i=0; i<NSERVERS; i++) {
1365                 printf("%2d: %5d\n", i, chainCount[i]);
1366             }
1367             if (findsym( "afs_totalSrvAddrs", &symoff)) {
1368                 kread(kmem, symoff, (char*)&afs_totalSrvAddrs, sizeof(afs_int32));
1369                 if (afs_totalSrvAddrs != nSrvAddrStructs) {
1370                     printf("ERROR: afs_totalSrvAddrs = %d, differs from number of alloc'd srvAddrs in hash table.\n", afs_totalSrvAddrs);
1371                 }
1372                 else {
1373                     printf("afs_totalSrvAddrs = %d, matches alloc'd srvAddrs in hash chain count.\n", afs_totalSrvAddrs);
1374                 }
1375             }
1376         }
1377     }
1378     return nServers;
1379 }
1380
1381
1382 void
1383 print_Conns(pnt)
1384 int pnt;
1385 {
1386     off_t symoff;
1387     struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep;
1388     afs_int32 i, j;
1389
1390     if (pnt) printf("\n\nPrinting all 'afs_conns' to  the servers...\n");
1391     findsym( "afs_servers", &symoff);
1392     kread(kmem, symoff, (char *) afs_servers, sizeof afs_servers);
1393     for (i=0, j=0; i < NSERVERS; i++) {
1394         for (sep = afs_servers[i]; sep; sep = sentry->next, j++) {
1395             kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
1396             print_server(kmem, sentry, sep, 2, pnt);
1397         }
1398     }
1399     if (pnt) printf("... found %d 'afs_conns' entries\n", Nconns);
1400 }
1401
1402
1403 int print_volumes(pnt)
1404 int pnt;
1405 {
1406     off_t symoff;
1407     struct volume *afs_volumes[NVOLS], ve, *ventry = &ve, *vep;
1408     afs_int32 i, j;
1409
1410     if (pnt) printf("\n\nPrinting 'afs_volumes' structures...\n");
1411     findsym( "afs_volumes", &symoff);
1412     kread(kmem, symoff, (char *) afs_volumes, NVOLS * sizeof(long));
1413     for (i=0, j=0; i < NVOLS; i++) {
1414         for (vep = afs_volumes[i]; vep; vep = ventry->next, j++) {
1415             kread(kmem, (off_t) vep, (char *)ventry, sizeof *ventry);
1416             print_volume(kmem, ventry, vep, pnt);
1417         }
1418     }
1419     if (pnt) printf("... found %d 'afs_volumes' entries\n", j);
1420     return (j);
1421 }
1422
1423 void print_cbHash(pnt)
1424 int pnt;
1425 {
1426     off_t symoff;
1427     struct afs_q cbHashT[CBHTSIZE];
1428     afs_int32 i, j;
1429
1430     if (pnt) printf("\n\nPrinting 'cbHashT' table...\n");
1431     findsym( "cbHashT", &symoff);
1432     kread(kmem, symoff, (char *) cbHashT, sizeof cbHashT);
1433     for (i=0; i < CBHTSIZE; i++) {
1434         if (pnt) printf("%lx: %x %x\n", (long)symoff+8*i, cbHashT[i].prev, cbHashT[i].next);
1435     }
1436     if (pnt) printf("... that should be %d callback hash entries\n", i);
1437 }
1438
1439 int print_vcaches(pnt)
1440 int pnt;
1441 {
1442     off_t symoff;
1443     struct vcache *afs_vhashTable[VCSIZE], Ve, *Ventry = &Ve, *Vep;
1444     afs_int32 i, j;
1445
1446     if (pnt) printf("\n\nPrinting afs_vcaches structures...\n");
1447     if (pnt) printf("print_vcaches: sizeof(struct vcache) = %ld\n", (long) sizeof(struct vcache));
1448     findsym( "afs_vhashT", &symoff);
1449     kread(kmem, symoff, (char *) afs_vhashTable, sizeof afs_vhashTable);
1450     for (i=0, j=0; i < VCSIZE; i++) {
1451         if (pnt)
1452             printf("Printing hash chain %d...\n", i);
1453         for (Vep = afs_vhashTable[i]; Vep; Vep = Ventry->hnext, j++) {
1454             kread(kmem, (off_t) Vep, (char *)Ventry, sizeof *Ventry);
1455             if (Dvstats || Dall || !pnt) 
1456                 print_vcache(kmem, Ventry, Vep, pnt);
1457             if (Dvnodes || Dall) 
1458                 print_vnode(kmem, Ventry, Vep, pnt);
1459         }
1460     }
1461     if (pnt) printf("... found %d 'afs_vcaches' entries\n", j);
1462     return j;
1463 }
1464
1465 int print_dcaches(pnt)
1466 int pnt;
1467 {
1468     off_t symoff;
1469     long table, *ptr;
1470     struct dcache dc, *dcp = &dc, *dp;
1471     afs_int32 i, j, count;
1472     struct afs_q dlru;
1473
1474     /* Handle the afs_dcaches structs */
1475     if (pnt) printf("\n\nPrinting afs_dcache related structures...\n");
1476     findsym( "afs_cacheFiles", &symoff);
1477     kread(kmem, symoff, (char *) &count, sizeof count);
1478     findsym( "afs_indexTable", &symoff);
1479     kread(kmem, symoff, (char *) &table, sizeof(long));
1480     ptr = (long *) malloc(count * sizeof(long));
1481     kread(kmem, table, (char *) ptr, count * sizeof(long));
1482     for (i=0, j=0; i < count; i++) {
1483         if (dp = (struct dcache *)ptr[i]) {
1484             if (pnt) printf("afs_indexTable[%d] %x: ", i, dp);
1485             kread(kmem, (off_t) dp, (char *)dcp, sizeof *dcp);
1486             print_dcache(kmem, dcp, dp, pnt);
1487             j++;
1488         }
1489     }
1490     if (pnt) printf("... found %d 'dcache' entries\n", j);
1491     findsym( "afs_DLRU", &symoff);
1492     kread(kmem, symoff, (char *) &dlru, sizeof(struct afs_q));
1493     if (pnt) printf("DLRU next=0x%x, prev=0x%x\n", dlru.next, dlru.prev);
1494     free(ptr);
1495     
1496     return j;
1497 }
1498
1499
1500 void print_DindexTimes(pnt)
1501 int pnt;
1502 {
1503     off_t symoff;
1504     long table;
1505     afs_hyper_t *ptr;
1506     afs_int32 temp, * indexTime = &temp; 
1507     afs_int32 i, j, count;
1508
1509     /* Handle the afs_indexTimes array */
1510     if (pnt) printf("\n\nPrinting afs_indexTimes[]...\n");
1511     findsym( "afs_cacheFiles", &symoff);
1512     kread(kmem, symoff, (char *) &count, sizeof count);
1513     findsym( "afs_indexTimes", &symoff);
1514     kread(kmem, symoff, (char *) &table, sizeof(long));
1515     ptr = (afs_hyper_t *) malloc(count * sizeof(afs_hyper_t));
1516     kread(kmem, table, (char *) ptr, count * sizeof(afs_hyper_t));
1517     for (i=0, j=0; i < count; i++) {
1518         if (pnt) printf("afs_indexTimes[%d]\t%10d.%d\n", i,
1519                         ptr[i].high, ptr[i].low);
1520 /*      if (dp = (struct dcache *)ptr[i]) {
1521         printf("afs_indexTable[%d] %lx: ", i, dp);
1522         kread(kmem, (off_t) dp, (char *)dcp, sizeof *dcp);
1523         print_dcache(kmem, dcp, dp);
1524         }
1525 */
1526         j++;
1527     }
1528     if (pnt) printf("afs_indexTimes has %d entries\n", j);
1529     free(ptr);
1530 }
1531
1532
1533 void print_DdvnextTbl(pnt)
1534 int pnt;
1535 {
1536     off_t symoff;
1537     long table;
1538     afs_int32 *ptr;
1539     afs_int32 temp, * indexTime = &temp; 
1540     afs_int32 i, j, count;
1541
1542     /* Handle the afs_dvnextTbl arrays */
1543     if (pnt) printf("\n\nPrinting afs_dvnextTbl[]...\n");
1544     findsym( "afs_cacheFiles", &symoff);
1545     kread(kmem, symoff, (char *) &count, sizeof count);
1546     findsym( "afs_dvnextTbl", &symoff);
1547     kread(kmem, symoff, (char *) &table, sizeof(long));
1548     ptr = (afs_int32 *) malloc(count * sizeof(afs_int32));
1549     kread(kmem, table, (char *) ptr, count * sizeof(afs_int32));
1550     for (i=0, j=0; i < count; i++) {
1551         if (pnt) printf("afs_dvnextTbl[%d]\t%d\n", i, ptr[i]);
1552         j++;
1553     }
1554     if (pnt) printf("afs_dvnextTbl has %d entries\n", j);
1555     free(ptr);
1556 }
1557
1558
1559 void print_DdcnextTbl(pnt)
1560 int pnt;
1561 {
1562     off_t symoff;
1563     long table;
1564     afs_int32 *ptr;
1565     afs_int32 temp, * indexTime = &temp; 
1566     afs_int32 i, j, count;
1567
1568     /* Handle the afs_dcnextTbl arrays */
1569     if (pnt) printf("\n\nPrinting afs_dcnextTbl[]...\n");
1570     findsym( "afs_cacheFiles", &symoff);
1571     kread(kmem, symoff, (char *) &count, sizeof count);
1572     findsym( "afs_dcnextTbl", &symoff);
1573     kread(kmem, symoff, (char *) &table, sizeof(long));
1574     ptr = (afs_int32 *) malloc(count * sizeof(afs_int32));
1575     kread(kmem, table, (char *) ptr, count * sizeof(afs_int32));
1576     for (i=0, j=0; i < count; i++) {
1577         if (pnt) printf("afs_dcnextTbl[%d]\t%d\n", i, ptr[i]);
1578         j++;
1579     }
1580     if (pnt) printf("afs_dcnextTbl has %d entries\n", j);
1581     free(ptr);
1582 }
1583
1584
1585 void print_DindexFlags(pnt)
1586 int pnt;
1587 {
1588     off_t symoff;
1589     afs_int32 count;
1590     long table;
1591     unsigned char *flags;
1592     afs_int32 temp, * indexTime = &temp; 
1593     afs_int32 i, j;
1594
1595     /* Handle the afs_indexFlags array */
1596     if (pnt) printf("\n\nPrinting afs_indexFlags[]...\n");
1597     findsym( "afs_cacheFiles", &symoff);
1598     kread(kmem, symoff, (char *) &count, sizeof count);
1599     findsym( "afs_indexFlags", &symoff);
1600     kread(kmem, symoff, (char *) &table, sizeof(long));
1601     flags = (unsigned char *) malloc(count * sizeof(char));
1602     kread(kmem, table, flags, count * sizeof(char));
1603     for (i=0, j=0; i < count; i++) {
1604         if (pnt) printf("afs_indexFlags[%d]\t%4u\n", i, flags[i]);
1605         j++;
1606     }
1607     if (pnt) printf("afs_indexFlags has %d entries\n", j);
1608     free(flags);
1609 }
1610
1611
1612 void print_buffers(pnt)
1613 int pnt;
1614 {
1615     off_t symoff;
1616     long table;
1617     afs_int32 count;
1618     unsigned char *buffers;
1619     struct buffer *bp;
1620     afs_int32 i, j;
1621
1622     if (pnt) printf("\n\nPrinting 'buffers' table...\n");
1623     findsym( "Buffers", &symoff);
1624     kread(kmem, symoff, (char *) &table, sizeof(long));
1625     findsym( "nbuffers", &symoff);
1626     kread(kmem, symoff, (char *) &count, sizeof(int));
1627     buffers = (unsigned char *) malloc(count * sizeof(struct buffer));  
1628     kread(kmem, table, buffers, count * sizeof(struct buffer));
1629     bp = (struct buffer *)buffers;
1630     for (i=0, j=0; i < count; i++, bp++) {
1631 #ifdef AFS_SGI62_ENV
1632         if (pnt) printf("Buffer #%d:\tfid=%llu page=%d, accTime=%d,\n\tHash=%x, data=%x, lockers=%x, dirty=%d, hashI=%d\n",
1633                  i, bp->fid[0], bp->page, bp->accesstime,
1634                  bp->hashNext, bp->data, bp->lockers, bp->b_dirty, bp->hashIndex);
1635 #else
1636         if (pnt) printf("Buffer #%d:\tfid=%lu page=%d, accTime=%d,\n\tHash=%x, data=%x, lockers=%x, dirty=%d, hashI=%d\n",
1637                  i, bp->fid[0], bp->page, bp->accesstime,
1638                  bp->hashNext, bp->data, bp->lockers, bp->b_dirty, bp->hashIndex);
1639 #endif
1640         j++;
1641     }
1642     if (pnt) printf("\n\t   ... that should be %d buffer entries\n", i);
1643 }
1644
1645
1646 int print_nfss(pnt)
1647 int pnt;
1648 {
1649     off_t symoff;
1650     struct afs_exporter *exp_entry, ex, *exp = &ex, *exp1;
1651     struct nfsclientpag  *afs_nfspags[NNFSCLIENTS], e, *entry = &e, *ep;
1652     long i, j, cell;
1653
1654     /* Handle the afs_exporter structures */
1655     if (pnt) printf("\n\nPrinting 'afs_exporters' link list...\n");
1656     findsym( "root_exported", &symoff);
1657     kread(kmem, symoff, (char *) &cell, sizeof(long));
1658     for (exp1 = (struct afs_exporter *) cell, j=0; exp1; exp1 = exp->exp_next, j++) {
1659         kread(kmem, (off_t)exp1, (char *) exp, sizeof *exp);
1660         if (pnt) printf("AFS_EXPORTER(%x): \n", exp1);
1661         print_exporter(kmem, exp, exp1, pnt);
1662         Sum_exps++;
1663     }
1664     if (pnt) printf("... found %d 'afs_exporters' entries\n", j);
1665
1666     /* Handle the afs_nfsclientpags structs */
1667     if (pnt) printf("\n\nPrinting 'afs_nfsclientpags' structures...\n");
1668     if (!findsym( "afs_nfspags", &symoff))
1669         return 0;
1670     kread(kmem, symoff, (char *) afs_nfspags, sizeof afs_nfspags);
1671     for (i=0,j=0; i < NNFSCLIENTS; i++) {
1672         for (ep = afs_nfspags[i]; ep; ep = entry->next, j++) {
1673             kread(kmem, (off_t) ep, (char *) entry, sizeof *entry);
1674             print_nfsclient(kmem, entry, ep, pnt);
1675         }
1676     }
1677     if (pnt) printf("... found %d 'afs_nfsclientpags' entries\n", j);
1678     return j;
1679 }
1680
1681 #if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV)
1682 typedef struct event {
1683     struct event *next;         /* next in hash chain */
1684     char *event;                /* lwp event: an address */
1685     int refcount;               /* Is it in use? */
1686     kcondvar_t cond;            /* Currently associated condition variable */
1687     int seq;                    /* Sequence number: this is incremented
1688                                    by wakeup calls; wait will not return until
1689                                    it changes */
1690 } event_t;
1691 #endif
1692
1693
1694 #ifdef AFS_LINUX22_ENV
1695 /* This is replicated from LINUX/osi_alloc.c */
1696 #define MEM_SPACE sizeof(int)
1697
1698 #define KM_TYPE 1
1699 #define VM_TYPE 2
1700 struct osi_linux_mem {
1701     int mem_next; /* types are or'd into low bits of next */
1702     char data[1];
1703 };
1704 #define MEMTYPE(A) ((A) & 0x3)
1705 #define MEMADDR(A) ((struct osi_linux_mem*)((A) & (~0x3)))
1706 #define PR_MEMTYPE(A) ((MEMTYPE(A) == KM_TYPE) ? "phys" : "virt")
1707 void print_alloced_memlist(void)
1708 {
1709     off_t symoff;
1710     struct osi_linux_mem *memp, memlist, next;
1711     off_t next_addr;
1712     int count;
1713     int n = 0;
1714
1715     findsym( "afs_linux_memlist_size", &symoff);
1716     kread(kmem, symoff, (char*) &count, sizeof count);
1717     findsym( "afs_linux_memlist", &symoff);
1718     kread(kmem, symoff, (char*) &memp, sizeof memp);
1719     if (memp) {
1720         kread(kmem, (int)memp, (char*) &next, sizeof next);
1721     }
1722     else {
1723         memset(&next, 0, sizeof next);
1724     }
1725     printf("Allocated memory list: %d elements\n", count);
1726     printf("%20s %4s %10s\n", "Address", "Type", "Next");
1727     printf("%20lx %4s %10x\n", (long)((char*)memp) + MEM_SPACE,
1728            PR_MEMTYPE(next.mem_next), next.mem_next);
1729     n = 1;
1730     while (next_addr = (off_t) MEMADDR(next.mem_next)) {
1731         n  ++;
1732         memlist = next;
1733         kread(kmem, next_addr, (char*) &next, sizeof next);
1734         printf("%20lx %4s %10x\n", (long) next_addr+MEM_SPACE,
1735                PR_MEMTYPE(next.mem_next), next.mem_next);
1736     }
1737     printf("Found %d elements in allocated memory list, expected %d\n",
1738            n, count);
1739 }
1740 #endif
1741
1742 void print_allocs(pnt)
1743 int pnt;
1744 {
1745     off_t symoff;
1746     long count, i, j, k, l, m, n, T=0, tvs;
1747     struct afs_CMStats afs_cmstats;
1748     struct afs_stats_CMPerf afs_cmperfstats;
1749
1750     findsym( "afs_cmstats", &symoff);
1751     kread(kmem, symoff, (char *) &afs_cmstats, sizeof afs_cmstats);
1752     findsym( "afs_stats_cmperf", &symoff);
1753     kread(kmem, symoff, (char *) &afs_cmperfstats, sizeof afs_cmperfstats);
1754
1755     T += MAXSYSNAME;
1756     printf("\n\n%20s:\t%8d bytes\n", "Sysname area", MAXSYSNAME);
1757
1758     Sum_cellnames=0;
1759     i = print_cells(0);
1760     j = (i * sizeof(struct cell)) + Sum_cellnames;
1761     T += j;
1762     printf("%20s:\t%8d bytes\t[%d cells/%d bytes each + %d bytes for cell names]\n", "Cell package", j, i, sizeof(struct cell), Sum_cellnames);
1763
1764     Sum_userstp=0;
1765     i = print_users(0);
1766     j = (i * sizeof(struct unixuser)) + Sum_userstp;
1767     T += j;
1768     printf("%20s:\t%8d bytes\t[%d users/%d bytes each + %d bytes for secret tokens]\n", "User package", j, i, sizeof(struct unixuser), Sum_userstp);
1769
1770     i = print_servers(0);
1771     j = (i * sizeof(struct server));
1772     T += j;
1773     printf("%20s:\t%8d bytes\t[%d servers/%d bytes each]\n", "Server package", j, i, sizeof(struct server));
1774     j = (Nconns * sizeof(struct conn));
1775     T += j;
1776     printf("%20s:\t%8d bytes\t[%d conns/%d bytes each]\n", "Connection package", j, Nconns, sizeof(struct conn));
1777     
1778     i = (AFS_NCBRS * sizeof(struct afs_cbr)) * (j = afs_cmperfstats.CallBackAlloced);
1779     T += i;
1780     if (i)
1781     printf("%20s:\t%8d bytes\t[%d cbs/%d bytes each]\n", "Server CB free pool", i, (j * AFS_NCBRS), sizeof(struct afs_cbr));
1782
1783     Sum_volnames=0;
1784     i = print_volumes(0);
1785     j = (MAXVOLS * sizeof(struct volume)) + Sum_volnames;
1786     T += j;
1787     printf("%20s:\t%8d bytes\t[%d volumes/%d bytes each + %d bytes for volnames - %d active entries]\n", "Volume package", j, MAXVOLS, sizeof(struct volume), Sum_volnames, i);
1788
1789     Sum_vcachemvids = Sum_vcachelinkData = Sum_vcacheacc = Sum_vcachelocks = 0;
1790     tvs = i = print_vcaches(0);
1791     j = (i * sizeof(struct vcache));
1792 /*    T += j;*/
1793 /*    printf("%20s:\t%d bytes\t[%d vcaches/%d bytes each]\n", "Vcache package", j, i, sizeof(struct vcache));*/
1794 #ifdef  AFS_AIX32_ENV
1795     i = (tvs + Sum_vcachemvids + Sum_vcachelinkData + Sum_vcachelocks) * AFS_SMALLOCSIZ;
1796     printf("%20s:\t%8d bytes\t[%d act gnodes, %d mount pnts, %d symbolic links, %d unix locks]\n", 
1797            "[VC use of sml fp]*",i, tvs, Sum_vcachemvids, Sum_vcachelinkData, Sum_vcachelocks);
1798 #else
1799     i = (Sum_vcachemvids + Sum_vcachelinkData + Sum_vcachelocks) * AFS_SMALLOCSIZ;
1800     printf("%20s:\t8%d bytes\t[%d mount pnts, %d symbolic links, %d unix locks]\n", 
1801            "[VC use of sml fp]*",i, Sum_vcachemvids, Sum_vcachelinkData, Sum_vcachelocks);
1802 #endif
1803
1804 #define NAXSs (1000 / sizeof(struct axscache))
1805 #ifdef  AFS32
1806     i = (NAXSs * sizeof(struct axscache));
1807     T += i;
1808     printf("%20s:\t%8d bytes\t[%d access used by vcaches/%d bytes each]\n", "ACL List free pool", i, Sum_vcacheacc, sizeof(struct axscache));
1809 #else
1810     {
1811     struct axscache *xp, xpe, *nxp = &xpe;
1812
1813     findsym( "afs_xaxscnt", &symoff);
1814     kread(kmem, symoff, (char *) &i, sizeof i);
1815     j = i * (NAXSs * sizeof(struct axscache));
1816     T += j;
1817     printf("%20s:\t%8d bytes\t[%d access used by vcaches/%d bytes each - %d blocks of %d]\n", "ACL List free pool", j, Sum_vcacheacc, sizeof(struct axscache), i, (NAXSs * sizeof(struct axscache)));
1818     }
1819 #endif
1820
1821 #ifdef  AFS32
1822     i = print_dcaches(0);
1823     j = (i * sizeof(struct dcache));
1824     T += j;
1825     printf("%20s:\t%8d bytes\t[%d dcaches/%d bytes each - ONLY USED COUNTED]\n", "Dcache package", j, i, sizeof(struct dcache));
1826 #else
1827     findsym( "afs_dcentries", &symoff);
1828     kread(kmem, symoff, (char *) &i, sizeof i);
1829     j = (i * sizeof(struct dcache));
1830     T += j;
1831     printf("%20s:\t%8d bytes\t[%d dcaches/%d bytes each]\n", "Dcache package", j, i, sizeof(struct dcache));
1832 #endif
1833     findsym( "afs_cacheFiles", &symoff);
1834     kread(kmem, symoff, (char *) &i, sizeof i);
1835     findsym( "afs_cacheStats", &symoff);
1836     kread(kmem, symoff, (char *) &j, sizeof j);
1837
1838     k = (j * sizeof(struct vcache));
1839     printf("%20s:\t%8d bytes\t[%d free vcaches/%d bytes each - %d active entries]\n", "Vcache free list", k, j, sizeof(struct vcache), tvs);
1840     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Dcache Index Table", i * 4, i, 4);
1841 #ifndef AFS32
1842     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Dcache Index Times", i * 8, i, 8);
1843 #else
1844     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Dcache Index Times", i * 4, i, 4);
1845 #endif
1846     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Dcache Index Flags", i, i, 1);
1847 /*    printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Dcache free list", i, i, 1);*/
1848 #ifndef AFS32
1849     T += k + (i*4)+ (i*8) + i;
1850 #else
1851     T += k + (i*4)+ (i*4) + i;
1852 #endif
1853
1854     i = (j = afs_cmperfstats.bufAlloced) * sizeof(struct buffer);
1855     T += i;
1856     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Buffer package", i, j, sizeof(struct buffer));
1857 #if     !AFS_USEBUFFERS
1858 #define AFS_BUFFER_PAGESIZE 2048
1859     i = j * AFS_BUFFER_PAGESIZE;
1860     T += i;
1861     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Xtra Buffer pkg area", i, j, AFS_BUFFER_PAGESIZE);
1862 #endif
1863
1864     Sum_exps = 0;
1865     Sum_nfssysnames = 0;
1866     i = print_nfss(0);
1867     k = Sum_exps * sizeof(struct afs_exporter);
1868     T += k;
1869     if (k)
1870     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Xlator Exporter list", k, Sum_exps, sizeof(struct afs_exporter));
1871
1872     j = (i * sizeof(struct nfsclientpag)) + Sum_nfssysnames;
1873     T += j;
1874     if (j)
1875     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each + %d for remote sysnames]\n", "Xlator Nfs clnt pkg", j, i, sizeof(struct nfsclientpag), Sum_nfssysnames);
1876
1877     i = (j = afs_cmperfstats.LargeBlocksAlloced) * AFS_LRALLOCSIZ;
1878     T += i;
1879     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each - %d active entries]\n", "Large Free Pool", 
1880            i, j, AFS_LRALLOCSIZ, afs_cmperfstats.LargeBlocksActive);
1881
1882     i = (j = afs_cmperfstats.SmallBlocksAlloced) * AFS_SMALLOCSIZ;
1883     T += i;
1884     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each - %d active entries]\n", "Small Free Pool", 
1885            i, j, AFS_SMALLOCSIZ, afs_cmperfstats.SmallBlocksActive);
1886
1887 #if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV)
1888     findsym( "afs_evhashcnt", &symoff);
1889     kread(kmem, symoff, (char *) &j, sizeof j);
1890     i = (j * sizeof(event_t));
1891     T += i;
1892     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "afs glock Event Pool", i, j, sizeof(event_t));
1893 /*    printf("XXXXXXX Count event queue allocs!!!! XXXXXX\n");*/
1894
1895 #endif
1896     i = j =0;
1897     if (findsym( "rxevent_nFree", &symoff))
1898         kread(kmem, symoff, (char *) &j, sizeof j);
1899     if (findsym( "rxevent_nPosted", &symoff))
1900         kread(kmem, symoff, (char *) &i, sizeof i);
1901     k = (i + j) * sizeof(struct rxevent);
1902     if (k) {
1903         T += k;
1904         printf("%20s:\t%8d bytes\t[%d free, %d posted/%d bytes each]\n", "Rx event pkg", 
1905                k, j, i, sizeof(struct rxevent));
1906     } else {
1907         T += (k = 20 * sizeof(struct rxevent));
1908         printf("%20s:\t%8d bytes\t[%d entries/%d bytes each - THIS IS MIN ALLOC/NOT ACTUAL]\n", "Rx event pkg", 
1909                k, 20, sizeof(struct rxevent));
1910     }
1911
1912     findsym("rx_nFreePackets", &symoff);
1913     kread(kmem, symoff, (char *) &count, sizeof count);
1914 /*
1915     findsym("rx_initSendWindow", &symoff);
1916     kread(kmem, symoff, (char *) &i, sizeof i);
1917 */
1918     i=0;
1919     findsym("rx_nPackets", &symoff);
1920     kread(kmem, symoff, (char *) &j, sizeof j);
1921     k = (j + i + 2) * sizeof(struct rx_packet);
1922     T += k;
1923     printf("%20s:\t%8d bytes\t[%d free packets/%d bytes each]\n", "Rx packet freelist", 
1924            k, count, sizeof(struct rx_packet));
1925 #define rx_hashTableSize 256    /* XXX */
1926     i = (rx_hashTableSize*sizeof(struct rx_connection *));
1927     j = (rx_hashTableSize*sizeof(struct rx_peer *));
1928     k = i + j;
1929     T += k;
1930     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Rx conn/peer tables", 
1931            k, rx_hashTableSize, sizeof(struct rx_connection *));
1932
1933     findsym( "rxi_Alloccnt", &symoff);
1934     kread(kmem, symoff, (char *) &j, sizeof j);
1935     findsym( "rxi_Allocsize", &symoff);
1936     kread(kmem, symoff, (char *) &i, sizeof i);
1937     T += i;
1938     printf("%20s:\t%8d bytes\t[%d outstanding allocs]\n", "RX misc allocs", i, j);
1939
1940
1941     j = afs_cmperfstats.OutStandingMemUsage;
1942     printf("\n\n%20s:\t%8d bytes\n", "Mem used by afs", j);
1943     printf("%20s:\t%8d bytes\n", "Accounted-for mem", T);
1944     printf("%20s:\t%8d bytes\n", "Non acc'd-for mem", j - T);
1945
1946     printf("\n\nNOTE:\n\tAll [...]* entries above aren't counted towards the total mem since they're redundant\n");
1947
1948 #ifdef AFS_LINUX22_ENV
1949     if (pnt)
1950         print_alloced_memlist();
1951 #endif
1952 }
1953
1954 #if     defined(sparc) && !defined(__linux__)
1955 int readmem(kmem, buf, vad, len)
1956     int kmem, len;
1957 #ifdef AFS_SUN57_ENV
1958     uintptr_t vad;
1959 #else
1960     int vad;
1961 #endif          /** AFS_SUN57_ENV **/
1962     char *buf;
1963 {
1964     int newlen;
1965     if (( newlen = kvm_kread(kd, vad, buf, len) ) != len) {
1966         printf("Couldn't process dumpfile with supplied namelist %s\n", obj);
1967         exit(1);
1968     }
1969 }
1970 #endif
1971
1972 #ifdef  AFS_OSF_ENV
1973 static read_addr(int fd, unsigned long addr, unsigned long *val) {
1974     if (lseek(fd, addr, SEEK_SET) == -1) return(0);
1975     if (read(fd, val, sizeof(long)) != sizeof(long)) return(0);
1976     return(1);
1977 }
1978
1979 static pt_entry_t *ptes = NULL;
1980 static addr_to_offset(unsigned long addr, unsigned long *ret, int fd)
1981 {
1982     off_t symoff;
1983     pt_entry_t pte, *val;  
1984     char *str, *ptr;
1985
1986     if (IS_SEG1_VA(addr)){
1987         if(ptes == NULL){
1988             int i, loc;
1989             unsigned long loc1, loc2[2];
1990             findsym ("kernel_pmap", &symoff);
1991             loc1 = coreadj(symoff);
1992             /*printf("ptes=%lx -> %lx\n", symoff, loc1);*/
1993             if (lseek(fd, loc1, L_SET/*0*/) != loc1) {
1994                 perror("lseek");
1995                 exit(1);
1996             }
1997             if ((i = read(fd, (char *)&loc1, sizeof(long))) != sizeof(long)) {
1998                 printf("Read of kerne_map failed\n");
1999                 return; /*exit(1);*/
2000             }
2001             loc = loc1;
2002             /*printf("loc1 %lx -> %lx\n",  loc1, loc);*/
2003             if (lseek(fd, loc, L_SET/*0*/) != loc) {
2004                 perror("lseek");
2005                 exit(1);
2006             }
2007             if ((i = read(fd, (char *)loc2, 2*sizeof(long))) != 2*sizeof(long)) {
2008                 printf("Read of kerne_map failed\n");
2009                 return; /*exit(1);*/
2010             }
2011             ptes = (pt_entry_t *) loc2[1];
2012             /*printf("ptes=%lx\n", ptes);*/
2013
2014         }
2015         if(!addr_to_offset((unsigned long) (ptes + LEVEL1_PT_OFFSET(addr)), (unsigned long *) &val, fd)) return(0);
2016         if(!read_addr(fd, (unsigned long) val, (unsigned long *) &pte)) return(0);
2017         val = ((pt_entry_t *) PTETOPHYS(&pte)) + LEVEL2_PT_OFFSET(addr);
2018         if(!read_addr(fd, (unsigned long) val, (unsigned long *) &pte)) return(0);
2019         val = ((pt_entry_t *) PTETOPHYS(&pte)) + LEVEL3_PT_OFFSET(addr);
2020         if(!read_addr(fd, (unsigned long) val, (unsigned long *) &pte)) return(0);
2021         *ret = PTETOPHYS(&pte) + (addr & ((1 << PGSHIFT) - 1));      
2022         return(1);
2023     } else if(IS_KSEG_VA(addr)) {
2024         *ret = KSEG_TO_PHYS(addr);
2025         return(1);
2026     } else {
2027         return(0);
2028     }
2029 }
2030 #endif
2031
2032 #ifndef AFS_KDUMP_LIB
2033 void kread(int kmem,off_t loc,void *buf,KDUMP_SIZE_T len)
2034 {
2035     int i;
2036
2037     memset(buf, 0, len);
2038
2039 #ifdef  AFS_OSF_ENV
2040     if (mem) {
2041         unsigned long ret;
2042         i = addr_to_offset(loc, &ret, kmem);
2043         if (i == 1) 
2044             loc = ret;
2045         else {
2046             unsigned long loc1;
2047             loc1 = coreadj(loc);
2048             loc = loc1;
2049         }
2050     }
2051 #else
2052 #if     defined(sparc) && !defined(__linux__)
2053 #ifndef AFS_SUN5_ENV
2054     if (mem) {
2055 #endif
2056         readmem(kmem, buf, (off_t)loc, len);    
2057         return;
2058 #ifndef AFS_SUN5_ENV
2059     }
2060 #endif
2061 #endif
2062 #endif
2063 #if     ! defined(AFS_SUN5_ENV)
2064 #if defined(AFS_SGI61_ENV) && !defined(AFS_32BIT_KERNEL_ENV)
2065     if (lseek64(kmem, loc, L_SET/*0*/) != loc)
2066 #else
2067     if (lseek(kmem, loc, L_SET/*0*/) != loc)
2068 #endif
2069         {
2070             perror("lseek");
2071             exit(1);
2072         }
2073     if ((i = read(kmem, buf, len)) != len) {
2074         printf("WARNING: Read failed: ");
2075         if (sizeof(loc) > sizeof(long)) {
2076             printf("loc=%llx", loc);
2077         } else {
2078             printf("loc=%lx", (long) loc);
2079         }
2080         printf(", buf=%lx, len=%ld, i=%d, errno=%d\n",
2081                (long) buf, (long) len, i, errno);
2082         return; /*exit(1);*/
2083     }
2084 #endif
2085 }
2086 #endif /* AFS_KDUMP_LIB */
2087
2088 #ifdef  AFS_SUN5_ENV
2089
2090 /**
2091   * When examining the dump of a 64 bit kernel, we use this function to
2092   * read symbols. The function opencore() calls this or rdsymbols() using
2093   * the macro RDSYMBOLS
2094   */
2095
2096 rdsymbols() {
2097
2098     FILE        *fp;
2099     Elf         *efd;
2100     Elf_Scn     *cn = NULL;
2101 #ifdef  _LP64
2102     Elf64_Shdr  *shdr;
2103     Elf64_Sym   *stbl, *p1, *p2;
2104     Elf64_Shdr * ( * elf_getshdr)(Elf_Scn *) = elf64_getshdr;
2105 #else
2106     Elf32_Shdr *shdr;
2107     Elf32_Sym   *stbl, *p1, *p2;
2108     Elf32_Shdr * ( * elf_getshdr)(Elf_Scn *) = elf32_getshdr;
2109 #endif
2110     Elf_Data    *dp = NULL, *sdp = NULL;
2111
2112     int         nsyms, i, fd;
2113
2114     if (!(fp = fopen(obj, "r"))) {
2115         printf("Can't open %s (%d)\n", core, errno);    
2116         exit(1);        
2117     }
2118     
2119     fd = fileno(fp);
2120     lseek(fd, 0L, 0);
2121     if ((efd = elf_begin(fd, ELF_C_READ, 0)) == NULL) {
2122         printf("Can't elf begin (%d)\n", errno);
2123         exit(1);
2124     }
2125     while (cn = elf_nextscn(efd, cn)) {
2126         if ((shdr = elf_getshdr(cn)) == NULL) {
2127             elf_end(efd);       
2128             printf("Can't read section header (%d)\n", errno);
2129             exit(1);
2130         }
2131         if (shdr->sh_type == SHT_SYMTAB)
2132             break;
2133     }   
2134     dp = elf_getdata(cn, dp);
2135     p1 = stbl = (void *) dp->d_buf;
2136     nsyms = dp->d_size / sizeof(*stbl);
2137     cn = elf_getscn(efd, shdr->sh_link);
2138     sdp = elf_getdata(cn, sdp);
2139     tblp = malloc(sdp->d_size);
2140     memcpy(tblp, sdp->d_buf, sdp->d_size);
2141     p2 = tbl = malloc(nsyms * sizeof(*stbl));
2142     for (i = 0, scnt = 0; i < nsyms; i++, p1++, p2++) {
2143         p2->st_name = p1->st_name;
2144         p2->st_value = p1->st_value;
2145         p2->st_size = p1->st_size;
2146         p2->st_info = p1->st_info;
2147         p2->st_shndx = p1->st_shndx;
2148         scnt++;
2149     }
2150     elf_end(efd);
2151     close(fd);
2152 }
2153
2154 #endif          /** AFS_SUN5_ENV **/
2155
2156
2157 int opencore(core)
2158     char *core;
2159 {
2160 #ifdef AFS_KDUMP_LIB
2161     return 0;
2162 #else /* AFS_KDUMP_LIB */
2163     int fd;
2164
2165 #if     defined(sparc) && !defined(__linux__)
2166 #ifndef AFS_SUN5_ENV
2167     if (mem) {
2168 #endif
2169
2170         if ((kd = kvm_open(obj, core, NULL, O_RDONLY, "crash")) == NULL) {
2171             printf("Can't open kvm - core file %s\n", core);    
2172             exit(1);
2173         }
2174
2175 #ifndef AFS_SUN5_ENV
2176       } else
2177 #endif
2178 #ifdef  AFS_SUN5_ENV
2179     rdsymbols();
2180 #endif
2181 #endif /* sparc */
2182
2183   {
2184     if ((fd = open(core, O_RDONLY)) < 0) {
2185         perror(core);
2186         exit(1);
2187     }
2188     return fd;
2189   }
2190 #endif /* AFS_KDUMP_LIB */
2191 }
2192
2193
2194 void print_exporter(kmem, exporter, ptr, pnt)
2195     int kmem, pnt;
2196     struct afs_exporter *exporter, *ptr;
2197 {
2198     if (pnt) {
2199         printf("\tstates=%x, type=%x, *data=%lx\n", 
2200                exporter->exp_states, exporter->exp_type, exporter->exp_data);
2201         printf("\texp_stats (calls=%d, rejectedcalls=%d, nopag=%d, invalidpag=%d)\n", 
2202                exporter->exp_stats.calls, exporter->exp_stats.rejectedcalls, 
2203                exporter->exp_stats.nopag, exporter->exp_stats.invalidpag);
2204     }
2205 }
2206
2207
2208 void print_nfsclient(kmem, ep, ptr, pnt)
2209     int kmem, pnt;
2210     struct nfsclientpag *ep, *ptr;
2211 {
2212     char sysname[100];
2213
2214     if (ep->sysname) {
2215         kread(kmem, (off_t) ep->sysname, sysname, (KDUMP_SIZE_T)30);
2216         Sum_nfssysnames += MAXSYSNAME;
2217     }
2218     if (pnt) printf("%lx: uid=%d, host=%x, pag=%x, @sys=%s, lastt=%d, ref=%d\n",
2219            ptr, ep->uid, ep->host , ep->pag, (ep->sysname ? sysname : "nil"),
2220            ep->lastcall, ep->refCount);
2221 }
2222
2223
2224 #if     defined(AFS_SUN5_ENV)
2225 pmutex(sp, mp)
2226 char *sp;
2227 kmutex_t *mp;
2228 {
2229 #ifdef  AFS_SUN54_ENV
2230
2231 #else
2232     struct stat_mutex *smp = (struct stat_mutex *)mp;
2233
2234     printf("%s mutex: %x %x\n", sp, smp->m_stats_lock, smp->m_type);
2235 #endif
2236 }
2237
2238 #endif
2239
2240 void print_unixuser(kmem, uep, ptr, pnt)
2241     int kmem, pnt;
2242     struct unixuser *uep, *ptr;
2243 {
2244     Sum_userstp += uep->stLen;
2245     if (pnt) {
2246        printf("%lx: uid=x%x, cell=%x, vid=%d, refc=%d, states=%x, tokTime=%d, tikLen=%d\n",
2247               ptr, uep->uid, uep->cell, uep->vid, uep->refCount, uep->states,
2248               uep->tokenTime, uep->stLen);
2249        printf("\tstp=%lx, clearTok[Han=x%x, x<%x,%x,%x,%x,%x,%x,%x,%x>, vid=%d, Bt=%d, Et=%d], exporter=%lx\n", 
2250               uep->stp, uep->ct.AuthHandle, 
2251               uep->ct.HandShakeKey[0], uep->ct.HandShakeKey[1], uep->ct.HandShakeKey[2],
2252               uep->ct.HandShakeKey[3], uep->ct.HandShakeKey[4], uep->ct.HandShakeKey[5],
2253               uep->ct.HandShakeKey[6], uep->ct.HandShakeKey[7], uep->ct.ViceId,
2254               uep->ct.BeginTimestamp, uep->ct.EndTimestamp, uep->exporter);
2255     }
2256 }
2257
2258 void print_cell(kmem, clep, ptr, pnt)
2259     int kmem, pnt;
2260     struct cell *clep, *ptr;
2261 {
2262     int i;
2263     char cellName[100];
2264     struct in_addr in;
2265
2266
2267     kread(kmem, (off_t) clep->cellName, cellName, (KDUMP_SIZE_T)40);
2268     cellName[40] = 0;
2269     Sum_cellnames += strlen(cellName)+1;
2270     if (pnt) {
2271         printf("%lx: cell=%s, cellname=%s, states=%x, cindex=%d fsport=%d vlport=%d timeout=%d\n", ptr,
2272                PrintIPAddr(clep->cell), cellName, clep->states, clep->cellIndex,
2273                clep->fsport, clep->vlport, clep->timeout);
2274 #ifdef  AFS33
2275         if (clep->lcellp)
2276             printf("\tlinked cellp %lx\n", clep->lcellp);
2277 #endif
2278         printf("\tCell's servers: ");
2279         for (i=0; i<MAXCELLHOSTS; i++) {
2280             if (pretty && (clep->cellHosts[i] == 0)) break;
2281             printf("[%lx] ", clep->cellHosts[i]);
2282         }
2283         printf("\n");
2284     }
2285 }
2286
2287
2288 void print_server(kmem, sep, ptr, conns, pnt)
2289     int kmem, conns, pnt;
2290     struct server *sep, *ptr;
2291 {
2292     struct srvAddr sa, *sap = &sa, *sap1;
2293     int j, mh=0, cnt;
2294
2295     if (conns != 2 && pnt) {
2296         printf("%lx: cell=%lx, addr=%lx, flags=0x%x, actTime=%x, lastDownS=%x, numDownIn=%d, sumofDownt=%d\n", 
2297                ptr, sep->cell, sep->addr,  sep->flags,
2298                sep->activationTime, sep->lastDowntimeStart, sep->numDowntimeIncidents,
2299                sep->sumOfDowntimes);
2300         if (sep->flags & SRVR_MULTIHOMED) {
2301             if (pnt) {
2302                 printf("\tuuid=[%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x]  addr_uniquifier=%x\n",
2303                        sep->sr_uuid.time_low, sep->sr_uuid.time_mid, sep->sr_uuid.time_hi_and_version,
2304                        sep->sr_uuid.clock_seq_hi_and_reserved, sep->sr_uuid.clock_seq_low, sep->sr_uuid.node[0],
2305                        sep->sr_uuid.node[1], sep->sr_uuid.node[2], sep->sr_uuid.node[3], sep->sr_uuid.node[4],
2306                        sep->sr_uuid.node[5], sep->sr_addr_uniquifier);
2307             }
2308             mh = 1;
2309         }
2310         for (j=0, cnt=1, sap1 = sep->addr; sap1; sap1 = sap->next_sa, j++, cnt++) {
2311             kread(kmem, (off_t)sap1, (char *)sap, sizeof(*sap));
2312             if (pnt) {
2313                 if (mh) {
2314                     printf("\t   #%d ip-addr(%lx): [sa_ip=%s, sa_port=%d, sa_iprank=%d, sa_flags=%x, conns=%lx, server=%lx, next_bkt=%lx]\n",
2315                            cnt, sap1, PrintIPAddr(sap->sa_ip), sap->sa_portal,
2316                            sap->sa_iprank, sap->sa_flags, sap->conns, 
2317                            sap->server, sap->next_bkt);
2318                 } else {
2319                     printf("\t[sa_ip=%s, sa_port=%d, sa_iprank=%d, sa_flags=%x, conns=%lx, server=%lx, nexth=%lx]\n",
2320                            PrintIPAddr(sap->sa_ip), sap->sa_portal, sap->sa_iprank, 
2321                            sap->sa_flags, sap->conns, sap->server,
2322                            sap->next_bkt);
2323                 }
2324             }
2325         }
2326     }
2327     if (sep->cbrs && pnt) {
2328         struct afs_cbr cba, *cbsap = &cba, *cbsap1;
2329
2330         printf(" Callbacks to be returned:\n");
2331         for (j=0, cbsap1 = sep->cbrs; cbsap1; cbsap1 = cbsap->next, j++) {
2332             kread(kmem, (off_t)cbsap1, (char *)cbsap, sizeof(*cbsap));
2333             printf("     #%2d) %lx [v=%d, n=%d, u=%d]\n", j, cbsap1,
2334                    cbsap->fid.Volume, cbsap->fid.Vnode, cbsap->fid.Unique);
2335         }
2336     }
2337     if (conns) {
2338         for (j=0, sap1 = sep->addr; sap1; sap1 = sap->next_sa, j++) {
2339             kread(kmem, (off_t)sap1, (char *)sap, sizeof(*sap));
2340             print_conns(kmem, sap1, sap->conns, conns, pnt);
2341         }
2342     } else
2343         if (pnt) printf("\n");
2344 }
2345
2346
2347 void print_conns(kmem, srv, conns, Con, pnt)
2348     int kmem, Con, pnt;
2349     struct srvAddr *srv;
2350     struct conn *conns;
2351 {
2352     struct conn *cep, ce, *centry= &ce;
2353     int i = 1;
2354
2355     cep = (struct conn *)conns;
2356     if (pnt && Con != 2) {
2357         if (cep)
2358             printf("\tRPC connections for server %lx:\n", srv);
2359         else
2360             printf("\tNO RPC connections for server %x\n", srv);
2361     }
2362     for (; cep; cep = centry->next, Nconns++, i++) {
2363         if (pnt && Con != 2)
2364             printf("\t   #%d> ", i);
2365         kread(kmem, (off_t)cep, (char *) centry, sizeof *centry);
2366         print_conn(kmem, centry, cep, pnt);
2367     }
2368 }
2369
2370
2371 void print_conn(kmem, conns, ptr, pnt)
2372     int kmem, pnt;
2373     struct conn *conns, *ptr;
2374 {
2375     if (!pnt) return;
2376     printf("%lx: user=%lx, rx=%lx, srvr=%lx, ref=%d, port=%d, forceC=%d\n",
2377            ptr, conns->user, conns->id, conns->srvr, conns->refCount, 
2378            conns->port, conns->forceConnectFS);
2379
2380 }
2381
2382
2383 void print_volume(kmem, vep, ptr, pnt)
2384     int kmem, pnt;
2385     struct volume *vep, *ptr;
2386 {
2387     int i;
2388     afs_int32 *loc;
2389     char Volname[100];
2390
2391
2392
2393    loc = (afs_int32 *)&vep->lock;
2394    if (vep->name) {
2395         kread(kmem, (off_t) vep->name, Volname, (KDUMP_SIZE_T)40);
2396         Sum_volnames += strlen(Volname)+1;
2397     }
2398     if (!pnt) return;
2399     printf("%lx: cell=%x, vol=%d, name=%s, roVol=%d, backVol=%d\n",
2400            ptr, vep->cell, vep->volume, (vep->name ? Volname:"nil"), vep->roVol, vep->backVol);
2401 #ifdef  AFS33
2402     printf("\trwVol=%d, AcTime=%d, copyDate=%d, expTime=%d, vtix=%d, refC=%d, states=%x\n",
2403            vep->rwVol, vep->accessTime, vep->copyDate, vep->expireTime,
2404            vep->vtix, vep->refCount, vep->states);
2405 #else
2406     printf("\trwVol=%d, AcTime=%d, copyDate=%d, vtix=%d, refC=%d, states=%x\n",
2407            vep->rwVol, vep->accessTime, vep->copyDate, vep->vtix, vep->refCount, vep->states);
2408 #endif
2409     printf("\tVolume's statuses: ");
2410     for (i=0; i < MAXHOSTS && vep->serverHost[i]; i++)
2411         printf("[%d] ", vep->status[i]);
2412     printf("\n");
2413
2414     printf("\tVolume's servers: ");
2415     for (i=0; i < MAXHOSTS && vep->serverHost[i]; i++)
2416         printf("[%lx] ", vep->serverHost[i]);
2417     printf("\n");
2418
2419     print_venusfid("\tdotdot", &vep->dotdot);
2420     printf("\n");
2421
2422     print_venusfid("\tmtpnt", &vep->mtpoint);
2423     printf("\n");
2424
2425 #ifdef  AFS33
2426     if (vep->rootVnode)
2427         printf("\trootVnode = %d, rootUnique = %d\n", vep->rootVnode, vep->rootUnique);
2428 #endif
2429     printf("\tlock=0x%x\n", *loc);
2430 }
2431
2432
2433 void print_venusfid(string, vid)
2434     char *string;
2435     struct VenusFid *vid;
2436 {
2437     printf("%s(c=%x, v=%d, n=%d, u=%d)", 
2438            string, vid->Cell, vid->Fid.Volume, vid->Fid.Vnode, vid->Fid.Unique);
2439 }
2440
2441
2442 void print_vnode(kmem, vep, ptr, pnt)
2443     int kmem, pnt;
2444     struct vnode *vep, *ptr;
2445 {
2446 #ifdef AFS_AIX_ENV
2447     struct gnode gnode;
2448     struct gnode *save_gnode;
2449 #endif /* AFS_AIX_ENV */
2450
2451     if (!pnt) return;
2452     printf("\n");
2453 #ifdef AFS_AIX_ENV
2454     save_gnode = vep->v_gnode;
2455     kread(kmem, (off_t) save_gnode, (char *)&gnode, sizeof(struct gnode));
2456     vep->v_gnode = &gnode;
2457 #endif /* AFS_AIX_ENV */
2458
2459 #ifdef  AFS_SUN5_ENV
2460     printf("%x: v_type=%d, v_flag=%d, v_count=%d, \n",
2461            ptr, vep->v_type, vep->v_flag, vep->v_count);
2462     printf("\tv_v_stream=%x, v_pages=0x%x, v_mountdhere=%d, v_rdev=%d, v_vfsp=0x%x, v_filocks=0x%x\n",
2463            vep->v_stream, vep->v_pages, vep->v_vfsmountedhere, vep->v_rdev, vep->v_vfsp, vep->v_filocks);
2464     pmutex("\tVnode", &vep->v_lock);
2465     printf("\tCond v: 0x%x\n", vep->v_cv);
2466 #endif
2467 #ifdef AFS_AIX_ENV
2468     vep->v_gnode = save_gnode;
2469 #endif /* AFS_AIX_ENV */
2470 #ifdef AFS_SGI65_ENV
2471 #if defined(AFS_32BIT_KERNEL_ENV)
2472     printf("%lx: v_mreg=0x%lx", ptr, vep->v_mreg);
2473 #else
2474     printf("%llx: v_mreg=0x%llx", ptr, vep->v_mreg);
2475 #endif
2476     printf(", v_mregb=0x%lx\n", vep->v_mregb);
2477 #endif
2478 #ifdef AFS_LINUX22_ENV
2479     /* Print out the stat cache and other inode info. */
2480     printf("\ti_ino=%d, i_mode=%x, i_nlink=%d, i_uid=%d, i_gid=%d, i_size=%d\n",
2481            vep->i_ino, vep->i_mode, vep->i_nlink, vep->i_uid, vep->i_gid,
2482            vep->i_size);
2483 #ifdef AFS_LINUX24_ENV
2484     printf("\ti_atime=%u, i_mtime=%u, i_ctime=%u, i_version=%u, i_nrpages=%u\n",
2485            vep->i_atime, vep->i_mtime, vep->i_ctime, vep->i_version,
2486            vep->i_data.nrpages);
2487 #else
2488     printf("\ti_atime=%u, i_mtime=%u, i_ctime=%u, i_version=%u, i_nrpages=%u\n",
2489            vep->i_atime, vep->i_mtime, vep->i_ctime, vep->i_version,
2490            vep->i_nrpages);
2491 #endif
2492     printf("\ti_op=0x%x, i_dev=0x%x, i_rdev=0x%x, i_sb=0x%x\n",
2493            vep->i_op, vep->i_dev, vep->i_rdev, vep->i_sb);
2494 #ifdef AFS_LINUX24_ENV
2495     printf("\ti_sem: count=%d, sleepers=%d, wait=0x%x\n",
2496            vep->i_sem.count, vep->i_sem.sleepers, vep->i_sem.wait);
2497 #else
2498     printf("\ti_sem: count=%d, waking=%d, wait=0x%x\n",
2499            vep->i_sem.count, vep->i_sem.waking, vep->i_sem.wait);
2500 #endif
2501     printf("\ti_hash=0x%x:0x%x, i_list=0x%x:0x%x, i_dentry=0x%x:0x%x\n",
2502            vep->i_hash.prev, vep->i_hash.next,
2503            vep->i_list.prev, vep->i_list.next,
2504            vep->i_dentry.prev, vep->i_dentry.next);
2505 #endif /* AFS_LINUX22_ENV */
2506 }
2507
2508 void print_vcache(kmem, vep, ptr, pnt)
2509     int kmem, pnt;
2510     struct vcache *vep, *ptr;
2511 {
2512     long *loc, j=0;
2513     char *cloc;
2514     struct VenusFid vid;
2515     struct axscache acc, *accp = &acc, *acp;
2516     struct SimpleLocks sl, *slcp = &sl, *slp;
2517     char linkchar;
2518
2519     if (vep->mvid) {
2520         kread(kmem, (off_t) vep->mvid, (char *)&vid, sizeof(struct VenusFid));
2521         Sum_vcachemvids++;
2522     }
2523     if (vep->linkData) 
2524         Sum_vcachelinkData++;
2525     loc = (long *)&vep->lock;
2526
2527     if (pnt) {  
2528         if (!Dvnodes) printf("\n");
2529 #ifdef  AFS33
2530         printf("%lx: refC=%d, pv=%d, pu=%d, flushDv=%d.%d, mapDV=%d.%d, ",
2531                ptr, vep->vrefCount, vep->parentVnode, vep->parentUnique, 
2532                vep->flushDV.high, vep->flushDV.low, 
2533                vep->mapDV.high, vep->mapDV.low);
2534 #ifdef AFS_64BIT_CLIENT
2535         printf("truncPos=(0x%x, 0x%x),\n\tcallb=x%lx, cbE=%d, opens=%d, XoW=%d, ",
2536                (int) vep->truncPos >> 32, (int) vep->truncPos & 0xffffffff, 
2537                 vep->callback, vep->cbExpires, vep->opens, 
2538                vep->execsOrWriters);
2539 #else /* AFS_64BIT_CLIENT */
2540         printf("truncPos=%d,\n\tcallb=x%lx, cbE=%d, opens=%d, XoW=%d, ",
2541                vep->truncPos, vep->callback, vep->cbExpires, vep->opens, 
2542                vep->execsOrWriters);
2543 #endif /* AFS_64BIT_CLIENT */
2544         printf("flcnt=%d, mvstat=%d\n",
2545                vep->flockCount, vep->mvstat);
2546         printf("\tstates=x%x, ", vep->states);
2547 #ifdef  AFS_SUN5_ENV
2548         printf("vstates=x%x, ", vep->vstates);
2549 #endif  /* AFS_SUN5_ENV */
2550         printf("dchint=%x, anyA=0x%x\n", vep->h1.dchint, vep->anyAccess);
2551 #ifdef AFS_64BIT_CLIENT
2552         printf("\tquick[dc=%x, stamp=%x, f=%x, min=%d, len=(0x%x, 0x%x)]\n",
2553                vep->quick.dc, vep->quick.stamp, vep->quick.f,
2554                vep->quick.minLoc, 
2555                 (int)vep->quick.len >> 32, (int)vep->quick.len & 0xffffffff);
2556         printf("\tmstat[len=(0x%x, 0x%x), DV=%d.%d, Date=%d, Owner=%d, Group=%d, Mode=0%o, linkc=%d]\n",
2557                (int) vep->m.Length >> 32, (int) vep->m.Length & 0xffffffff, 
2558                 vep->m.DataVersion.high, 
2559                vep->m.DataVersion.low, vep->m.Date, vep->m.Owner,
2560                vep->m.Group, vep->m.Mode, vep->m.LinkCount);
2561 #else /* AFS_64BIT_CLIENT */
2562         printf("\tquick[dc=%x, stamp=%x, f=%x, min=%d, len=%d]\n",
2563                vep->quick.dc, vep->quick.stamp, vep->quick.f,
2564                vep->quick.minLoc, vep->quick.len);
2565         printf("\tmstat[len=%d, DV=%d.%d, Date=%d, Owner=%d, Group=%d, Mode=0%o, linkc=%d]\n",
2566                vep->m.Length, vep->m.DataVersion.high, 
2567                vep->m.DataVersion.low, vep->m.Date, vep->m.Owner,
2568                vep->m.Group, vep->m.Mode, vep->m.LinkCount);
2569 #endif /* AFS_64BIT_CLIENT */
2570 #else /* AFS33 */
2571         printf("%x: refC=%d, pv=%d, pu=%d, flushDv=%d, mapDV=%d, truncPos=%d\n",
2572                ptr, vep->vrefCount, vep->parentVnode, vep->parentUnique, vep->flushDV,
2573                vep->mapDV, vep->truncPos);
2574         printf("\tcallb=x%x, cbE=%d, opens=%d, XoW=%d, flcnt=%d, mvstat=%d\n",
2575                vep->callback, vep->cbExpires, vep->opens, vep->execsOrWriters,
2576                vep->flockCount, vep->mvstat);
2577         printf("\tstates=x%x, dchint=%x, anyA=0x%x\n",
2578                vep->states, vep->h1.dchint, vep->anyAccess);
2579         printf("\tmstat[len=%d, DV=%d, Date=%d, Owner=%d, Group=%d, Mode=%d, linkc=%d]\n",
2580                vep->m.Length, vep->m.DataVersion, vep->m.Date, vep->m.Owner,
2581                vep->m.Group, vep->m.Mode, vep->m.LinkCount);
2582 #endif /* AFS33 */
2583 #ifdef  AFS_AIX32_ENV
2584     loc = (afs_int32 *)&vep->pvmlock;
2585     printf("\tpvmlock=x%x, segid=%X, credp=%lx\n", *loc, vep->segid, vep->credp);
2586 #endif
2587     printf("\tlock [wait=%x excl=%x readers=%x #waiting=%x last_reader=%d writer=%d src=%d]\n", 
2588            vep->lock.wait_states, vep->lock.excl_locked, vep->lock.readers_reading,
2589            vep->lock.num_waiting, vep->lock.pid_last_reader, vep->lock.pid_writer,
2590            vep->lock.src_indicator);
2591     print_venusfid("\tfid", &vep->fid);
2592     if (vep->mvid) {
2593         printf(" ");
2594         print_venusfid("mvid", &vid);
2595     }
2596     printf("\n");
2597     }
2598     if (vep->Access) {
2599         if (pnt) printf("\tAccess Link list: %x\n", vep->Access);
2600         for (j=0, acp = vep->Access; acp; acp = accp->next, j++) {
2601             kread(kmem, (off_t) acp, (char *)accp, sizeof(*accp));
2602             Sum_vcacheacc++;
2603             if (pnt) printf("\t   %lx: %d) uid=0x%x, access=0x%x, next=%lx\n", acp, j, accp->uid, accp->axess, accp->next);
2604         }
2605     }
2606     if (vep->slocks) {
2607         if (pnt) printf("\tLocking Link list: %lx\n", vep->slocks);
2608     }
2609 #ifdef  AFS33
2610     if (pnt) printf("\tCallbacks queue prev= %lx next= %lx\n",
2611                     vep->callsort.prev, vep->callsort.next);
2612 #endif
2613     printf("\tvlruq.prev=%lx, vlruq.next=%lx\n",
2614            vep->vlruq.prev, vep->vlruq.next);
2615
2616     /* For defect 7733 - Print linkData field for symlinks */
2617     if (pnt) {
2618            if (vep->linkData) {
2619                 cloc = (char *)vep->linkData;
2620                 printf("\tSymlink information = '");
2621                 while(1) {
2622                     kread(kmem, (off_t) cloc, &linkchar, (KDUMP_SIZE_T)1);
2623                     cloc++;
2624                     if (linkchar == '\0') {
2625                         printf("'\n");
2626                         break;
2627                     } else {
2628                         printf("%c", linkchar);
2629                     }
2630                 }
2631            }
2632     }
2633 #ifdef AFS_LINUX22_ENV
2634     printf("\tflushcnt=%d, mapcnt=%d\n", vep->flushcnt, vep->mapcnt);
2635 #endif
2636 }
2637
2638
2639 void print_dcache(kmem, dcp, dp, pnt)
2640     int kmem, pnt;
2641     struct dcache *dcp, *dp;
2642 {
2643     if (!pnt) return;
2644     printf("%lx: ", dp);
2645     print_venusfid(" fid", &dcp->f.fid);
2646     printf("refcnt=%d, dflags=%x, mflags=%x, validPos=%d\n",
2647            dcp->refCount, dcp->dflags, dcp->mflags, dcp->validPos);
2648
2649 #ifdef  AFS33
2650     printf("\tf.modtime=%d, f.versNo=%d.%d\n",
2651            dcp->f.modTime, 
2652            dcp->f.versionNo.high, dcp->f.versionNo.low);
2653 #else
2654     printf("\tf.hvn=%d, f.hcn=%d, f.modtime=%d, f.versNo=%d\n",
2655            dcp->f.hvNextp, dcp->f.hcNextp, dcp->f.modTime, dcp->f.versionNo);
2656 #endif
2657 #ifdef AFS_SGI62_ENV
2658     printf("\tf.chunk=%d, f.inode=%lld, f.chunkBytes=%d, f.states=%x, stamp=%x\n",
2659            dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states, 
2660            dcp->stamp);
2661 #else
2662     printf("\tf.chunk=%d, f.inode=%d, f.chunkBytes=%d, f.states=%x, stamp=%x\n",
2663            dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states, 
2664            dcp->stamp);
2665 #endif
2666     printf("\tlruq.prev=%lx, lruq.next=%lx, index=%d, ihint=%x\n",
2667            dcp->lruq.prev, dcp->lruq.next, dcp->index, dcp->ihint);
2668 }
2669
2670 void print_bkg(kmem)
2671     int kmem;
2672 {
2673     off_t symoff;
2674     struct brequest afs_brs[NBRS], ue,*uentry= &ue, *uep;
2675     afs_int32 count, i, j;
2676     short scount;
2677
2678     printf("\n\nPrinting some background daemon info...\n\n");
2679     findsym ("afs_brsWaiters", &symoff);
2680     kread(kmem, symoff, (char *) &scount, sizeof scount);
2681     printf("Number of processes waiting for bkg daemon %d\n", scount);
2682     findsym ("afs_brsDaemons", &symoff);
2683     kread(kmem, symoff, (char *) &scount, sizeof scount);
2684     printf("Number of free bkg daemons %d\n", scount);
2685     findsym ("afs_brs", &symoff);
2686     kread(kmem, symoff, (char *) afs_brs, sizeof afs_brs);
2687     printf("Print the current bkg process table\n");    
2688     for (i=0,j=0; i < NBRS; i++, j++) {
2689 /*      kread(kmem, (off_t) afs_brs[i], (char *)uentry, sizeof *uentry);*/
2690         uentry = &afs_brs[i];
2691         if (uentry->refCount == 0) break;
2692         printf("[%d] vcache=0x%lx, cred=0x%lx, code=%d, refCount=%d, opcode=%d, flags=%x [%lx, %lx, %lx, %lx]\n",
2693                i, uentry->vnode, uentry->cred, uentry->code, uentry->refCount, uentry->opcode, uentry->flags,
2694                uentry->size_parm[0], uentry->size_parm[1], uentry->ptr_parm[0], uentry->ptr_parm[1]);
2695
2696     }
2697     printf("... found %d active 'afs_brs' entries\n", j);
2698 }
2699
2700 void print_vlru(kmem)
2701     int kmem;
2702 {
2703     off_t symoff;
2704     struct vcache Ve, *Ventry = &Ve, *Vep, *tvc;
2705     struct afs_q VLRU, vlru, *vu = &vlru, *tq, *uq;
2706     u_long vlru_addr, l1, l2, l3;
2707     afs_int32 count, i, j=0, maxvcount, vcount, nvnode;
2708     short scount;
2709
2710     printf("\n\nPrinting vcache VLRU info (oldest first)...\n\n");
2711     findsym( "afs_cacheStats", &symoff);
2712     kread(kmem, symoff, (char *) &maxvcount, sizeof maxvcount);
2713 #ifdef  AFS_OSF_ENV
2714     findsym ("afs_maxvcount", &symoff);
2715     kread(kmem, symoff, (char *) &maxvcount, sizeof maxvcount);
2716     findsym ("afs_vcount", &symoff);
2717     kread(kmem, symoff, (char *) &vcount, sizeof vcount);
2718     findsym ("max_vnodes", &symoff);
2719     kread(kmem, symoff, (char *) &nvnode, sizeof nvnode);
2720     printf("max number of vcache entries = %d\n", maxvcount);
2721     printf("number of vcaches in use = %d\n", vcount);
2722     printf("total number of system vnode entries = %d\n", nvnode);
2723 #endif
2724     findsym ("VLRU", &symoff);
2725     kread(kmem, symoff, (char *) &VLRU, sizeof VLRU);
2726     vlru_addr = (u_long)symoff;
2727     for (tq = VLRU.prev; (u_long)tq != vlru_addr; tq = uq) {
2728         tvc = QTOV(tq);
2729         kread(kmem, (off_t)tq, (char *)vu, sizeof VLRU);
2730         uq = vu->prev;
2731         kread(kmem, (off_t)tvc, (char *)Ventry, sizeof *Ventry);
2732         print_vcache(kmem, Ventry, tvc, 1);
2733         j++;
2734     }
2735     printf("... found %d active vcache entries in the VLRU\n", j);
2736 }
2737
2738 void print_dlru(kmem)
2739     int kmem;
2740 {
2741     off_t symoff;
2742     struct dcache Ve, *Ventry = &Ve, *Vep, *tdc;
2743     struct afs_q DLRU, dlru, *vu = &dlru, *tq, *uq;
2744     u_long dlru_addr, l1, l2, l3;
2745     afs_int32 count, i, j=0, maxvcount, vcount, nvnode;
2746     short scount;
2747
2748     printf("\n\nPrinting vcache DLRU info...\n\n");
2749     findsym ("afs_DLRU", &symoff);
2750     kread(kmem, symoff, (char *) &DLRU, sizeof DLRU);
2751     dlru_addr = (u_long)symoff;
2752     for (tq = DLRU.prev; (u_long)tq != dlru_addr; tq = uq) {
2753         tdc = (struct dcache *) tq;
2754         kread(kmem, (off_t)tq, (char *)vu, sizeof DLRU);
2755         uq = vu->prev;
2756         kread(kmem, (off_t)tdc, (char *)Ventry, sizeof *Ventry);
2757         print_dcache(kmem, Ventry, tdc, 1);
2758         j++;
2759     }
2760     printf("... found %d active dcache entries in the DLRU\n\n\n", j);
2761
2762     findsym("afs_freeDSList", &symoff);
2763     kread(kmem, symoff, (char *) &dlru_addr, sizeof dlru_addr);
2764     printf("\tfreeDSList link list starts at 0x%x\n", dlru_addr);
2765     j=0;
2766     for (tdc = (struct dcache *)dlru_addr; tdc; tdc = (struct dcache *)Ventry->lruq.next) {
2767         kread(kmem, (off_t)tdc, (char *)Ventry, sizeof *Ventry);
2768         print_dcache(kmem, Ventry, tdc, 1);
2769         j++;
2770 /*      printf("%3d) %x\n", j, tdc);*/
2771     }
2772     printf("... found %d dcache entries in the freeDSList\n", j);
2773 }
2774
2775 int print_gcpags(pnt)
2776 int pnt;
2777 {
2778     off_t symoff;
2779     afs_int32 afs_gcpags;
2780     afs_int32 afs_gcpags_procsize;
2781
2782     if (pnt) printf("\n\nPrinting GCPAGS structures...\n");
2783
2784     findsym( "afs_gcpags", &symoff);
2785     kread(kmem, symoff, (char*)&afs_gcpags, sizeof afs_gcpags);
2786
2787     findsym( "afs_gcpags_procsize", &symoff);
2788     kread(kmem, symoff, (char*)&afs_gcpags_procsize, sizeof afs_gcpags_procsize);
2789
2790     printf("afs_gcpags=%d\n", afs_gcpags);
2791     printf("afs_gcpags_procsize=%d\n", afs_gcpags_procsize);
2792
2793     return 0;
2794 }
2795
2796
2797 #ifdef  AFS_AIX_ENV
2798 #include <sys/syspest.h>/* to define the assert and ASSERT macros       */
2799 #include <sys/timer.h>  /* For the timer related defines                */
2800 #include <sys/intr.h>   /* for the serialization defines                */
2801 #include <sys/malloc.h> /* for the parameters to xmalloc()              */
2802
2803 struct  tos     {
2804         struct  tos     *toprev;        /* previous tos in callout table*/
2805         struct  tos     *tonext;        /* next tos in callout table    */
2806         struct  trb     *trb;           /* this timer request block     */
2807         afs_int32       type;
2808         long    p1;
2809 };
2810
2811 struct  callo   {
2812         int     ncallo;         /* number of callout table elements     */
2813         struct  tos     *head;  /* callout table head element           */
2814 };
2815 #endif
2816
2817 void print_callout(kmem)
2818     int kmem;
2819 {
2820     off_t symoff;
2821 #ifndef AFS_AIX_ENV
2822     printf("\n\nCallout table doesn't exist for this system\n");
2823 #else
2824     struct callo Co, *Coe = &Co, *Cop;
2825     struct tos To, *Toe = &To, *tos;
2826     struct trb Trb, *Trbe = &Trb, *trb;
2827     register int i =0;
2828
2829
2830     printf("\n\nPrinting callout table info...\n\n");
2831     findsym ("afs_callo", &symoff);
2832     kread(kmem, symoff, (char *) &Co, sizeof Co);
2833     printf("Number of callouts %d\n", Co.ncallo);
2834     if (Co.ncallo > 0) {
2835         printf("Count\tType\taddr\tfunc\tdata\n");
2836         for (tos = Co.head; tos != NULL; tos = Toe->tonext)  {
2837             i++;
2838             kread(kmem, (off_t) tos, (char *) &To, sizeof To);
2839             kread(kmem, (off_t) Toe->trb, (char *) &Trb, sizeof Trb);
2840             printf("%d\t%d\t%x\t%x\t%x\n", i, Toe->type, Toe->p1, Trbe->tof, Trbe->func_data);
2841         }
2842     }
2843 #endif
2844 }
2845
2846 void print_dnlc(kmem)
2847     int kmem;
2848 {
2849   struct nc * nameHash[256];
2850
2851 }
2852
2853
2854 void print_global_locks(kmem)
2855     int kmem;
2856 {
2857     off_t symoff;
2858     afs_int32 count;
2859     int i;
2860     static struct {
2861       char *name;
2862     } locks[] = {     { "afs_xvcache" },
2863                         { "afs_xdcache" },
2864                         { "afs_xserver" },
2865                         { "afs_xvcb" },
2866                         { "afs_xbrs" },
2867                         { "afs_xcell" },
2868                         { "afs_xconn" },
2869                         { "afs_xuser" },
2870                         { "afs_xvolume" },
2871 #ifndef AFS_AIX_ENV
2872                         { "osi_fsplock" },
2873 #endif
2874                         { "osi_flplock" },
2875                         { "afs_xcbhash" },
2876                         { "afs_xinterface" },
2877
2878                         { 0 },
2879                         };
2880
2881
2882     printf("\n\nPrinting afs global locks...\n\n");
2883     for (i=0; locks[i].name; i++) { 
2884       findsym( locks[i].name, &symoff);
2885       kread(kmem, symoff, (char *) &count, sizeof count);
2886       printf("%s = 0x%x\n", locks[i].name, count);
2887     }
2888 }
2889
2890
2891 void print_global_afs_resource(kmem)
2892     int kmem;
2893 {
2894     off_t symoff;
2895     char sysname[100];
2896     afs_int32 count;
2897     long addr;
2898
2899     printf("\n\nPrinting some general resource related globals...\n\n");
2900     findsym ("afs_setTimeHost",&symoff);
2901     kread(kmem, symoff, (char *) &count, sizeof count);
2902     printf("\tafs_setTimeHost = 0x%x\n", count);
2903     findsym("afs_volCounter", &symoff);
2904     kread(kmem, symoff, (char *) &count, sizeof count);
2905     printf("\tafs_volCounter = 0x%x\n", count);
2906     findsym("afs_cellindex", &symoff);
2907     kread(kmem, symoff, (char *) &count, sizeof count);
2908     printf("\tafs_cellIndex = 0x%x\n", count);
2909     findsym("afs_marinerHost", &symoff);
2910     kread(kmem, symoff, (char *) &count, sizeof count);
2911     printf("\tafs_marinerHost = 0x%x\n", count);
2912     findsym("afs_sysname", &symoff);
2913     kread(kmem, symoff, (char *) &addr, sizeof addr);
2914 #ifdef  AFS_HPUX_ENV
2915     printf("\tafs_sysname = %d\n", addr);
2916 #else
2917     kread(kmem, (off_t)addr, sysname, (KDUMP_SIZE_T)30);
2918     printf("\tafs_sysname = %s\n", sysname);
2919 #endif
2920 #ifdef AFS_SGI65_ENV
2921     findsym("afs_ipno", &symoff);
2922     kread(kmem, symoff, (char *) &count, sizeof count);
2923     printf("\tCPU BOARD = IP%d\n", count);
2924 #endif
2925 }
2926
2927
2928 void print_global_afs_cache(kmem)
2929     int kmem;
2930 {
2931     off_t symoff;
2932     char sysname[100];
2933     afs_int32 count;
2934 #ifdef AFS_SGI62_ENV
2935     ino64_t inode;
2936 #endif    
2937 #ifndef AFS32
2938     afs_hyper_t h;
2939 #endif
2940
2941     printf("\n\nPrinting some general cache related globals...\n\n");
2942     findsym("afs_mariner", &symoff);
2943     kread(kmem, symoff, (char *) &count, sizeof count);
2944     printf("\tafs_mariner = 0x%x\n", count);
2945 #ifndef AFS_OSF_ENV
2946     findsym("freeVCList", &symoff);
2947     kread(kmem, symoff, (char *) &count, sizeof count);
2948     printf("\tafs_freeVCList = 0x%x XXX\n", count);
2949 #endif
2950     findsym("afs_freeDCList", &symoff);
2951     kread(kmem, symoff, (char *) &count, sizeof count);
2952     printf("\tfreeDCList = 0x%x\n", count);
2953     findsym("afs_freeDCCount", &symoff);
2954     kread(kmem, symoff, (char *) &count, sizeof count);
2955     printf("\tfreeDCCount = 0x%x (%d)\n", count, count);
2956     findsym("afs_discardDCList", &symoff);
2957     kread(kmem, symoff, (char *) &count, sizeof count);
2958     printf("\tdiscardDCList = 0x%x\n", count);
2959     findsym("afs_discardDCCount", &symoff);
2960     kread(kmem, symoff, (char *) &count, sizeof count);
2961     printf("\tdiscardDCCount = 0x%x (%d)\n", count, count);
2962     findsym("afs_freeDSList", &symoff);
2963     kread(kmem, symoff, (char *) &count, sizeof count);
2964     printf("\tfreeDSList= 0x%x XXXX\n", count);
2965 #ifdef AFS_SGI62_ENV
2966     findsym("cacheInode", &symoff);
2967     kread(kmem, symoff, (char *) &inode, sizeof inode);
2968     printf("\tcacheInode = 0x%llx (%lld)\n", inode, inode);
2969     findsym("volumeInode", &symoff);
2970     kread(kmem, symoff, (char *) &inode, sizeof inode);
2971     printf("\tvolumeInode = 0x%llx (%lld)\n", inode, inode);
2972 #else
2973     findsym("cacheInode", &symoff);
2974     kread(kmem, symoff, (char *) &count, sizeof count);
2975     printf("\tcacheInode = 0x%x (%d)\n", count, count);
2976     findsym("volumeInode", &symoff);
2977     kread(kmem, symoff, (char *) &count, sizeof count);
2978     printf("\tvolumeInode = 0x%x (%d)\n", count, count);
2979 #endif
2980     findsym("cacheDiskType", &symoff);
2981     kread(kmem, symoff, (char *) &count, sizeof count);
2982     printf("\tcacheDiskType = 0x%x (%d)\n", count, count);
2983 #ifndef AFS32
2984     findsym("afs_indexCounter", &symoff);
2985     kread(kmem, symoff, (char *) &h, sizeof (struct afs_hyper_t));
2986     printf("\tafs_indexCounter = 0x%X.%X (%d.%d)\n", h.high, h.low, h.high, h.low);
2987 #endif
2988     findsym("afs_cacheFiles", &symoff);
2989     kread(kmem, symoff, (char *) &count, sizeof count);
2990     printf("\tafs_cacheFiles = 0x%x (%d)\n", count, count);
2991     findsym("afs_cacheBlocks", &symoff);
2992     kread(kmem, symoff, (char *) &count, sizeof count);
2993     printf("\tafs_cacheBlocks = 0x%x (%d)\n", count, count);
2994     findsym("afs_cacheStats", &symoff);
2995     kread(kmem, symoff, (char *) &count, sizeof count);
2996     printf("\tafs_cacheStats = 0x%x (%d)\n", count, count);
2997     findsym("afs_blocksUsed", &symoff);
2998     kread(kmem, symoff, (char *) &count, sizeof count);
2999     printf("\tafs_blocksUsed = 0x%x (%d)\n", count, count);
3000     findsym("afs_blocksDiscarded", &symoff);
3001     kread(kmem, symoff, (char *) &count, sizeof count);
3002     printf("\tafs_blocksDiscarded = 0x%x (%d)\n", count, count);
3003     findsym("afs_fsfragsize", &symoff);
3004     kread(kmem, symoff, (char *) &count, sizeof count);
3005     printf("\tafs_fsfragsize = 0x%x\n", count);
3006     findsym("afs_WaitForCacheDrain", &symoff);
3007     kread(kmem, symoff, (char *) &count, sizeof count);
3008     printf("\tafs_WaitForCacheDrain = 0x%x (%d)\n", count, count);
3009     findsym("afs_CacheTooFull", &symoff);
3010     kread(kmem, symoff, (char *) &count, sizeof count);
3011     printf("\tafs_CacheTooFull = 0x%x (%d)\n", count, count);
3012
3013
3014     if (findsym("pagCounter", &symoff)) {
3015         kread(kmem, symoff, (char *) &count, sizeof count);
3016         printf("\tpagCounter = 0x%x (%d)\n", count, count);
3017     } else {
3018         printf("Ignoring pagCounter\n");
3019     }
3020 }
3021
3022
3023 void print_rxstats(kmem)
3024     int kmem;
3025 {
3026     off_t symoff;
3027     char sysname[100];
3028     afs_int32 count, i;
3029     struct rx_stats rx_stats;
3030
3031     printf("\n\nPrinting some general RX stats...\n\n");
3032     findsym("rx_stats", &symoff);
3033     kread(kmem, symoff, (char *) &rx_stats, sizeof rx_stats);
3034     printf("\t\tpacketRequests = %d\n", rx_stats.packetRequests);
3035     printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_RECEIVE,
3036            rx_stats.receivePktAllocFailures);
3037     printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_SEND,
3038            rx_stats.sendPktAllocFailures);
3039     printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_SPECIAL,
3040            rx_stats.specialPktAllocFailures);
3041     printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_RECV_CBUF,
3042            rx_stats.receiveCbufPktAllocFailures);
3043     printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_SEND_CBUF,
3044            rx_stats.sendCbufPktAllocFailures);
3045     printf("\t\tsocketGreedy = %d\n", rx_stats.socketGreedy);
3046     printf("\t\tbogusPacketOnRead = %d\n", rx_stats.bogusPacketOnRead);
3047     printf("\t\tbogusHost = %d\n", rx_stats.bogusHost);
3048     printf("\t\tnoPacketOnRead = %d\n", rx_stats.noPacketOnRead);
3049     printf("\t\tnoPacketBuffersOnRead = %d\n", rx_stats.noPacketBuffersOnRead);
3050     printf("\t\tselects = %d\n", rx_stats.selects);
3051     printf("\t\tsendSelects = %d\n", rx_stats.sendSelects);
3052     for (i=0; i < RX_N_PACKET_TYPES; i++)
3053         printf("\t\tpacketsRead[%d] = %d\n", i, rx_stats.packetsRead[i]);
3054     printf("\t\tdataPacketsRead = %d\n", rx_stats.dataPacketsRead);
3055     printf("\t\tackPacketsRead = %d\n", rx_stats.ackPacketsRead);
3056     printf("\t\tdupPacketsRead = %d\n", rx_stats.dupPacketsRead);
3057     printf("\t\tspuriousPacketsRead = %d\n", rx_stats.spuriousPacketsRead);
3058     for (i=0; i < RX_N_PACKET_TYPES; i++)
3059         printf("\t\tpacketsSent[%d] = %d\n", i, rx_stats.packetsSent[i]);
3060     printf("\t\tackPacketsSent = %d\n", rx_stats.ackPacketsSent);
3061     printf("\t\tpingPacketsSent = %d\n", rx_stats.pingPacketsSent);
3062     printf("\t\tabortPacketsSent = %d\n", rx_stats.abortPacketsSent);
3063     printf("\t\tbusyPacketsSent = %d\n", rx_stats.busyPacketsSent);
3064     printf("\t\tdataPacketsSent = %d\n", rx_stats.dataPacketsSent);
3065     printf("\t\tdataPacketsReSent = %d\n", rx_stats.dataPacketsReSent);
3066     printf("\t\tdataPacketsPushed = %d\n", rx_stats.dataPacketsPushed);
3067     printf("\t\tignoreAckedPacket = %d\n", rx_stats.ignoreAckedPacket);
3068     printf("\t\ttotalRtt = %d sec, %d usec\n", rx_stats.totalRtt.sec, rx_stats.totalRtt.usec);
3069     printf("\t\tminRtt = %d sec, %d usec\n", rx_stats.minRtt.sec, rx_stats.minRtt.usec);
3070     printf("\t\tmaxRtt = %d sec, %d usec\n", rx_stats.maxRtt.sec, rx_stats.maxRtt.usec);
3071     printf("\t\tnRttSamples = %d\n", rx_stats.nRttSamples);
3072     printf("\t\tnServerConns = %d\n", rx_stats.nServerConns);
3073     printf("\t\tnClientConns = %d\n", rx_stats.nClientConns);
3074     printf("\t\tnPeerStructs = %d\n", rx_stats.nPeerStructs);
3075     printf("\t\tnCallStructs = %d\n", rx_stats.nCallStructs);
3076     printf("\t\tnFreeCallStructs = %d\n", rx_stats.nFreeCallStructs);
3077     printf("\t\tnetSendFailures  = %d\n", rx_stats.netSendFailures);
3078     printf("\t\tfatalErrors      = %d\n", rx_stats.fatalErrors);
3079 }
3080
3081
3082 void print_rx(kmem)
3083     int kmem;
3084 {
3085     off_t symoff;
3086     char sysname[100], c;
3087     afs_int32 count, i, ar[100];
3088     short sm;
3089     struct rx_stats rx_stats;
3090
3091     printf("\n\nPrinting some RX globals...\n\n");
3092     findsym("rx_extraQuota", &symoff);
3093     kread(kmem, symoff, (char *) &count, sizeof count);
3094     printf("\trx_extraQuota = %d\n", count);
3095     findsym("rx_extraPackets", &symoff);
3096     kread(kmem, symoff, (char *) &count, sizeof count);
3097     printf("\trx_extraPackets = %d\n", count);
3098     findsym("rx_stackSize", &symoff);
3099     kread(kmem, symoff, (char *) &count, sizeof count);
3100     printf("\trx_stackSize = %d\n", count);
3101     findsym("rx_connDeadTime", &symoff);
3102     kread(kmem, symoff, (char *) &count, sizeof count);
3103
3104     printf("\trx_connDeadTime = %d\n", count);
3105     findsym("rx_idleConnectionTime", &symoff);
3106     kread(kmem, symoff, (char *) &count, sizeof count);
3107
3108     printf("\trx_idleConnectionTime = %d\n", count);
3109
3110     findsym("rx_idlePeerTime", &symoff);
3111     kread(kmem, symoff, (char *) &count, sizeof count);
3112     printf("\trx_idlePeerTime = %d\n", count);
3113
3114     findsym("rx_initSendWindow", &symoff);
3115     kread(kmem, symoff, (char *) &count, sizeof count);
3116     printf("\trx_initSendWindow = %d\n", count);
3117
3118     findsym("rxi_nSendFrags", &symoff);
3119     kread(kmem, symoff, (char *) &count, sizeof count);
3120     printf("\trxi_nSendFrags = %d\n", count);
3121
3122     findsym("rx_nPackets", &symoff);
3123     kread(kmem, symoff, (char *) &count, sizeof count);
3124
3125     printf("\trx_nPackets = %d\n", count);
3126     findsym("rx_nFreePackets", &symoff);
3127     kread(kmem, symoff, (char *) &count, sizeof count);
3128
3129     printf("\trx_nFreePackets = %d\n", count);
3130     findsym("rx_socket", &symoff);
3131     kread(kmem, symoff, (char *) &count, sizeof count);
3132
3133     printf("\trx_socket = 0x%x\n", count);
3134     findsym("rx_port", &symoff);
3135     kread(kmem, symoff, (char *) &sm, sizeof sm);
3136
3137     printf("\trx_Port = %d\n", sm);
3138     findsym("rx_packetQuota", &symoff);
3139     kread(kmem, symoff, (char *) ar, sizeof ar);
3140
3141     for (i=0; i < RX_N_PACKET_CLASSES; i++)
3142         printf("\trx_packetQuota[%d] = %d\n", i, ar[i]);
3143     findsym("rx_nextCid", &symoff);
3144     kread(kmem, symoff, (char *) &count, sizeof count);
3145
3146     printf("\trx_nextCid = 0x%x\n", count);
3147     findsym("rx_epoch", &symoff);
3148     kread(kmem, symoff, (char *) &count, sizeof count);
3149
3150     printf("\trx_epoch = 0u%u\n", count);
3151     findsym("rx_waitingForPackets", &symoff);
3152     kread(kmem, symoff, (char *) &c, sizeof(c));
3153
3154     printf("\trx_waitingForPackets = %x\n", (int)c);
3155     findsym("rxi_nCalls", &symoff);
3156     kread(kmem, symoff, (char *) &count, sizeof count);
3157
3158     printf("\trxi_nCalls = %d\n", count);
3159     findsym("rxi_dataQuota", &symoff);
3160     kread(kmem, symoff, (char *) &count, sizeof count);
3161
3162     printf("\trxi_dataQuota = %d\n", count);
3163 #ifdef  AFS_AIX_ENV
3164     if (findsym("rxi_Alloccnt", &symoff)) {
3165         kread(kmem, symoff, (char *) &count, sizeof count);
3166         printf("\trxi_Alloccnt = %d\n", count);
3167     }
3168
3169     if (findsym("rxi_Allocsize", &symoff)) {
3170         kread(kmem, symoff, (char *) &count, sizeof count);
3171         printf("\trxi_Allocsize = %d\n", count);
3172     }
3173 #endif
3174     findsym("rxi_availProcs", &symoff);
3175     kread(kmem, symoff, (char *) &count, sizeof count);
3176
3177     printf("\trxi_availProcs = %d\n", count);
3178     findsym("rxi_totalMin", &symoff);
3179     kread(kmem, symoff, (char *) &count, sizeof count);
3180
3181     printf("\trxi_totalMin = %d\n", count);
3182     findsym("rxi_minDeficit", &symoff);
3183     kread(kmem, symoff, (char *) &count, sizeof count);
3184
3185     printf("\trxi_minDeficit = %d\n", count);
3186     print_services(kmem);
3187 #ifdef KDUMP_RX_LOCK
3188     if (use_rx_lock) {
3189         print_peertable_lock(kmem);
3190         print_conntable_lock(kmem);
3191         print_calltable_lock(kmem);
3192     }
3193     else {
3194         print_peertable(kmem);
3195         print_conntable(kmem);
3196         print_calltable(kmem);
3197     }
3198 #else
3199     print_peertable(kmem);
3200     print_conntable(kmem);
3201     print_calltable(kmem);
3202 #endif
3203     print_eventtable(kmem);
3204     print_rxstats(kmem);
3205 }
3206
3207
3208 void print_services(kmem)
3209     afs_int32 kmem;
3210 {
3211     off_t symoff;
3212     struct rx_service *rx_services[RX_MAX_SERVICES], se, *sentry = &se, *sep;
3213     char sysname[100];
3214     afs_int32 count, i, j;
3215
3216     findsym("rx_services", &symoff);
3217     kread(kmem, symoff, (char *) rx_services, RX_MAX_SERVICES * sizeof(long));
3218
3219     printf("\n\nPrinting all 'rx_services' structures...\n");
3220     for (i=0, j=0; i < RX_MAX_SERVICES; i++) {
3221         if (rx_services[i]) {
3222             j++;
3223             kread(kmem, (off_t) rx_services[i], (char *)sentry, sizeof *sentry);
3224             kread(kmem, (off_t) sentry->serviceName, sysname,
3225                   (KDUMP_SIZE_T)40);        
3226             printf("\t%lx: serviceId=%d, port=%d, serviceName=%s, socket=0x%x\n",
3227                    rx_services[i], sentry->serviceId, sentry->servicePort, sysname, sentry->socket);
3228             printf("\t\tnSecObj=%d, nReqRunning=%d, maxProcs=%d, minProcs=%d, connDeadTime=%d, idleDeadTime=%d\n",
3229                    sentry->nSecurityObjects, sentry->nRequestsRunning, sentry->maxProcs, sentry->minProcs,
3230                    sentry->connDeadTime, sentry->idleDeadTime);
3231         }
3232     }
3233     printf("... found %d 'rx_services' entries in the table\n", j);
3234 }
3235
3236
3237 #ifdef KDUMP_RX_LOCK
3238 void print_peertable_lock(kmem)
3239     afs_int32 kmem;
3240 {
3241     off_t symoff;
3242     struct rx_peer_rx_lock *rx_peerTable[256], se, *sentry = &se, *sep;
3243     long count, i, j;
3244
3245     findsym("rx_peerHashTable", &symoff);
3246     kread(kmem, symoff, (char *) &count, sizeof(long));
3247     if (!count) {
3248         printf("No 'rx_peer' structures found.\n");
3249         return;
3250     }
3251     
3252     kread(kmem, count, (char *) rx_peerTable, 256 * sizeof(long));
3253     printf("\n\nPrinting all 'rx_peer' structures...\n");
3254     for (i=0, j=0; i < 256; i++) {
3255         for (sep = rx_peerTable[i]; sep; sep = sentry->next, j++) {
3256             kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3257             printf("\t%lx: next=0x%lx, host=0x%x, ",
3258                    sep, sentry->next, sentry->host);
3259             printf("ifMTU=%d, natMTU=%d, maxMTU=%d\n", sentry->ifMTU,
3260                    sentry->natMTU, sentry->maxMTU);
3261             printf("\t\trtt=%d:%d, timeout(%d:%d), nSent=%d, reSends=%d\n",
3262                    sentry->rtt, sentry->rtt_dev,
3263                    sentry->timeout.sec, sentry->timeout.usec,
3264                    sentry->nSent, sentry->reSends);
3265             printf("\t\trefCount=%d, port=%d, idleWhen=0x%x\n", 
3266                    sentry->refCount, sentry->port, sentry->idleWhen);
3267             printf("\t\tCongestionQueue (0x%x:0x%x), inPacketSkew=0x%x, outPacketSkew=0x%x\n",
3268                    sentry->congestionQueue.prev, sentry->congestionQueue.next, 
3269                    sentry->inPacketSkew, sentry->outPacketSkew);
3270             printf("\t\tpeer_lock=%d\n", sentry->peer_lock);
3271         }
3272     }
3273     printf("... found %d 'rx_peer' entries in the table\n", j);
3274 }
3275
3276 #endif /* KDUMP_RX_LOCK */
3277 void print_peertable(kmem)
3278     afs_int32 kmem;
3279 {
3280     off_t symoff;
3281     struct rx_peer *rx_peerTable[256], se, *sentry = &se, *sep;
3282     long count, i, j;
3283
3284     findsym("rx_peerHashTable", &symoff);
3285     kread(kmem, symoff, (char *) &count, sizeof(long));
3286
3287     kread(kmem, count, (char *) rx_peerTable, 256 * sizeof(long));
3288     printf("\n\nPrinting all 'rx_peer' structures...\n");
3289     for (i=0, j=0; i < 256; i++) {
3290         for (sep = rx_peerTable[i]; sep; sep = sentry->next, j++) {
3291             kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3292             printf("\t%lx: next=0x%lx, host=0x%x, ",
3293                    sep, sentry->next, sentry->host);
3294             printf("ifMTU=%d, natMTU=%d, maxMTU=%d\n", sentry->ifMTU,
3295                    sentry->natMTU, sentry->maxMTU);
3296             printf("\t\trtt=%d:%d, timeout(%d:%d), nSent=%d, reSends=%d\n",
3297                    sentry->rtt, sentry->rtt_dev,
3298                    sentry->timeout.sec, sentry->timeout.usec,
3299                    sentry->nSent, sentry->reSends);
3300             printf("\t\trefCount=%d, port=%d, idleWhen=0x%x\n", 
3301                    sentry->refCount, sentry->port, sentry->idleWhen);
3302             printf("\t\tCongestionQueue (0x%x:0x%x), inPacketSkew=0x%x, outPacketSkew=0x%x\n",
3303                    sentry->congestionQueue.prev, sentry->congestionQueue.next, 
3304                    sentry->inPacketSkew, sentry->outPacketSkew);
3305 #ifdef RX_ENABLE_LOCKS
3306             printf("\t\tpeer_lock=%d\n", sentry->peer_lock);
3307 #endif /* RX_ENABLE_LOCKS */
3308         }
3309     }
3310     printf("... found %d 'rx_peer' entries in the table\n", j);
3311 }
3312
3313
3314 #ifdef KDUMP_RX_LOCK
3315 void print_conntable_lock(kmem)
3316     afs_int32 kmem;
3317 {
3318     off_t symoff;
3319     struct rx_connection_rx_lock *rx_connTable[256], se, *sentry = &se;
3320     struct rx_connection_rx_lock *sep;
3321     long count, i, j;
3322
3323     findsym("rx_connHashTable", &symoff);
3324     kread(kmem, symoff, (char *) &count, sizeof(long));
3325     if (!count) {
3326         printf("No 'rx_connection' structures found.\n");
3327         return;
3328     }
3329
3330     kread(kmem, count, (char *) rx_connTable, 256 * sizeof(long));
3331     printf("\n\nPrinting all 'rx_connection' structures...\n");
3332     for (i=0, j=0; i < 256; i++) {
3333        for (sep = rx_connTable[i]; sep; sep = sentry->next, j++) {
3334           kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3335           printf("\t%lx: next=0x%lx, peer=0x%lx, epoch=0x%x, cid=0x%x, ackRate=%d\n",
3336                  sep, se.next, se.peer, se.epoch, se.cid, se.ackRate);
3337           printf("\t\tcall[%lx=%d, %lx=%d, %lx=%d, %lx=%d]\n",
3338                  se.call[0], se.callNumber[0],
3339                  se.call[1], se.callNumber[1],
3340                  se.call[2], se.callNumber[2],
3341                  se.call[3], se.callNumber[3]);
3342           printf("\t\ttimeout=%d, flags=0x%x, type=0x%x, serviceId=%d, service=0x%lx, refCount=%d\n",
3343                  se.timeout, se.flags, se.type, se.serviceId, se.service, se.refCount);
3344           printf("\t\tserial=%d, lastSerial=%d, secsUntilDead=%d, secsUntilPing=%d, secIndex=%d\n",
3345                  se.serial, se.lastSerial, se.secondsUntilDead,
3346                  se.secondsUntilPing, se.securityIndex);
3347           printf("\t\terror=%d, secObject=0x%lx, secData=0x%lx, secHeaderSize=%d, secmaxTrailerSize=%d\n", 
3348                  se.error, se.securityObject, se.securityData,
3349                  se.securityHeaderSize, se.securityMaxTrailerSize);
3350           printf("\t\tchallEvent=0x%lx, lastSendTime=0x%x, maxSerial=%d, hardDeadTime=%d\n", 
3351                  se.challengeEvent, se.lastSendTime, 
3352                  se.maxSerial, se.hardDeadTime);
3353           if (se.flags & RX_CONN_MAKECALL_WAITING)
3354             printf("\t\t***** Conn in RX_CONN_MAKECALL_WAITING state *****\n");
3355           printf("\t\tcall_lock=%d, call_cv=%d, data_lock=%d, refCount=%d\n",
3356                  se.conn_call_lock, se.conn_call_cv, se.conn_data_lock,
3357                  se.refCount);
3358         }
3359     }
3360     printf("... found %d 'rx_connection' entries in the table\n", j);
3361 }
3362 #endif /* KDUMP_RX_LOCK */
3363
3364 void print_conntable(kmem)
3365     afs_int32 kmem;
3366 {
3367     off_t symoff;
3368     struct rx_connection *rx_connTable[256], se, *sentry = &se, *sep;
3369     long count, i, j;
3370
3371     findsym("rx_connHashTable", &symoff);
3372     kread(kmem, symoff, (char *) &count, sizeof(long));
3373
3374     kread(kmem, count, (char *) rx_connTable, 256 * sizeof(long));
3375     printf("\n\nPrinting all 'rx_connection' structures...\n");
3376     for (i=0, j=0; i < 256; i++) {
3377        for (sep = rx_connTable[i]; sep; sep = sentry->next, j++) {
3378           kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3379           printf("\t%lx: next=0x%lx, peer=0x%lx, epoch=0x%x, cid=0x%x, ackRate=%d\n",
3380                  sep, se.next, se.peer, se.epoch, se.cid, se.ackRate);
3381           printf("\t\tcall[%x=%d, %x=%d, %x=%d, %x=%d]\n",
3382                  se.call[0], se.callNumber[0],
3383                  se.call[1], se.callNumber[1],
3384                  se.call[2], se.callNumber[2],
3385                  se.call[3], se.callNumber[3]);
3386           printf("\t\ttimeout=%d, flags=0x%x, type=0x%x, serviceId=%d, service=0x%lx, refCount=%d\n",
3387                  se.timeout, se.flags, se.type, se.serviceId, se.service, se.refCount);
3388           printf("\t\tserial=%d, lastSerial=%d, secsUntilDead=%d, secsUntilPing=%d, secIndex=%d\n",
3389                  se.serial, se.lastSerial, se.secondsUntilDead,
3390                  se.secondsUntilPing, se.securityIndex);
3391           printf("\t\terror=%d, secObject=0x%lx, secData=0x%lx, secHeaderSize=%d, secmaxTrailerSize=%d\n", 
3392                  se.error, se.securityObject, se.securityData,
3393                  se.securityHeaderSize, se.securityMaxTrailerSize);
3394           printf("\t\tchallEvent=0x%lx, lastSendTime=0x%x, maxSerial=%d, hardDeadTime=%d\n", 
3395                  se.challengeEvent, se.lastSendTime, 
3396                  se.maxSerial, se.hardDeadTime);
3397           if (se.flags & RX_CONN_MAKECALL_WAITING)
3398             printf("\t\t***** Conn in RX_CONN_MAKECALL_WAITING state *****\n");
3399 #ifdef RX_ENABLE_LOCKS
3400           printf("\t\tcall_lock=%d, call_cv=%d, data_lock=%d, refCount=%d\n",
3401                  se.conn_call_lock, se.conn_call_cv, se.conn_data_lock,
3402                  se.refCount);
3403 #endif /* RX_ENABLE_LOCKS */
3404         }
3405     }
3406     printf("... found %d 'rx_connection' entries in the table\n", j);
3407 }
3408
3409
3410 #ifdef KDUMP_RX_LOCK
3411 void print_calltable_lock(kmem)
3412     afs_int32 kmem;
3413 {
3414     off_t symoff;
3415     struct rx_connection_rx_lock *rx_connTable[256], se;
3416     struct rx_connection_rx_lock *sentry = &se;
3417     struct rx_connection_rx_lock *sep;
3418     long count, i, j, k;
3419
3420     findsym("rx_connHashTable", &symoff);
3421     kread(kmem, symoff, (char *) &count, sizeof(long));
3422     if (!count) {
3423         printf("No 'rx_call' structures found.\n");
3424         return;
3425     }
3426
3427     kread(kmem, count, (char *) rx_connTable, 256 * sizeof(long));
3428     printf("\n\nPrinting all active 'rx_call' structures...\n");
3429     for (i=0, j=0; i < 256; i++) {
3430         for (sep = rx_connTable[i]; sep; sep = se.next) {
3431             kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3432             for (k = 0; k < RX_MAXCALLS; k++) {
3433                 struct rx_call_rx_lock ce, *centry = &ce;
3434                 struct rx_call_rx_lock *call = se.call[k];
3435                 if (call) {
3436                     j++;
3437                     kread(kmem, (off_t) call, (char *)centry, sizeof *centry);
3438                     printf("\t%lx: conn=0x%lx, qiheader(0x%lx:0x%lx), tq(0x%lx:0x%lx), rq(0x%lx:0x%lx)\n",
3439                            call, centry->conn, centry->queue_item_header.prev, centry->queue_item_header.next,
3440                            centry->tq.prev, centry->tq.next, centry->rq.prev, centry->rq.next);
3441                     printf("\t\t: curvec=%d, curpos=%d, nLeft=%d, nFree=%d, currPacket=0x%lx, callNumber=0x%x\n",
3442                            centry->curvec, centry->curpos, centry->nLeft, centry->nFree, centry->currentPacket, centry->callNumber);
3443                     printf("\t\t: channel=%d, state=0x%x, mode=0x%x, flags=0x%x, localStatus=0x%x, remStatus=0x%x\n",               
3444                            centry->channel, centry->state, centry->mode, centry->flags, centry->localStatus,
3445                            centry->remoteStatus);
3446                     printf("\t\t: error=%d, timeout=0x%x, rnext=0x%x, rprev=0x%x, rwind=0x%x, tfirst=0x%x, tnext=0x%x\n",
3447                            centry->error, centry->timeout, centry->rnext, centry->rprev, centry->rwind, centry->tfirst,
3448                            centry->tnext);
3449                     printf("\t\t: twind=%d, resendEvent=0x%lx, timeoutEvent=0x%lx, keepAliveEvent=0x%lx, delayedAckEvent=0x%lx\n",
3450                            centry->twind, centry->resendEvent, centry->timeoutEvent, centry->keepAliveEvent, 
3451                            centry->delayedAckEvent);
3452                     printf("\t\t: lastSendTime=0x%x, lastReceiveTime=0x%x, lastAcked=0x%x, startTime=0x%x, startWait=0x%x\n",
3453                            centry->lastSendTime, centry->lastReceiveTime, centry->lastAcked, centry->startTime, centry->startWait);
3454                     if (centry->flags & RX_CALL_WAIT_PROC)
3455                         printf("\t\t******** Call in RX_CALL_WAIT_PROC state **********\n");
3456                     if (centry->flags & RX_CALL_WAIT_WINDOW_ALLOC)
3457                         printf("\t\t******** Call in RX_CALL_WAIT_WINDOW_ALLOC state **********\n");
3458                     if (centry->flags & RX_CALL_READER_WAIT)
3459                         printf("\t\t******** Conn in RX_CALL_READER_WAIT state **********\n");
3460                     if (centry->flags & RX_CALL_WAIT_PACKETS)
3461                         printf("\t\t******** Conn in RX_CALL_WAIT_PACKETS state **********\n");
3462                     printf("\t\t: lock=0x%x, cv_twind=0x%x, cv_rq=0x%x, refCount=%d\n",
3463                            centry->lock, centry->cv_twind, centry->cv_rq,
3464                            centry->refCount);
3465                     printf("\t\t: MTU=%d\n", centry->MTU);
3466                 }
3467             }
3468         }
3469     }
3470     printf("... found %d 'rx_call' entries in the table\n", j);
3471 }
3472 #endif /* KDUMP_RX_LOCK */
3473
3474 void print_calltable(kmem)
3475     afs_int32 kmem;
3476 {
3477     off_t symoff;
3478     struct rx_connection *rx_connTable[256], se, *sentry = &se, *sep;
3479     long count, i, j, k;
3480
3481     findsym("rx_connHashTable", &symoff);
3482     kread(kmem, symoff, (char *) &count, sizeof(long));
3483
3484     kread(kmem, count, (char *) rx_connTable, 256 * sizeof(long));
3485     printf("\n\nPrinting all active 'rx_call' structures...\n");
3486     for (i=0, j=0; i < 256; i++) {
3487         for (sep = rx_connTable[i]; sep; sep = se.next) {
3488             kread(kmem, (off_t)sep, (char *)sentry, sizeof *sentry);
3489             for (k = 0; k < RX_MAXCALLS; k++) {
3490                 struct rx_call ce, *centry = &ce, *call = se.call[k];
3491                 if (call) {
3492                     j++;
3493                     kread(kmem, (off_t)call, (char *)centry, sizeof *centry);
3494                     printf("\t%lx: conn=0x%lx, qiheader(0x%lx:0x%lx), tq(0x%lx:0x%lx), rq(0x%lx:0x%lx)\n",
3495                            call, centry->conn, centry->queue_item_header.prev, centry->queue_item_header.next,
3496                            centry->tq.prev, centry->tq.next, centry->rq.prev, centry->rq.next);
3497                     printf("\t\t: curvec=%d, curpos=%d, nLeft=%d, nFree=%d, currPacket=0x%lx, callNumber=0x%x\n",
3498                            centry->curvec, centry->curpos, centry->nLeft, centry->nFree, centry->currentPacket, centry->callNumber);
3499                     printf("\t\t: channel=%d, state=0x%x, mode=0x%x, flags=0x%x, localStatus=0x%x, remStatus=0x%x\n",               
3500                            centry->channel, centry->state, centry->mode, centry->flags, centry->localStatus,
3501                            centry->remoteStatus);
3502                     printf("\t\t: error=%d, timeout=0x%x, rnext=0x%x, rprev=0x%x, rwind=0x%x, tfirst=0x%x, tnext=0x%x\n",
3503                            centry->error, centry->timeout, centry->rnext, centry->rprev, centry->rwind, centry->tfirst,
3504                            centry->tnext);
3505                     printf("\t\t: twind=%d, resendEvent=0x%lx, timeoutEvent=0x%lx, keepAliveEvent=0x%lx, delayedAckEvent=0x%lx\n",
3506                            centry->twind, centry->resendEvent, centry->timeoutEvent, centry->keepAliveEvent, 
3507                            centry->delayedAckEvent);
3508                     printf("\t\t: lastSendTime=0x%x, lastReceiveTime=0x%x, lastAcked=0x%x, startTime=0x%x, startWait=0x%x\n",
3509                            centry->lastSendTime, centry->lastReceiveTime, centry->lastAcked, centry->startTime, centry->startWait);
3510                     if (centry->flags & RX_CALL_WAIT_PROC)
3511                         printf("\t\t******** Call in RX_CALL_WAIT_PROC state **********\n");
3512                     if (centry->flags & RX_CALL_WAIT_WINDOW_ALLOC)
3513                         printf("\t\t******** Call in RX_CALL_WAIT_WINDOW_ALLOC state **********\n");
3514                     if (centry->flags & RX_CALL_READER_WAIT)
3515                         printf("\t\t******** Conn in RX_CALL_READER_WAIT state **********\n");
3516                     if (centry->flags & RX_CALL_WAIT_PACKETS)
3517                         printf("\t\t******** Conn in RX_CALL_WAIT_PACKETS state **********\n");
3518 #ifdef RX_ENABLE_LOCKS
3519                     printf("\t\t: lock=0x%x, cv_twind=0x%x, cv_rq=0x%x, refCount=%d\n",
3520                            centry->lock, centry->cv_twind, centry->cv_rq,
3521                            centry->refCount);
3522 #endif /* RX_ENABLE_LOCKS */
3523                     printf("\t\t: MTU=%d\n", centry->MTU);
3524                 }
3525             }
3526         }
3527     }
3528     printf("... found %d 'rx_call' entries in the table\n", j);
3529 }
3530
3531 void print_eventtable(kmem)
3532     afs_int32 kmem;
3533 {
3534     off_t symoff;
3535     struct rx_queue epq;
3536     struct rx_queue evq;
3537     char *epend, *evend;
3538     afs_int32 count, i, j=0, k=0;
3539
3540 #if ! defined(AFS_HPUX_ENV) && ! defined(AFS_AIX_ENV)
3541     findsym("rxevent_nFree", &symoff);
3542     kread(kmem, symoff, (char *) &count, sizeof(afs_int32));
3543     printf("\n\n\trxevent_nFree = %d\n", count);
3544
3545     findsym("rxevent_nPosted", &symoff);
3546     kread(kmem, symoff, (char *) &count, sizeof(afs_int32));
3547     printf("\trxevent_nPosted = %d\n", count);
3548 #endif
3549 }
3550
3551 /*
3552  * print_upDownStats
3553  *
3554  * Print the up/downtime stats for the given class of server records
3555  * provided.
3556  */
3557 void print_upDownStats(a_upDownP)
3558     struct afs_stats_SrvUpDownInfo *a_upDownP;  /*Ptr to server up/down info*/
3559
3560 { /*print_upDownStats*/
3561
3562     /*
3563      * First, print the simple values.
3564      */
3565     printf("\t\t%10d numTtlRecords\n",          a_upDownP->numTtlRecords);
3566     printf("\t\t%10d numUpRecords\n",           a_upDownP->numUpRecords);
3567     printf("\t\t%10d numDownRecords\n",         a_upDownP->numDownRecords);
3568     printf("\t\t%10d sumOfRecordAges\n",        a_upDownP->sumOfRecordAges);
3569     printf("\t\t%10d ageOfYoungestRecord\n",    a_upDownP->ageOfYoungestRecord);
3570     printf("\t\t%10d ageOfOldestRecord\n",      a_upDownP->ageOfOldestRecord);
3571     printf("\t\t%10d numDowntimeIncidents\n",   a_upDownP->numDowntimeIncidents);
3572     printf("\t\t%10d numRecordsNeverDown\n",    a_upDownP->numRecordsNeverDown);
3573     printf("\t\t%10d maxDowntimesInARecord\n",  a_upDownP->maxDowntimesInARecord);
3574     printf("\t\t%10d sumOfDowntimes\n",         a_upDownP->sumOfDowntimes);
3575     printf("\t\t%10d shortestDowntime\n",       a_upDownP->shortestDowntime);
3576     printf("\t\t%10d longestDowntime\n",        a_upDownP->longestDowntime);
3577
3578     /*
3579      * Now, print the array values.
3580      */
3581     printf("\t\tDowntime duration distribution:\n");
3582     printf("\t\t\t%8d: 0 min .. 10 min\n",  a_upDownP->downDurations[0]);
3583     printf("\t\t\t%8d: 10 min .. 30 min\n", a_upDownP->downDurations[1]);
3584     printf("\t\t\t%8d: 30 min .. 1 hr\n",   a_upDownP->downDurations[2]);
3585     printf("\t\t\t%8d: 1 hr .. 2 hr\n",     a_upDownP->downDurations[3]);
3586     printf("\t\t\t%8d: 2 hr .. 4 hr\n",     a_upDownP->downDurations[4]);
3587     printf("\t\t\t%8d: 4 hr .. 8 hr\n",     a_upDownP->downDurations[5]);
3588     printf("\t\t\t%8d: > 8 hr\n",           a_upDownP->downDurations[6]);
3589
3590     printf("\t\tDowntime incident distribution:\n");
3591     printf("\t\t\t%8d: 0 times\n",        a_upDownP->downIncidents[0]);
3592     printf("\t\t\t%8d: 1 time\n",         a_upDownP->downDurations[1]);
3593     printf("\t\t\t%8d: 2 .. 5 times\n",   a_upDownP->downDurations[2]);
3594     printf("\t\t\t%8d: 6 .. 10 times\n",  a_upDownP->downDurations[3]);
3595     printf("\t\t\t%8d: 10 .. 50 times\n", a_upDownP->downDurations[4]);
3596     printf("\t\t\t%8d: > 50 times\n",     a_upDownP->downDurations[5]);
3597 } /*print_upDownStats*/
3598
3599
3600 void print_cmperfstats(perfP)
3601     struct afs_stats_CMPerf *perfP;
3602 {
3603     struct afs_stats_SrvUpDownInfo *upDownP;    /*Ptr to server up/down info*/
3604
3605     printf("\t%10d numPerfCalls\n",             perfP->numPerfCalls);
3606     printf("\t%10d epoch\n",                    perfP->epoch);
3607     printf("\t%10d numCellsVisible\n",          perfP->numCellsVisible);
3608     printf("\t%10d numCellsContacted\n",        perfP->numCellsContacted);
3609     printf("\t%10d dlocalAccesses\n",           perfP->dlocalAccesses);
3610     printf("\t%10d vlocalAccesses\n",           perfP->vlocalAccesses);
3611     printf("\t%10d dremoteAccesses\n",          perfP->dremoteAccesses);
3612     printf("\t%10d vremoteAccesses\n",          perfP->vremoteAccesses);
3613     printf("\t%10d cacheNumEntries\n",          perfP->cacheNumEntries);
3614     printf("\t%10d cacheBlocksTotal\n",         perfP->cacheBlocksTotal);
3615     printf("\t%10d cacheBlocksInUse\n",         perfP->cacheBlocksInUse);
3616     printf("\t%10d cacheBlocksOrig\n",          perfP->cacheBlocksOrig);
3617     printf("\t%10d cacheMaxDirtyChunks\n",      perfP->cacheMaxDirtyChunks);
3618     printf("\t%10d cacheCurrDirtyChunks\n",     perfP->cacheCurrDirtyChunks);
3619     printf("\t%10d dcacheHits\n",               perfP->dcacheHits);
3620     printf("\t%10d vcacheHits\n",               perfP->vcacheHits);
3621     printf("\t%10d dcacheMisses\n",             perfP->dcacheMisses);
3622     printf("\t%10d vcacheMisses\n",             perfP->vcacheMisses);
3623     printf("\t%10d cacheFlushes\n",             perfP->cacheFlushes);
3624     printf("\t%10d cacheFilesReused\n",         perfP->cacheFilesReused);
3625     printf("\t%10d vcacheXAllocs\n",            perfP->vcacheXAllocs);
3626     printf("\t%10d dcacheXAllocs\n",            perfP->dcacheXAllocs);
3627
3628     printf("\t%10d bufAlloced\n",               perfP->bufAlloced);
3629     printf("\t%10d bufHits\n",                  perfP->bufHits);
3630     printf("\t%10d bufMisses\n",                perfP->bufMisses);
3631     printf("\t%10d bufFlushDirty\n",            perfP->bufFlushDirty);
3632
3633     printf("\t%10d LargeBlocksActive\n",        perfP->LargeBlocksActive);
3634     printf("\t%10d LargeBlocksAlloced\n",       perfP->LargeBlocksAlloced);
3635     printf("\t%10d SmallBlocksActive\n",        perfP->SmallBlocksActive);
3636     printf("\t%10d SmallBlocksAlloced\n",       perfP->SmallBlocksAlloced);
3637     printf("\t%10d MediumBlocksActive\n",       perfP->MediumBlocksActive);
3638     printf("\t%10d MediumBlocksAlloced\n",      perfP->MediumBlocksAlloced);
3639     printf("\t%10d OutStandingMemUsage\n",      perfP->OutStandingMemUsage);
3640     printf("\t%10d OutStandingAllocs\n",        perfP->OutStandingAllocs);
3641     printf("\t%10d CallBackAlloced\n",          perfP->CallBackAlloced);
3642     printf("\t%10d CallBackFlushes\n",          perfP->CallBackFlushes);
3643     printf("\t%10d CallBackLoops\n",            perfP->cbloops);
3644
3645     printf("\t%10d srvRecords\n",               perfP->srvRecords);
3646     printf("\t%10d srvNumBuckets\n",            perfP->srvNumBuckets);
3647     printf("\t%10d srvMaxChainLength\n",        perfP->srvMaxChainLength);
3648     printf("\t%10d srvRecordsHWM\n",            perfP->srvRecordsHWM);
3649     printf("\t%10d srvMaxChainLengthHWM\n",     perfP->srvMaxChainLengthHWM);
3650
3651     printf("\t%10d sysName_ID\n",               perfP->sysName_ID);
3652     printf("\t%10d osi_Read_EFAULTS\n",         perfP->osiread_efaults);
3653
3654     printf("\tFile Server up/downtimes, same cell:\n");
3655     print_upDownStats(&(perfP->fs_UpDown[0]));
3656
3657     printf("\tFile Server up/downtimes, diff cell:\n");
3658     print_upDownStats(&(perfP->fs_UpDown[1]));
3659
3660     printf("\tVL Server up/downtimes, same cell:\n");
3661     print_upDownStats(&(perfP->vl_UpDown[0]));
3662
3663     printf("\tVL Server up/downtimes, diff cell:\n");
3664     print_upDownStats(&(perfP->vl_UpDown[1]));
3665 }
3666
3667
3668 void print_cmstats(cmp)
3669     struct afs_CMStats *cmp;
3670 {
3671     printf("\t%10d afs_init\n",         cmp->callInfo.C_afs_init);
3672     printf("\t%10d gop_rdwr\n",         cmp->callInfo.C_gop_rdwr);
3673     printf("\t%10d aix_gnode_rele\n",         cmp->callInfo.C_aix_gnode_rele);
3674     printf("\t%10d gettimeofday\n",         cmp->callInfo.C_gettimeofday);
3675     printf("\t%10d m_cpytoc\n",         cmp->callInfo.C_m_cpytoc);
3676     printf("\t%10d aix_vattr_null\n",         cmp->callInfo.C_aix_vattr_null);
3677     printf("\t%10d afs_gn_frunc\n",         cmp->callInfo.C_afs_gn_ftrunc);
3678     printf("\t%10d afs_gn_rdwr\n",         cmp->callInfo.C_afs_gn_rdwr);
3679     printf("\t%10d afs_gn_ioctl\n",         cmp->callInfo.C_afs_gn_ioctl);
3680     printf("\t%10d afs_gn_locktl\n",         cmp->callInfo.C_afs_gn_lockctl);
3681     printf("\t%10d afs_gn_readlink\n",         cmp->callInfo.C_afs_gn_readlink);
3682     printf("\t%10d afs_gn_readdir\n",         cmp->callInfo.C_afs_gn_readdir);
3683     printf("\t%10d afs_gn_select\n",         cmp->callInfo.C_afs_gn_select);
3684     printf("\t%10d afs_gn_strategy\n",         cmp->callInfo.C_afs_gn_strategy);
3685     printf("\t%10d afs_gn_symlink\n",         cmp->callInfo.C_afs_gn_symlink);
3686     printf("\t%10d afs_gn_revoke\n",         cmp->callInfo.C_afs_gn_revoke);
3687     printf("\t%10d afs_gn_link\n",         cmp->callInfo.C_afs_gn_link);
3688     printf("\t%10d afs_gn_mkdir\n",         cmp->callInfo.C_afs_gn_mkdir);
3689     printf("\t%10d afs_gn_mknod\n",         cmp->callInfo.C_afs_gn_mknod);
3690     printf("\t%10d afs_gn_remove\n",         cmp->callInfo.C_afs_gn_remove);
3691     printf("\t%10d afs_gn_rename\n",         cmp->callInfo.C_afs_gn_rename);
3692     printf("\t%10d afs_gn_rmdir\n",         cmp->callInfo.C_afs_gn_rmdir);
3693     printf("\t%10d afs_gn_fid\n",         cmp->callInfo.C_afs_gn_fid);
3694     printf("\t%10d afs_gn_lookup\n",         cmp->callInfo.C_afs_gn_lookup);
3695     printf("\t%10d afs_gn_open\n",         cmp->callInfo.C_afs_gn_open);
3696     printf("\t%10d afs_gn_create\n",         cmp->callInfo.C_afs_gn_create);
3697     printf("\t%10d afs_gn_hold\n",         cmp->callInfo.C_afs_gn_hold);
3698     printf("\t%10d afs_gn_rele\n",         cmp->callInfo.C_afs_gn_rele);
3699     printf("\t%10d afs_gn_unmap\n",         cmp->callInfo.C_afs_gn_unmap);
3700     printf("\t%10d afs_gn_access\n",         cmp->callInfo.C_afs_gn_access);
3701     printf("\t%10d afs_gn_getattr\n",         cmp->callInfo.C_afs_gn_getattr);
3702     printf("\t%10d afs_gn_setattr\n",         cmp->callInfo.C_afs_gn_setattr);
3703     printf("\t%10d afs_gn_fclear\n",         cmp->callInfo.C_afs_gn_fclear);
3704     printf("\t%10d afs_gn_fsync\n",         cmp->callInfo.C_afs_gn_fsync);
3705     printf("\t%10d phash\n",         cmp->callInfo.C_pHash);
3706     printf("\t%10d DInit\n",         cmp->callInfo.C_DInit);
3707     printf("\t%10d DRead\n",         cmp->callInfo.C_DRead);
3708     printf("\t%10d FixupBucket\n",         cmp->callInfo.C_FixupBucket);
3709     printf("\t%10d afs_newslot\n",         cmp->callInfo.C_afs_newslot);
3710     printf("\t%10d DRelease\n",         cmp->callInfo.C_DRelease);
3711     printf("\t%10d DFlush\n",         cmp->callInfo.C_DFlush);
3712     printf("\t%10d DFlushEntry\n",         cmp->callInfo.C_DFlushEntry);
3713     printf("\t%10d DVOffset\n",         cmp->callInfo.C_DVOffset);
3714     printf("\t%10d DZap\n",         cmp->callInfo.C_DZap);
3715     printf("\t%10d DNew\n",         cmp->callInfo.C_DNew);
3716     printf("\t%10d afs_RemoveVCB\n",         cmp->callInfo.C_afs_RemoveVCB);
3717     printf("\t%10d afs_NewVCache\n",         cmp->callInfo.C_afs_NewVCache);
3718     printf("\t%10d afs_FlushActiveVcaches\n",         cmp->callInfo.C_afs_FlushActiveVcaches);
3719     printf("\t%10d afs_VerifyVCache\n",         cmp->callInfo.C_afs_VerifyVCache);
3720     printf("\t%10d afs_WriteVCache\n",         cmp->callInfo.C_afs_WriteVCache);
3721     printf("\t%10d afs_GetVCache\n",         cmp->callInfo.C_afs_GetVCache);
3722     printf("\t%10d afs_StuffVcache\n",         cmp->callInfo.C_afs_StuffVcache);
3723     printf("\t%10d afs_FindVCache\n",         cmp->callInfo.C_afs_FindVCache);
3724     printf("\t%10d afs_PutDCache\n",         cmp->callInfo.C_afs_PutDCache);
3725     printf("\t%10d afs_PutVCache\n",         cmp->callInfo.C_afs_PutVCache);
3726     printf("\t%10d CacheStoreProc\n",         cmp->callInfo.C_CacheStoreProc);
3727     printf("\t%10d afs_FindDcache\n",         cmp->callInfo.C_afs_FindDCache);
3728     printf("\t%10d afs_TryToSmush\n",         cmp->callInfo.C_afs_TryToSmush);
3729     printf("\t%10d afs_AdjustSize\n",         cmp->callInfo.C_afs_AdjustSize);
3730     printf("\t%10d afs_CheckSize\n",         cmp->callInfo.C_afs_CheckSize);
3731     printf("\t%10d afs_StoreWarn\n",         cmp->callInfo.C_afs_StoreWarn);
3732     printf("\t%10d CacheFetchProc\n",         cmp->callInfo.C_CacheFetchProc);
3733     printf("\t%10d UFS_CacheStoreProc\n",         cmp->callInfo.C_UFS_CacheStoreProc);
3734     printf("\t%10d UFS_CacheFetchProc\n",         cmp->callInfo.C_UFS_CacheFetchProc);
3735     printf("\t%10d afs_GetDCache\n",         cmp->callInfo.C_afs_GetDCache);
3736     printf("\t%10d afs_SimpleVStat\n",         cmp->callInfo.C_afs_SimpleVStat);
3737     printf("\t%10d afs_ProcessFS\n",         cmp->callInfo.C_afs_ProcessFS);
3738     printf("\t%10d afs_InitCacheInfo\n",         cmp->callInfo.C_afs_InitCacheInfo);
3739     printf("\t%10d afs_InitVolumeInfo\n",         cmp->callInfo.C_afs_InitVolumeInfo);
3740     printf("\t%10d afs_InitCacheFile\n",         cmp->callInfo.C_afs_InitCacheFile);
3741     printf("\t%10d afs_CacheInit\n",         cmp->callInfo.C_afs_CacheInit);
3742     printf("\t%10d afs_GetDSlot\n",         cmp->callInfo.C_afs_GetDSlot);
3743     printf("\t%10d afs_WriteThroughDSlots\n",         cmp->callInfo.C_afs_WriteThroughDSlots);
3744     printf("\t%10d afs_MemGetDSlot\n",         cmp->callInfo.C_afs_MemGetDSlot);
3745     printf("\t%10d afs_UFSGetDSlot\n",         cmp->callInfo.C_afs_UFSGetDSlot);
3746     printf("\t%10d afs_StoreDCache\n",         cmp->callInfo.C_afs_StoreDCache);
3747     printf("\t%10d afs_StoreMini\n",         cmp->callInfo.C_afs_StoreMini);
3748     printf("\t%10d afs_StoreAllSegments\n",         cmp->callInfo.C_afs_StoreAllSegments);
3749     printf("\t%10d afs_InvalidateAllSegments\n",         cmp->callInfo.C_afs_InvalidateAllSegments);
3750     printf("\t%10d afs_TruncateAllSegments\n",         cmp->callInfo.C_afs_TruncateAllSegments);
3751     printf("\t%10d afs_CheckVolSync\n",         cmp->callInfo.C_afs_CheckVolSync);
3752     printf("\t%10d afs_wakeup\n",         cmp->callInfo.C_afs_wakeup);
3753     printf("\t%10d afs_CFileOpen\n",         cmp->callInfo.C_afs_CFileOpen);
3754     printf("\t%10d afs_CFileTruncate\n",         cmp->callInfo.C_afs_CFileTruncate);
3755     printf("\t%10d afs_GetDownD\n",         cmp->callInfo.C_afs_GetDownD);
3756     printf("\t%10d afs_WriteDCache\n",         cmp->callInfo.C_afs_WriteDCache);
3757     printf("\t%10d afs_FlushDCache\n",         cmp->callInfo.C_afs_FlushDCache);
3758     printf("\t%10d afs_GetDownDSlot\n",         cmp->callInfo.C_afs_GetDownDSlot);
3759     printf("\t%10d afs_FlushVCache\n",         cmp->callInfo.C_afs_FlushVCache);
3760     printf("\t%10d afs_GetDownV\n",         cmp->callInfo.C_afs_GetDownV);
3761     printf("\t%10d afs_QueueVCB\n",         cmp->callInfo.C_afs_QueueVCB);
3762     printf("\t%10d afs_call\n",         cmp->callInfo.C_afs_call);
3763     printf("\t%10d afs_syscall_call\n",         cmp->callInfo.C_afs_syscall_call);
3764     printf("\t%10d afs_syscall_icreate\n",         cmp->callInfo.C_afs_syscall_icreate);
3765     printf("\t%10d afs_syscall_iopen\n",         cmp->callInfo.C_afs_syscall_iopen);
3766     printf("\t%10d afs_syscall_iincdec\n",         cmp->callInfo.C_afs_syscall_iincdec);
3767     printf("\t%10d afs_syscall_ireadwrite\n",         cmp->callInfo.C_afs_syscall_ireadwrite);
3768     printf("\t%10d afs_syscall\n",         cmp->callInfo.C_afs_syscall);
3769     printf("\t%10d lpioctl\n",         cmp->callInfo.C_lpioctl);
3770     printf("\t%10d lsetpag\n",         cmp->callInfo.C_lsetpag);
3771     printf("\t%10d afs_CheckInit\n",         cmp->callInfo.C_afs_CheckInit);
3772     printf("\t%10d ClearCallback\n",         cmp->callInfo.C_ClearCallBack);
3773     printf("\t%10d SRXAFSCB_GetCE\n",         cmp->callInfo.C_SRXAFSCB_GetCE);
3774     printf("\t%10d SRXAFSCB_GetLock\n",         cmp->callInfo.C_SRXAFSCB_GetLock);
3775     printf("\t%10d SRXAFSCB_CallBack\n",         cmp->callInfo.C_SRXAFSCB_CallBack);
3776     printf("\t%10d SRXAFSCB_InitCallBackState\n",         cmp->callInfo.C_SRXAFSCB_InitCallBackState);
3777     printf("\t%10d SRXAFSCB_Probe\n",         cmp->callInfo.C_SRXAFSCB_Probe);
3778     printf("\t%10d afs_Chunk\n",         cmp->callInfo.C_afs_Chunk);
3779     printf("\t%10d afs_ChunkBase\n",         cmp->callInfo.C_afs_ChunkBase);
3780     printf("\t%10d afs_ChunkOffset\n",         cmp->callInfo.C_afs_ChunkOffset);
3781     printf("\t%10d afs_ChunkSize\n",         cmp->callInfo.C_afs_ChunkSize);
3782     printf("\t%10d afs_ChunkToBase\n",         cmp->callInfo.C_afs_ChunkToBase);
3783     printf("\t%10d afs_ChunkToSize\n",         cmp->callInfo.C_afs_ChunkToSize);
3784     printf("\t%10d afs_SetChunkSize\n",         cmp->callInfo.C_afs_SetChunkSize);
3785     printf("\t%10d afs_config\n",         cmp->callInfo.C_afs_config);
3786     printf("\t%10d mem_freebytes\n",         cmp->callInfo.C_mem_freebytes);
3787     printf("\t%10d mem_getbytes\n",         cmp->callInfo.C_mem_getbytes);
3788     printf("\t%10d afs_Daemon\n",         cmp->callInfo.C_afs_Daemon);
3789     printf("\t%10d afs_CheckRootVolume\n",         cmp->callInfo.C_afs_CheckRootVolume);
3790     printf("\t%10d BPath\n",         cmp->callInfo.C_BPath);
3791     printf("\t%10d BPrefetch\n",         cmp->callInfo.C_BPrefetch);
3792     printf("\t%10d BStore\n",         cmp->callInfo.C_BStore);
3793     printf("\t%10d afs_BBusy\n",         cmp->callInfo.C_afs_BBusy);
3794     printf("\t%10d afs_BQueue\n",         cmp->callInfo.C_afs_BQueue);
3795     printf("\t%10d afs_BRelease\n",         cmp->callInfo.C_afs_BRelease);
3796     printf("\t%10d afs_BackgroundDaemon\n",         cmp->callInfo.C_afs_BackgroundDaemon);
3797     printf("\t%10d exporter_add\n",         cmp->callInfo.C_exporter_add);
3798     printf("\t%10d exporter_find\n",         cmp->callInfo.C_exporter_find);
3799     printf("\t%10d afs_gfs_kalloc\n",         cmp->callInfo.C_afs_gfs_kalloc);
3800     printf("\t%10d afs_gfs_kfree\n",         cmp->callInfo.C_afs_gfs_kfree);
3801     printf("\t%10d gop_lookupname\n",         cmp->callInfo.C_gop_lookupname);
3802     printf("\t%10d afs_uniqtime\n",         cmp->callInfo.C_afs_uniqtime);
3803     printf("\t%10d gfs_vattr_null\n",         cmp->callInfo.C_gfs_vattr_null);
3804     printf("\t%10d afs_lock\n",         cmp->callInfo.C_afs_lock);
3805     printf("\t%10d afs_unlock\n",         cmp->callInfo.C_afs_unlock);
3806     printf("\t%10d afs_update\n",         cmp->callInfo.C_afs_update);
3807     printf("\t%10d afs_gclose\n",         cmp->callInfo.C_afs_gclose);
3808     printf("\t%10d afs_gopen\n",         cmp->callInfo.C_afs_gopen);
3809     printf("\t%10d afs_greadlink\n",         cmp->callInfo.C_afs_greadlink);
3810     printf("\t%10d afs_select\n",         cmp->callInfo.C_afs_select);
3811     printf("\t%10d afs_gbmap\n",         cmp->callInfo.C_afs_gbmap);
3812     printf("\t%10d afs_getfsdata\n",         cmp->callInfo.C_afs_getfsdata);
3813     printf("\t%10d afs_gsymlink\n",         cmp->callInfo.C_afs_gsymlink);
3814     printf("\t%10d afs_namei\n",         cmp->callInfo.C_afs_namei);
3815     printf("\t%10d afs_gmount\n",         cmp->callInfo.C_afs_gmount);
3816     printf("\t%10d afs_gget\n",         cmp->callInfo.C_afs_gget);
3817     printf("\t%10d afs_glink\n",         cmp->callInfo.C_afs_glink);
3818     printf("\t%10d afs_gmkdir\n",         cmp->callInfo.C_afs_gmkdir);
3819     printf("\t%10d afs_unlink\n",         cmp->callInfo.C_afs_unlink);
3820     printf("\t%10d afs_grmdir\n",         cmp->callInfo.C_afs_grmdir);
3821     printf("\t%10d afs_makenode\n",         cmp->callInfo.C_afs_makenode);
3822     printf("\t%10d afs_grename\n",         cmp->callInfo.C_afs_grename);
3823     printf("\t%10d afs_rele\n",         cmp->callInfo.C_afs_rele);
3824     printf("\t%10d afs_syncgp\n",         cmp->callInfo.C_afs_syncgp);
3825     printf("\t%10d afs_getval\n",         cmp->callInfo.C_afs_getval);
3826     printf("\t%10d afs_trunc\n",         cmp->callInfo.C_afs_trunc);
3827     printf("\t%10d afs_rwgp\n",         cmp->callInfo.C_afs_rwgp);
3828     printf("\t%10d afs_stat\n",         cmp->callInfo.C_afs_stat);
3829     printf("\t%10d afsc_link\n",         cmp->callInfo.C_afsc_link);
3830     printf("\t%10d afs_vfs_mount\n",         cmp->callInfo.C_afs_vfs_mount);
3831     printf("\t%10d afs_uniqtime\n",         cmp->callInfo.C_afs_uniqtime);
3832     printf("\t%10d iopen\n",         cmp->callInfo.C_iopen);
3833     printf("\t%10d idec\n",         cmp->callInfo.C_idec);
3834     printf("\t%10d iinc\n",         cmp->callInfo.C_iinc);
3835     printf("\t%10d ireadwrite\n",         cmp->callInfo.C_ireadwrite);
3836     printf("\t%10d iread\n",         cmp->callInfo.C_iread);
3837     printf("\t%10d iwrite\n",         cmp->callInfo.C_iwrite);
3838     printf("\t%10d iforget\n",         cmp->callInfo.C_iforget);
3839     printf("\t%10d icreate\n",         cmp->callInfo.C_icreate);
3840     printf("\t%10d igetinode\n",         cmp->callInfo.C_igetinode);
3841     printf("\t%10d osi_SleepR\n",         cmp->callInfo.C_osi_SleepR);
3842     printf("\t%10d osi_SleepS\n",         cmp->callInfo.C_osi_SleepS);
3843     printf("\t%10d osi_SleepW\n",         cmp->callInfo.C_osi_SleepW);
3844     printf("\t%10d osi_Sleep\n",         cmp->callInfo.C_osi_Sleep);
3845     printf("\t%10d afs_LookupMCE\n",         cmp->callInfo.C_afs_LookupMCE);
3846     printf("\t%10d afs_MemReadBlk\n",         cmp->callInfo.C_afs_MemReadBlk);
3847     printf("\t%10d afs_MemReadUIO\n",         cmp->callInfo.C_afs_MemReadUIO);
3848     printf("\t%10d afs_MemWriteBlk\n",         cmp->callInfo.C_afs_MemWriteBlk);
3849     printf("\t%10d afs_MemWriteUIO\n",         cmp->callInfo.C_afs_MemWriteUIO);
3850     printf("\t%10d afs_MemCacheStoreProc\n",         cmp->callInfo.C_afs_MemCacheStoreProc);
3851     printf("\t%10d afs_MemCacheFetchProc\n",         cmp->callInfo.C_afs_MemCacheFetchProc);
3852     printf("\t%10d afs_MemCacheTruncate\n",         cmp->callInfo.C_afs_MemCacheTruncate);
3853     printf("\t%10d afs_MemCacheStoreProc\n",         cmp->callInfo.C_afs_MemCacheStoreProc);
3854     printf("\t%10d afs_GetNfsClientPag\n",         cmp->callInfo.C_afs_GetNfsClientPag);
3855     printf("\t%10d afs_FindNfsClientPag\n",         cmp->callInfo.C_afs_FindNfsClientPag);
3856     printf("\t%10d afs_PutNfsClientPag\n",         cmp->callInfo.C_afs_PutNfsClientPag);
3857     printf("\t%10d afs_nfsclient_reqhandler\n",         cmp->callInfo.C_afs_nfsclient_reqhandler);
3858     printf("\t%10d afs_nfsclient_GC\n",         cmp->callInfo.C_afs_nfsclient_GC);
3859     printf("\t%10d afs_nfsclient_hold\n",         cmp->callInfo.C_afs_nfsclient_hold);
3860     printf("\t%10d afs_nfsclient_stats\n",         cmp->callInfo.C_afs_nfsclient_stats);
3861     printf("\t%10d afs_nfsclient_sysname\n",         cmp->callInfo.C_afs_nfsclient_sysname);
3862     printf("\t%10d afs_rfs_dispatch\n",         cmp->callInfo.C_afs_rfs_dispatch);
3863     printf("\t%10d afs_nfs2afscall\n",         cmp->callInfo.C_Nfs2AfsCall);
3864     printf("\t%10d afs_sun_xuntext\n",         cmp->callInfo.C_afs_sun_xuntext);
3865     printf("\t%10d osi_Active\n",         cmp->callInfo.C_osi_Active);
3866     printf("\t%10d osi_FlushPages\n",         cmp->callInfo.C_osi_FlushPages);
3867     printf("\t%10d osi_FlushText\n",         cmp->callInfo.C_osi_FlushText);
3868     printf("\t%10d osi_CallProc\n",         cmp->callInfo.C_osi_CallProc);
3869     printf("\t%10d osi_CancelProc\n",         cmp->callInfo.C_osi_CancelProc);
3870     printf("\t%10d osi_Invisible\n",         cmp->callInfo.C_osi_Invisible);
3871     printf("\t%10d osi_Time\n",         cmp->callInfo.C_osi_Time);
3872     printf("\t%10d osi_Alloc\n",         cmp->callInfo.C_osi_Alloc);
3873     printf("\t%10d osi_SetTime\n",         cmp->callInfo.C_osi_SetTime);
3874     printf("\t%10d osi_Dump\n",         cmp->callInfo.C_osi_Dump);
3875     printf("\t%10d osi_Free\n",         cmp->callInfo.C_osi_Free);
3876     printf("\t%10d osi_UFSOpen\n",         cmp->callInfo.C_osi_UFSOpen);
3877     printf("\t%10d osi_Close\n",         cmp->callInfo.C_osi_Close);
3878     printf("\t%10d osi_Stat\n",         cmp->callInfo.C_osi_Stat);
3879     printf("\t%10d osi_Truncate\n",         cmp->callInfo.C_osi_Truncate);
3880     printf("\t%10d osi_Read\n",         cmp->callInfo.C_osi_Read);
3881     printf("\t%10d osi_Write\n",         cmp->callInfo.C_osi_Write);
3882     printf("\t%10d osi_MapStrategy\n",         cmp->callInfo.C_osi_MapStrategy);
3883     printf("\t%10d osi_AllocLargeSpace\n",         cmp->callInfo.C_osi_AllocLargeSpace);
3884     printf("\t%10d osi_FreeLargeSpace\n",         cmp->callInfo.C_osi_FreeLargeSpace);
3885     printf("\t%10d osi_AllocSmallSpace\n",         cmp->callInfo.C_osi_AllocSmallSpace);
3886     printf("\t%10d osi_FreeSmallSpace\n",         cmp->callInfo.C_osi_FreeSmallSpace);
3887     printf("\t%10d osi_CloseToTheEdge\n",         cmp->callInfo.C_osi_CloseToTheEdge);
3888     printf("\t%10d osi_xgreedy\n",         cmp->callInfo.C_osi_xgreedy);
3889     printf("\t%10d osi_FreeSocket\n",         cmp->callInfo.C_osi_FreeSocket);
3890     printf("\t%10d osi_NewSocket\n",         cmp->callInfo.C_osi_NewSocket);
3891     printf("\t%10d osi_NetSend\n",         cmp->callInfo.C_osi_NetSend);
3892     printf("\t%10d WaitHack\n",         cmp->callInfo.C_WaitHack);
3893     printf("\t%10d osi_CancelWait\n",         cmp->callInfo.C_osi_CancelWait);
3894     printf("\t%10d osi_Wakeup\n",         cmp->callInfo.C_osi_Wakeup);
3895     printf("\t%10d osi_Wait\n",         cmp->callInfo.C_osi_Wait);
3896     printf("\t%10d dirp_Read\n",         cmp->callInfo.C_dirp_Read);
3897     printf("\t%10d dirp_Cpy\n",         cmp->callInfo.C_dirp_Cpy);
3898     printf("\t%10d dirp_Eq\n",         cmp->callInfo.C_dirp_Eq);
3899     printf("\t%10d dirp_Write\n",         cmp->callInfo.C_dirp_Write);
3900     printf("\t%10d dirp_Zap\n",         cmp->callInfo.C_dirp_Zap);
3901     printf("\t%10d afs_ioctl\n",         cmp->callInfo.C_afs_ioctl);
3902     printf("\t%10d handleIoctl\n",         cmp->callInfo.C_HandleIoctl);
3903     printf("\t%10d afs_xioctl\n",         cmp->callInfo.C_afs_xioctl);
3904     printf("\t%10d afs_pioctl\n",         cmp->callInfo.C_afs_pioctl);
3905     printf("\t%10d HandlePioctl\n",         cmp->callInfo.C_HandlePioctl);
3906     printf("\t%10d PGetVolumeStatus\n",         cmp->callInfo.C_PGetVolumeStatus);
3907     printf("\t%10d PSetVolumeStatus\n",         cmp->callInfo.C_PSetVolumeStatus);
3908     printf("\t%10d PFlush\n",         cmp->callInfo.C_PFlush);
3909     printf("\t%10d PFlushVolumeData\n",         cmp->callInfo.C_PFlushVolumeData);
3910     printf("\t%10d PNewStatMount\n",         cmp->callInfo.C_PNewStatMount);
3911     printf("\t%10d PGetTokens\n",         cmp->callInfo.C_PGetTokens);
3912     printf("\t%10d PSetTokens\n",         cmp->callInfo.C_PSetTokens);
3913     printf("\t%10d PUnlog\n",         cmp->callInfo.C_PUnlog);
3914     printf("\t%10d PCheckServers\n",         cmp->callInfo.C_PCheckServers);
3915     printf("\t%10d PCheckAuth\n",         cmp->callInfo.C_PCheckAuth);
3916     printf("\t%10d PCheckVolNames\n",         cmp->callInfo.C_PCheckVolNames);
3917     printf("\t%10d PFindVolume\n",         cmp->callInfo.C_PFindVolume);
3918     printf("\t%10d Prefetch\n",         cmp->callInfo.C_Prefetch);
3919     printf("\t%10d PGetCacheSize\n",         cmp->callInfo.C_PGetCacheSize);
3920     printf("\t%10d PSetCacheSize\n",         cmp->callInfo.C_PSetCacheSize);
3921     printf("\t%10d PSetSysName\n",         cmp->callInfo.C_PSetSysName);
3922     printf("\t%10d PExportAfs\n",         cmp->callInfo.C_PExportAfs);
3923     printf("\t%10d HandleClientContext\n",         cmp->callInfo.C_HandleClientContext);
3924     printf("\t%10d PViceAccess\n",         cmp->callInfo.C_PViceAccess);
3925     printf("\t%10d PRemoveCallBack\n",         cmp->callInfo.C_PRemoveCallBack);
3926     printf("\t%10d PRemoveMount\n",         cmp->callInfo.C_PRemoveMount);
3927     printf("\t%10d PSetVolumeStatus\n",         cmp->callInfo.C_PSetVolumeStatus);
3928     printf("\t%10d PListCells\n",         cmp->callInfo.C_PListCells);
3929     printf("\t%10d PNewCell\n",         cmp->callInfo.C_PNewCell);
3930     printf("\t%10d PGetUserCell\n",         cmp->callInfo.C_PGetUserCell);
3931     printf("\t%10d PGetCellStatus\n",         cmp->callInfo.C_PGetCellStatus);
3932     printf("\t%10d PSetCellStatus\n",         cmp->callInfo.C_PSetCellStatus);
3933     printf("\t%10d PVenusLogging\n",         cmp->callInfo.C_PVenusLogging);
3934     printf("\t%10d PGetAcl\n",         cmp->callInfo.C_PGetAcl);
3935     printf("\t%10d PGetFID\n",         cmp->callInfo.C_PGetFID);
3936     printf("\t%10d PSetAcl\n",         cmp->callInfo.C_PSetAcl);
3937     printf("\t%10d PGetFileCell\n",         cmp->callInfo.C_PGetFileCell);
3938     printf("\t%10d PGetWSCell\n",         cmp->callInfo.C_PGetWSCell);
3939     printf("\t%10d PGetSPrefs\n",         cmp->callInfo.C_PGetSPrefs);
3940     printf("\t%10d PSetSPrefs\n",         cmp->callInfo.C_PSetSPrefs);
3941     printf("\t%10d afs_ResetAccessCache\n",         cmp->callInfo.C_afs_ResetAccessCache);
3942     printf("\t%10d afs_FindUser\n",         cmp->callInfo.C_afs_FindUser);
3943     printf("\t%10d afs_GetUser\n",         cmp->callInfo.C_afs_GetUser);
3944     printf("\t%10d afs_GCUserData\n",         cmp->callInfo.C_afs_GCUserData);
3945     printf("\t%10d afs_PutUser\n",         cmp->callInfo.C_afs_PutUser);
3946     printf("\t%10d afs_SetPrimary\n",         cmp->callInfo.C_afs_SetPrimary);
3947     printf("\t%10d afs_ResetUserConns\n",         cmp->callInfo.C_afs_ResetUserConns);
3948     printf("\t%10d afs_RemoveUserConns\n",         cmp->callInfo.C_RemoveUserConns);
3949     printf("\t%10d afs_ResourceInit\n",         cmp->callInfo.C_afs_ResourceInit);
3950     printf("\t%10d afs_GetCell\n",         cmp->callInfo.C_afs_GetCell);
3951     printf("\t%10d afs_GetCellByIndex\n",         cmp->callInfo.C_afs_GetCellByIndex);
3952     printf("\t%10d afs_GetCellByName\n",         cmp->callInfo.C_afs_GetCellByName);
3953     printf("\t%10d afs_GetRealCellByIndex\n",         cmp->callInfo.C_afs_GetRealCellByIndex);
3954     printf("\t%10d afs_NewCell\n",         cmp->callInfo.C_afs_NewCell);
3955     printf("\t%10d CheckVLDB\n",         cmp->callInfo.C_CheckVLDB);
3956     printf("\t%10d afs_GetVolume\n",         cmp->callInfo.C_afs_GetVolume);
3957     printf("\t%10d afs_PutVolume\n",         cmp->callInfo.C_afs_PutVolume);
3958     printf("\t%10d afs_GetVolumeByName\n",         cmp->callInfo.C_afs_GetVolumeByName);
3959     printf("\t%10d afs_random\n",         cmp->callInfo.C_afs_random);
3960     printf("\t%10d InstallVolumeEntry\n",         cmp->callInfo.C_InstallVolumeEntry);
3961     printf("\t%10d InstallVolumeInfo\n",         cmp->callInfo.C_InstallVolumeInfo);
3962     printf("\t%10d afs_ResetVolumeInfo\n",         cmp->callInfo.C_afs_ResetVolumeInfo);
3963     printf("\t%10d afs_FindServer\n",         cmp->callInfo.C_afs_FindServer);
3964     printf("\t%10d afs_GetServer\n",         cmp->callInfo.C_afs_GetServer);
3965     printf("\t%10d afs_SortServers\n",         cmp->callInfo.C_afs_SortServers);
3966     printf("\t%10d afs_CheckServers\n",         cmp->callInfo.C_afs_CheckServers);
3967     printf("\t%10d ServerDown\n",         cmp->callInfo.C_ServerDown);
3968     printf("\t%10d afs_Conn\n",         cmp->callInfo.C_afs_Conn);
3969     printf("\t%10d afs_PutConn\n",         cmp->callInfo.C_afs_PutConn);
3970     printf("\t%10d afs_ConnByHost\n",         cmp->callInfo.C_afs_ConnByHost);
3971     printf("\t%10d afs_ConnByMHosts\n",         cmp->callInfo.C_afs_ConnByMHosts);
3972     printf("\t%10d afs_Analyze\n",         cmp->callInfo.C_afs_Analyze);
3973     printf("\t%10d afs_CheckLocks\n",         cmp->callInfo.C_afs_CheckLocks);
3974     printf("\t%10d CheckVLServer\n",         cmp->callInfo.C_CheckVLServer);
3975     printf("\t%10d afs_CheckCacheResets\n",         cmp->callInfo.C_afs_CheckCacheResets);
3976     printf("\t%10d afs_CheckVolumeNames\n",         cmp->callInfo.C_afs_CheckVolumeNames);
3977     printf("\t%10d afs_CheckCode\n",         cmp->callInfo.C_afs_CheckCode);
3978     printf("\t%10d afs_CopyError\n",         cmp->callInfo.C_afs_CopyError);
3979     printf("\t%10d afs_FinalizeReq\n",         cmp->callInfo.C_afs_FinalizeReq);
3980     printf("\t%10d afs_GetVolCache\n",         cmp->callInfo.C_afs_GetVolCache);
3981     printf("\t%10d afs_GetVolSlot\n",         cmp->callInfo.C_afs_GetVolSlot);
3982     printf("\t%10d afs_UFSGetVolSlot\n",         cmp->callInfo.C_afs_UFSGetVolSlot);
3983     printf("\t%10d afs_MemGetVolSlot\n",         cmp->callInfo.C_afs_MemGetVolSlot);
3984     printf("\t%10d afs_WriteVolCache\n",         cmp->callInfo.C_afs_WriteVolCache);
3985     printf("\t%10d haveCallbacksfrom\n",         cmp->callInfo.C_HaveCallBacksFrom);
3986     printf("\t%10d afs_getpage\n",         cmp->callInfo.C_afs_getpage);
3987     printf("\t%10d afs_putpage\n",         cmp->callInfo.C_afs_putpage);
3988     printf("\t%10d afs_nfsrdwr\n",         cmp->callInfo.C_afs_nfsrdwr);
3989     printf("\t%10d afs_map\n",         cmp->callInfo.C_afs_map);
3990     printf("\t%10d afs_cmp\n",         cmp->callInfo.C_afs_cmp);
3991     printf("\t%10d afs_PageLeft\n",         cmp->callInfo.C_afs_PageLeft);
3992     printf("\t%10d afs_mount\n",         cmp->callInfo.C_afs_mount);
3993     printf("\t%10d afs_unmount\n",         cmp->callInfo.C_afs_unmount);
3994     printf("\t%10d afs_root\n",         cmp->callInfo.C_afs_root);
3995     printf("\t%10d afs_statfs\n",         cmp->callInfo.C_afs_statfs);
3996     printf("\t%10d afs_sync\n",         cmp->callInfo.C_afs_sync);
3997     printf("\t%10d afs_vget\n",         cmp->callInfo.C_afs_vget);
3998     printf("\t%10d afs_index\n",         cmp->callInfo.C_afs_index);
3999     printf("\t%10d afs_setpag\n",         cmp->callInfo.C_afs_setpag);
4000     printf("\t%10d genpag\n",         cmp->callInfo.C_genpag);
4001     printf("\t%10d getpag\n",         cmp->callInfo.C_getpag);
4002     printf("\t%10d genpag\n",         cmp->callInfo.C_genpag);
4003     printf("\t%10d afs_GetMariner\n",         cmp->callInfo.C_afs_GetMariner);
4004     printf("\t%10d afs_AddMarinerName\n",         cmp->callInfo.C_afs_AddMarinerName);
4005     printf("\t%10d afs_open\n",         cmp->callInfo.C_afs_open);
4006     printf("\t%10d afs_close\n",         cmp->callInfo.C_afs_close);
4007     printf("\t%10d afs_closex\n",         cmp->callInfo.C_afs_closex);
4008     printf("\t%10d afs_write\n",         cmp->callInfo.C_afs_write);
4009     printf("\t%10d afs_UFSwrite\n",         cmp->callInfo.C_afs_UFSWrite);
4010     printf("\t%10d afs_Memwrite\n",         cmp->callInfo.C_afs_MemWrite);
4011     printf("\t%10d afs_rdwr\n",         cmp->callInfo.C_afs_rdwr);
4012     printf("\t%10d afs_read\n",         cmp->callInfo.C_afs_read);
4013     printf("\t%10d afs_UFSread\n",         cmp->callInfo.C_afs_UFSRead);
4014     printf("\t%10d afs_Memread\n",         cmp->callInfo.C_afs_MemRead);
4015     printf("\t%10d afs_CopyOutAttrs\n",         cmp->callInfo.C_afs_CopyOutAttrs);
4016     printf("\t%10d afs_access\n",         cmp->callInfo.C_afs_access);
4017     printf("\t%10d afs_getattr\n",         cmp->callInfo.C_afs_getattr);
4018     printf("\t%10d afs_setattr\n",         cmp->callInfo.C_afs_setattr);
4019     printf("\t%10d afs_VAttrToAS\n",         cmp->callInfo.C_afs_VAttrToAS);
4020     printf("\t%10d EvalMountPoint\n",         cmp->callInfo.C_EvalMountPoint);
4021     printf("\t%10d afs_lookup\n",         cmp->callInfo.C_afs_lookup);
4022     printf("\t%10d afs_create\n",         cmp->callInfo.C_afs_create);
4023     printf("\t%10d afs_LocalHero\n",         cmp->callInfo.C_afs_LocalHero);
4024     printf("\t%10d afs_remove\n",         cmp->callInfo.C_afs_remove);
4025     printf("\t%10d afs_link\n",         cmp->callInfo.C_afs_link);
4026     printf("\t%10d afs_rename\n",         cmp->callInfo.C_afs_rename);
4027     printf("\t%10d afs_InitReq\n",         cmp->callInfo.C_afs_InitReq);
4028     printf("\t%10d afs_mkdir\n",         cmp->callInfo.C_afs_mkdir);
4029     printf("\t%10d afs_rmdir\n",         cmp->callInfo.C_afs_rmdir);
4030     printf("\t%10d afs_readdir\n",         cmp->callInfo.C_afs_readdir);
4031     printf("\t%10d afs_read1dir\n",         cmp->callInfo.C_afs_read1dir);
4032     printf("\t%10d afs_readdir_move\n",         cmp->callInfo.C_afs_readdir_move);
4033     printf("\t%10d afs_readdir_iter\n",         cmp->callInfo.C_afs_readdir_iter);
4034     printf("\t%10d afs_symlink\n",         cmp->callInfo.C_afs_symlink);
4035     printf("\t%10d afs_HandleLink\n",         cmp->callInfo.C_afs_HandleLink);
4036     printf("\t%10d afs_MemHandleLink\n",         cmp->callInfo.C_afs_MemHandleLink);
4037     printf("\t%10d afs_UFSHandleLink\n",         cmp->callInfo.C_afs_UFSHandleLink);
4038     printf("\t%10d HandleFlock\n",         cmp->callInfo.C_HandleFlock);
4039     printf("\t%10d afs_readlink\n",         cmp->callInfo.C_afs_readlink);
4040     printf("\t%10d afs_fsync\n",         cmp->callInfo.C_afs_fsync);
4041     printf("\t%10d afs_inactive\n",         cmp->callInfo.C_afs_inactive);
4042     printf("\t%10d afs_ustrategy\n",         cmp->callInfo.C_afs_ustrategy);
4043     printf("\t%10d afs_strategy\n",         cmp->callInfo.C_afs_strategy);
4044     printf("\t%10d afs_bread\n",         cmp->callInfo.C_afs_bread);
4045     printf("\t%10d afs_brelse\n",         cmp->callInfo.C_afs_brelse);
4046     printf("\t%10d afs_bmap\n",         cmp->callInfo.C_afs_bmap);
4047     printf("\t%10d afs_fid\n",         cmp->callInfo.C_afs_fid);
4048     printf("\t%10d afs_FakeOpen\n",         cmp->callInfo.C_afs_FakeOpen);
4049     printf("\t%10d afs_FakeClose\n",         cmp->callInfo.C_afs_FakeClose);
4050     printf("\t%10d afs_StoreOnLastReference\n",         cmp->callInfo.C_afs_StoreOnLastReference);
4051     printf("\t%10d afs_AccessOK\n",         cmp->callInfo.C_afs_AccessOK);
4052     printf("\t%10d afs_GetAccessBits\n",         cmp->callInfo.C_afs_GetAccessBits);
4053     printf("\t%10d afsio_copy\n",         cmp->callInfo.C_afsio_copy);
4054     printf("\t%10d afsio_trim\n",         cmp->callInfo.C_afsio_trim);
4055     printf("\t%10d afsio_skip\n",         cmp->callInfo.C_afsio_skip);
4056     printf("\t%10d afs_page_read\n",         cmp->callInfo.C_afs_page_read);
4057     printf("\t%10d afs_page_write\n",         cmp->callInfo.C_afs_page_write);
4058     printf("\t%10d afs_page_read\n",         cmp->callInfo.C_afs_page_read);
4059     printf("\t%10d afs_get_groups_from_pag\n",         cmp->callInfo.C_afs_get_groups_from_pag);
4060     printf("\t%10d afs_get_pag_from_groups\n",         cmp->callInfo.C_afs_get_pag_from_groups);
4061     printf("\t%10d AddPag\n",         cmp->callInfo.C_AddPag);
4062     printf("\t%10d PagInCred\n",         cmp->callInfo.C_PagInCred);
4063     printf("\t%10d afs_getgroups\n",         cmp->callInfo.C_afs_getgroups);
4064     printf("\t%10d afs_page_in\n",         cmp->callInfo.C_afs_page_in);
4065     printf("\t%10d afs_page_out\n",         cmp->callInfo.C_afs_page_out);
4066     printf("\t%10d afs_AdvanceFD\n",         cmp->callInfo.C_afs_AdvanceFD);
4067     printf("\t%10d afs_lockf\n",         cmp->callInfo.C_afs_lockf);
4068     printf("\t%10d afs_xsetgroups\n",         cmp->callInfo.C_afs_xsetgroups);
4069     printf("\t%10d afs_nlinks\n",         cmp->callInfo.C_afs_nlinks);
4070     printf("\t%10d afs_lockctl\n",         cmp->callInfo.C_afs_lockctl);
4071     printf("\t%10d afs_xflock\n",         cmp->callInfo.C_afs_xflock);
4072     printf("\t%10d PGetCPrefs\n",         cmp->callInfo.C_PGetCPrefs);
4073     printf("\t%10d PSetCPrefs\n",         cmp->callInfo.C_PSetCPrefs);
4074 #ifdef  AFS_HPUX_ENV
4075     printf("\t%10d afs_pagein\n",         cmp->callInfo.C_afs_pagein);
4076     printf("\t%10d afs_pageout\n",         cmp->callInfo.C_afs_pageout);
4077     printf("\t%10d afs_hp_strategy\n",         cmp->callInfo.C_afs_hp_strategy);
4078 #endif
4079 }
4080
4081 #endif
4082 #if 0
4083 #define OffsetOf(s,mem) ((long)(&(((s *)0)->mem)))
4084 #define SizeOf(s,mem)   ((long)sizeof(((s *)0)->mem))
4085 #define values(s,mem)   OffsetOf(s,mem), SizeOf(s,mem)
4086
4087 print_struct_vcache_offsets()
4088 {
4089         printf("struct vcache.v              offset = %ld, size = %ld\n", values(struct vcache, v));
4090         printf("struct vcache.vlruq          offset = %ld, size = %ld\n", values(struct vcache, vlruq));
4091         printf("struct vcache.nextfree       offset = %ld, size = %ld\n", values(struct vcache, nextfree));
4092         printf("struct vcache.hnext          offset = %ld, size = %ld\n", values(struct vcache, hnext));
4093         printf("struct vcache.fid            offset = %ld, size = %ld\n", values(struct vcache, fid));
4094         printf("struct vcache.m              offset = %ld, size = %ld\n", values(struct vcache, m));
4095         printf("struct vcache.lock           offset = %ld, size = %ld\n", values(struct vcache, lock));
4096         printf("struct vcache.parentVnode    offset = %ld, size = %ld\n", values(struct vcache, parentVnode));
4097         printf("struct vcache.parentUnique   offset = %ld, size = %ld\n", values(struct vcache, parentUnique));
4098         printf("struct vcache.mvid           offset = %ld, size = %ld\n", values(struct vcache, mvid));
4099         printf("struct vcache.linkData       offset = %ld, size = %ld\n", values(struct vcache, linkData));
4100         printf("struct vcache.flushDV        offset = %ld, size = %ld\n", values(struct vcache, flushDV));
4101         printf("struct vcache.mapDV          offset = %ld, size = %ld\n", values(struct vcache, mapDV));
4102         printf("struct vcache.truncPos       offset = %ld, size = %ld\n", values(struct vcache, truncPos));
4103         printf("struct vcache.callback       offset = %ld, size = %ld\n", values(struct vcache, callback));
4104         printf("struct vcache.cbExpires      offset = %ld, size = %ld\n", values(struct vcache, cbExpires));
4105         printf("struct vcache.callsort       offset = %ld, size = %ld\n", values(struct vcache, callsort));
4106         printf("struct vcache.Access         offset = %ld, size = %ld\n", values(struct vcache, Access));
4107         printf("struct vcache.anyAccess      offset = %ld, size = %ld\n", values(struct vcache, anyAccess));
4108         printf("struct vcache.last_looker    offset = %ld, size = %ld\n", values(struct vcache, last_looker));
4109         printf("struct vcache.activeV        offset = %ld, size = %ld\n", values(struct vcache, activeV));
4110         printf("struct vcache.slocks         offset = %ld, size = %ld\n", values(struct vcache, slocks));
4111         printf("struct vcache.opens          offset = %ld, size = %ld\n", values(struct vcache, opens));
4112         printf("struct vcache.execsOrWriters offset = %ld, size = %ld\n", values(struct vcache, execsOrWriters));
4113         printf("struct vcache.flockCount     offset = %ld, size = %ld\n", values(struct vcache, flockCount));
4114         printf("struct vcache.mvstat         offset = %ld, size = %ld\n", values(struct vcache, mvstat));
4115         printf("struct vcache.states         offset = %ld, size = %ld\n", values(struct vcache, states));
4116         printf("struct vcache.quick          offset = %ld, size = %ld\n", values(struct vcache, quick));
4117         printf("struct vcache.symhintstamp   offset = %ld, size = %ld\n", values(struct vcache, symhintstamp));
4118         printf("struct vcache.h1             offset = %ld, size = %ld\n", values(struct vcache, h1));
4119         printf("struct vcache.lastr          offset = %ld, size = %ld\n", values(struct vcache, lastr));
4120         printf("struct vcache.vc_rwlockid    offset = %ld, size = %ld\n", values(struct vcache, vc_rwlockid));
4121         printf("struct vcache.vc_locktrips   offset = %ld, size = %ld\n", values(struct vcache, vc_locktrips));
4122         printf("struct vcache.vc_rwlock      offset = %ld, size = %ld\n", values(struct vcache, vc_rwlock));
4123         printf("struct vcache.mapcnt         offset = %ld, size = %ld\n", values(struct vcache, mapcnt));
4124         printf("struct vcache.cred           offset = %ld, size = %ld\n", values(struct vcache, cred));
4125         printf("struct vcache.vc_bhv_desc    offset = %ld, size = %ld\n", values(struct vcache, vc_bhv_desc));
4126         printf("struct vcache.vc_error       offset = %ld, size = %ld\n", values(struct vcache, vc_error));
4127         printf("struct vcache.xlatordv       offset = %ld, size = %ld\n", values(struct vcache, xlatordv));
4128         printf("struct vcache.uncred         offset = %ld, size = %ld\n", values(struct vcache, uncred));
4129         printf("struct vcache.asynchrony     offset = %ld, size = %ld\n", values(struct vcache, asynchrony));
4130 }
4131
4132 print_struct_vnode_offsets()
4133 {
4134         printf("struct vnode.v_list           offset = %ld, size = %ld\n", values(struct vnode, v_list));
4135         printf("struct vnode.v_flag           offset = %ld, size = %ld\n", values(struct vnode, v_flag));
4136         printf("struct vnode.v_count          offset = %ld, size = %ld\n", values(struct vnode, v_count));
4137         printf("struct vnode.v_listid         offset = %ld, size = %ld\n", values(struct vnode, v_listid));
4138         printf("struct vnode.v_intpcount      offset = %ld, size = %ld\n", values(struct vnode, v_intpcount));
4139         printf("struct vnode.v_type           offset = %ld, size = %ld\n", values(struct vnode, v_type));
4140         printf("struct vnode.v_rdev           offset = %ld, size = %ld\n", values(struct vnode, v_rdev));
4141         printf("struct vnode.v_vfsmountedhere offset = %ld, size = %ld\n", values(struct vnode, v_vfsmountedhere));
4142         printf("struct vnode.v_vfsp           offset = %ld, size = %ld\n", values(struct vnode, v_vfsp));
4143         printf("struct vnode.v_stream         offset = %ld, size = %ld\n", values(struct vnode, v_stream));
4144         printf("struct vnode.v_filocks        offset = %ld, size = %ld\n", values(struct vnode, v_filocks));
4145         printf("struct vnode.v_filocksem      offset = %ld, size = %ld\n", values(struct vnode, v_filocksem));
4146         printf("struct vnode.v_number         offset = %ld, size = %ld\n", values(struct vnode, v_number));
4147         printf("struct vnode.v_bh             offset = %ld, size = %ld\n", values(struct vnode, v_bh));
4148         printf("struct vnode.v_namecap        offset = %ld, size = %ld\n", values(struct vnode, v_namecap));
4149         printf("struct vnode.v_hashp          offset = %ld, size = %ld\n", values(struct vnode, v_hashp));
4150         printf("struct vnode.v_hashn          offset = %ld, size = %ld\n", values(struct vnode, v_hashn));
4151         printf("struct vnode.v_mreg           offset = %ld, size = %ld\n", values(struct vnode, v_mreg));
4152         printf("struct vnode.v_mregb          offset = %ld, size = %ld\n", values(struct vnode, v_mregb));
4153         printf("struct vnode.v_pgcnt          offset = %ld, size = %ld\n", values(struct vnode, v_pgcnt));
4154         printf("struct vnode.v_dpages         offset = %ld, size = %ld\n", values(struct vnode, v_dpages));
4155         printf("struct vnode.v_dpages_gen     offset = %ld, size = %ld\n", values(struct vnode, v_dpages_gen));
4156         printf("struct vnode.v_dbuf           offset = %ld, size = %ld\n", values(struct vnode, v_dbuf));
4157         printf("struct vnode.v_buf            offset = %ld, size = %ld\n", values(struct vnode, v_buf));
4158         printf("struct vnode.v_bufgen         offset = %ld, size = %ld\n", values(struct vnode, v_bufgen));
4159         printf("struct vnode.v_traceix        offset = %ld, size = %ld\n", values(struct vnode, v_traceix));
4160         printf("struct vnode.v_buf_lock       offset = %ld, size = %ld\n", values(struct vnode, v_buf_lock));
4161         printf("struct vnode.v_pc             offset = %ld, size = %ld\n", values(struct vnode, v_pc));
4162 #ifdef VNODE_TRACING
4163         printf("struct vnode.v_trace          offset = %ld, size = %ld\n", values(struct vnode, v_trace));
4164 #endif
4165 #ifdef CKPT
4166         printf("struct vnode.v_ckpt           offset = %ld, size = %ld\n", values(struct vnode, v_ckpt));
4167 #endif
4168 }
4169 #endif