2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
17 #if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
19 #ifdef AFS_LINUX24_ENV
21 #include <linux/string.h>
23 #define _SYS_STATFS_H 1
24 #define _BITS_SIGCONTEXT_H 1
28 #ifdef AFS_LINUX26_ENV
29 /* For some reason, this doesn't get defined in linux/types.h
30 if __KERNEL_STRICT_NAMES is defined. But the definition of
34 #define pgoff_t unsigned long
47 #define __LINUX_UFS_FS_SB_H
49 #define _LINUX_CODA_FS_I
50 #define _LINUX_NTFS_FS_SB_H
51 #define _LINUX_NTFS_FS_I_H
61 struct nfs_inode_info {
63 struct sysv_inode_info {
65 struct coda_inode_info {
67 struct affs_inode_info {
69 struct nfs_lock_info {
73 struct ntfs_inode_info {
77 #include <linux/types.h>
78 #define u32 unsigned int
80 #define u16 unsigned short
82 #if __GLIBC_MINOR__ >= 2
83 #define _SYS_TYPES_H 1
88 /* This tells afs.h to pick up afs_args from the dest tree. */
92 * Need to include <netdb.h> before _KERNEL is defined since on IRIX 6.5
93 * <netdb.h> includes <netinet/in.h>, which in turn declares inet_addr()
94 * if _KERNEL is defined. This declaration conflicts with that in
97 #if ! defined(AFS_AIX_ENV)
101 /* For AFS_SGI61_ENV and a 64 bit OS, _KMEMUSER should be defined on the
102 * compile line for kdump.o in the Makefile. This lets us pick up
103 * app32_ptr_t from types.h when included from afs/param.h.
109 #ifndef AFS_LINUX20_ENV
117 #include <afs/stds.h>
119 #ifdef AFS_SUN5_ENV /*XXXXX*/
120 #include <sys/t_lock.h>
126 #include <sys/sema.h>
127 #ifndef AFS_SGI62_ENV
133 #include <sys/fcntl.h>
139 #include <sys/param.h>
141 #ifndef AFS_SGI64_ENV
142 #include <sys/user.h>
145 #ifndef AFS_LINUX26_ENV
146 #include <sys/file.h>
150 * On SGIs, when _KERNEL is defined, <netinet/in.h> declares inet_addr()
151 * in a way that conflicts with the declaration in <arpa/inet.h>.
153 * Here we bring in <netinet/in.h> without _KERNEL defined and restore
154 * _KERNEL afterwards if needed.
156 * A better solution might be to straighten out which #includes are
157 * sensitive to _KERNEL on SGIs....
159 #if defined(AFS_SGI_ENV) && defined(_KERNEL)
161 # include <netinet/in.h> /* struct in_addr */
164 # include <netinet/in.h> /* struct in_addr */
167 #if defined(AFS_SGI_ENV)
169 #include <sys/vnode.h>
170 #endif /* AFS_SGI_ENV */
172 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
173 #include <sys/vnode.h>
174 #include <sys/mount.h>
175 #include <ufs/ufs/quota.h>
176 #include <ufs/ufs/inode.h>
177 #include <ufs/ffs/fs.h>
180 #ifdef AFS_LINUX20_ENV
182 #define UIO_MAXIOV 1 /* don't care */
184 #if __GLIBC_MINOR__ == 0
188 /*#define _SYS_UIO_H */
189 #define _LINUX_SOCKET_H
194 #define _LINUX_TIME_H
195 #ifndef AFS_LINUX26_ENV
196 #define _LINUX_FCNTL_H
198 #ifdef AFS_IA64_LINUX24_ENV
199 #define flock64 flock
200 #endif /* AFS_IA64_LINUX24_ENV */
201 #ifdef AFS_S390_LINUX20_ENV
202 #define _S390_STATFS_H
204 #ifdef AFS_SPARC64_LINUX20_ENV
205 #define _SPARC64_STATFS_H
206 #define _SPARC_STATFS_H
208 #ifdef AFS_SPARC_LINUX20_ENV
209 #define _SPARC_STATFS_H
211 #ifdef AFS_ALPHA_LINUX20_ENV
212 #define _ALPHA_STATFS_H
214 #define _I386_STATFS_H
215 #endif /* AFS_ALPHA_LINUX20_ENV */
216 #endif /* AFS_SPARC_LINUX20_ENV */
217 #endif /* AFS_SPARC64_LINUX20_ENV */
218 #endif /* AFS_S390_LINUX20_ENV */
222 #if 0 /*ndef AFS_ALPHA_LINUX20_ENV */
223 typedef struct timeval {
226 } timeval_t; /* Needed here since KERNEL defined. */
227 #endif /*AFS_ALPHA_LINUX20_ENV */
228 #if defined(WORDS_BIGENDIAN)
229 #define _LINUX_BYTEORDER_BIG_ENDIAN_H
231 #define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
233 /* Avoid problems with timer_t redefinition */
235 #define timer_t ktimer_t
236 #define timer_t_redefined
238 #ifdef AFS_LINUX26_ENV
239 /* For some reason, this doesn't get defined in linux/types.h
240 if __KERNEL_STRICT_NAMES is defined. But the definition of
241 struct inode uses it.
243 #ifndef HAVE_SECTOR_T
244 /* got it from linux/types.h */
245 typedef unsigned long sector_t;
246 #endif /* HAVE_SECTOR_T */
247 #endif /* AFS_LINUX26_ENV */
248 #include <linux/version.h>
249 #include <linux/fs.h>
251 #ifdef timer_t_redefined
253 #undef timer_t_redefined
255 #else /* AFS_LINUX20_ENV */
256 #ifdef AFS_HPUX110_ENV
259 /* Declare following so sys/vnode.h will compile with KERNEL defined */
261 typedef enum _spustate { /* FROM /etc/conf/h/_types.h */
262 SPUSTATE_NONE = 0, /* must be 0 for proper initialization */
263 SPUSTATE_IDLE, /* spu is idle */
264 SPUSTATE_USER, /* spu is in user mode */
265 SPUSTATE_SYSTEM, /* spu is in system mode */
266 SPUSTATE_UNKNOWN, /* utility code for NEW_INTERVAL() */
267 SPUSTATE_NOCHANGE /* utility code for NEW_INTERVAL() */
269 #define k_off_t off_t
270 #include "sys/vnode.h"
273 #else /* AFS_HPUX110_ENV */
274 #include "sys/vnode.h"
275 #endif /* else AFS_HPUX110_ENV */
276 #endif /* else AFS_LINUX20_ENV */
278 #include "sys/inode.h"
282 #include "sys/fs/ufs_inode.h"
284 #ifndef AFS_LINUX20_ENV
285 #include "ufs/inode.h"
295 /* This definition is in rx_machdep.h, currently only for AIX 41 */
296 #define RX_ENABLE_LOCKS
297 /* The following two defines are from rx_machdep.h and are used in rx_
300 #define afs_kmutex_t int
301 #define afs_kcondvar_t int
302 #endif /* AFS_AIX41_ENV */
307 #define RX_ENABLE_LOCKS
310 * Removed redefinitions of afs_kmutex_t and afs_kcondvar_t and included
311 * the system header files in which they are defined
313 #include <sys/mutex.h>
314 #include <sys/condvar.h>
315 typedef kmutex_t afs_kmutex_t;
316 typedef kcondvar_t afs_kcondvar_t;
317 #endif /* AFS_SUN5_ENV */
319 #ifdef AFS_HPUX110_ENV
320 #define RX_ENABLE_LOCKS
333 typedef char *afs_kcondvar_t;
334 #endif /* AFS_HPUX110_ENV */
337 #define RX_ENABLE_LOCKS 1
339 __psunsigned_t opaque1;
343 __psunsigned_t opaque;
345 #endif /* AFS_SGI65_ENV */
347 #ifdef AFS_LINUX20_ENV
348 #include <asm/atomic.h>
349 #include <asm/semaphore.h>
350 #define RX_ENABLE_LOCKS 1
352 struct semaphore opaque1;
355 typedef void *afs_kcondvar_t;
356 #endif /* AFS_LINUX20_ENV */
358 #include <afs/exporter.h>
359 /*#include "afs/osi.h"*/
364 } osi_timeval_t; /* Needed here since KERNEL defined. */
366 /*#include "afs/volerrors.h"*/
367 #ifdef AFS_LINUX20_ENV
371 #include <afs/afsint.h>
372 #include "vlserver/vldbint.h"
373 #include "afs/lock.h"
387 extern off64_t lseek64();
388 #define KDUMP_SIZE_T size_t
389 #else /* AFS_SGI61_ENV */
390 #define KDUMP_SIZE_T int
391 #endif /* AFS_SGI61_ENV */
393 #include "afs/afs.h" /* XXXX Getting it from the obj tree XXX */
394 #include "afs/afs_axscache.h" /* XXXX Getting it from the obj tree XXX */
395 #include <afs/afs_stats.h>
396 #include <afs/nfsclient.h>
404 #if defined(AFS_SGI_ENV)
407 #if defined(AFS_HPUX100_ENV)
408 #define UNIX "/stand/vmunix"
411 #define UNIX "/hp-ux"
414 #define UNIX "/dev/ksyms"
416 #define UNIX "/vmunix"
418 #endif /* AFS_HPUX_ENV */
419 #endif /* AFS_HPUX100_ENV */
420 #endif /* AFS_SGI_ENV */
422 #if defined(AFS_SUN5_ENV)
423 #define CORE "/dev/mem"
425 #define CORE "/dev/kmem"
428 /* Forward declarations */
431 void print_DindexTimes();
432 void print_DdvnextTbl();
433 void print_DdcnextTbl();
434 void print_DindexFlags();
435 void print_buffers();
437 void kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len);
438 void print_exporter();
439 void print_nfsclient();
440 void print_unixuser();
446 void print_venusfid();
453 void print_callout();
455 void print_global_locks();
456 void print_global_afs_resource();
457 void print_global_afs_cache();
458 void print_rxstats();
460 void print_services();
462 void print_peertable_lock();
463 void print_conntable_lock();
464 void print_calltable_lock();
466 void print_peertable();
467 void print_conntable();
468 void print_calltable();
469 void print_eventtable();
470 void print_upDownStats();
471 void print_cmperfstats();
472 void print_cmstats();
479 #if defined(AFS_HPUX_ENV) && defined(__LP64__)
480 #define afs_nlist nlist64
481 #define AFSNLIST(N, C) nlist64((N), (C))
482 #else /* defined(AFS_HPUX_ENV) && defined(__LP64__) */
484 #ifdef AFS_32BIT_KERNEL_ENV
485 #define afs_nlist nlist
486 #define AFSNLIST(N, C) nlist((N), (C))
488 #define afs_nlist nlist64
489 #define AFSNLIST(N, C) nlist64((N), (C))
490 #endif /* AFS_32BIT_KERNEL_ENV */
491 #else /* AFS_SGI61_ENV */
492 #ifdef AFS_LINUX20_ENV
495 unsigned long n_value;
497 #else /* AFS_LINUX20_ENV */
498 #define afs_nlist nlist
499 #endif /* AFS_LINUX20_ENV */
500 #define AFSNLIST(N, C) nlist((N), (C))
501 #endif /* AFS_SGI61_ENV */
502 #endif /* defined(AFS_HPUX_ENV) && defined(__LP64__) */
504 char *obj = UNIX, *core = CORE;
507 int Dcells = 0, Dusers = 0, Dservers = 0, Dconns = 0, Dvols = 0, Ddvols =
509 int Dvstats = 0, Ddstats = 0, Dnfs = 0, Dglobals = 0, Dstats = 0, Dlocks =
511 int Dindextimes = 0, Dindexflags = 0, Dvnodes = 0, Dbuffers = 0, DCallbacks =
512 0, Dallocs = 0, UserLevel = 0;
513 int DdvnextTbl = 0, DdcnextTbl = 0;
514 int Nconns = 0, Drxstats = 0, Drx = 0, Dbkg = 0, Dvlru = 0, Ddlru =
519 #if defined(AFS_SUN5_ENV)
521 #include <sys/types.h>
522 #include <sys/signal.h>
525 #include <sys/elf_M32.h>
526 #include <sys/proc.h>
527 #include <sys/file.h>
528 #define _NLIST_H /* XXXXXXXXXXXXX */
531 #endif /* defined(AFS_SUN5_ENV) */
533 /* Pretty Printers - print real IP addresses and the like if running
539 PrintIPAddr(int addr)
542 struct in_addr in_addr;
546 strcpy(str, "local");
548 in_addr.s_addr = addr;
549 (void)strcpy(str, inet_ntoa(in_addr));
552 (void)sprintf(str, "%x", addr);
557 #ifdef AFS_LINUX20_ENV
558 /* Find symbols in a live kernel. */
560 #ifdef AFS_LINUX26_ENV
561 #define KSYMS "/proc/kallsyms"
563 #define KSYMS "/proc/ksyms"
566 /* symlist_t contains all the kernel symbols. Forcing a 64 byte array is
567 * a bit wasteful, but simple.
569 #define MAXNAMELEN 64
570 typedef struct symlist {
571 char s_name[MAXNAMELEN];
572 #ifdef AFS_LINUX_64BIT_KERNEL
573 unsigned long s_value;
576 #endif /* AFS_LINUX_64BIT_KERNEL */
579 #define KSYM_ALLOC_STEP 128
580 #define KSYM_ALLOC_BASE 1024
581 symlist_t *ksyms = NULL;
588 compare_strings(const void *a, const void *b)
590 symlist_t *syma = (symlist_t *) a;
591 symlist_t *symb = (symlist_t *) b;
592 return strcmp(syma->s_name, symb->s_name);
595 /* Read in all the kernel symbols */
606 fp = fopen(KSYMS, "r");
608 printf("Can't open %s, exiting.\n", KSYMS);
612 availksyms = KSYM_ALLOC_BASE;
613 ksyms = malloc(availksyms * sizeof(symlist_t));
615 printf("Can't malloc %d elements for symbol list.\n", availksyms);
619 /* proc is organized as <addr> <name> <module> */
620 while (fgets(line, MAXLINE, fp)) {
621 if (nksyms >= availksyms) {
622 availksyms += KSYM_ALLOC_STEP;
623 ksyms = realloc(ksyms, availksyms * sizeof(symlist_t));
625 printf("Failed to realloc %d symbols.\n", availksyms);
629 #ifdef AFS_LINUX_64BIT_KERNEL
630 ksyms[nksyms].s_value = (unsigned long)strtoul(line, &p, 16);
632 ksyms[nksyms].s_value = (int)strtoul(line, &p, 16);
633 #endif /* AFS_LINUX_64BIT_KERNEL */
635 #ifdef AFS_LINUX26_ENV
636 /* Linux 2.6 /proc/kallsyms has a one-char symbol type
637 between address and name, so step over it and the following
645 if (strlen(p) >= MAXLINE) {
646 printf("Symbol '%s' too long, ignoring it.\n", p);
649 (void)strcpy(ksyms[nksyms].s_name, p);
653 /* Sort them in lexical order */
654 qsort(ksyms, nksyms, sizeof(symlist_t), compare_strings);
659 /* find_symbol returns 0 if not found, otherwise value for symbol */
660 #ifdef AFS_LINUX_64BIT_KERNEL
664 #endif /* AFS_LINUX_64BIT_KERNEL */
665 find_symbol(char *name)
673 (void)strcpy(entry.s_name, name);
675 (symlist_t *) bsearch(&entry, ksyms, nksyms, sizeof(symlist_t),
678 return tmp ? tmp->s_value : 0;
681 /* nlist fills in values in list until a null name is found. */
683 nlist(void *notused, struct afs_nlist *nlp)
685 for (; nlp->n_name && *nlp->n_name; nlp++)
686 nlp->n_value = find_symbol(nlp->n_name);
693 #if defined(AFS_SUN5_ENV)
697 Elf32_Sym *tbl; /* symbol tbl */
699 char *tblp; /* ptr to symbol tbl */
718 for (sp = tbl; sp < &tbl[scnt]; sp++) {
720 type = ELF64_ST_TYPE(sp->st_info);
722 type = ELF32_ST_TYPE(sp->st_info);
724 if (((type == STB_LOCAL) || (type == STB_GLOBAL)
725 || (type == STB_WEAK))
726 && ((afs_uint32) sp->st_value >= 0x10000)) {
727 name = tblp + sp->st_name;
728 if (!strcmp(name, s))
735 #endif /*defined(AFS_SUN5_ENV) */
737 #endif /*!defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) */
739 #ifndef AFS_KDUMP_LIB
741 cmdproc(struct cmd_syndesc *as, void *arock)
745 #if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
746 if (as->parms[0].items) { /* -kobj */
747 obj = as->parms[0].items->data;
749 if (as->parms[1].items) { /* -kcore */
750 core = as->parms[1].items->data;
752 if (as->parms[2].items) { /* -cells */
753 Dcells = 1, Dall = 0;
755 if (as->parms[3].items) { /* -users */
756 Dusers = 1, Dall = 0;
758 if (as->parms[4].items) { /* -servers */
759 Dservers = 1, Dall = 0;
761 if (as->parms[5].items) { /* -conns */
762 Dconns = 1, Dall = 0;
764 if (as->parms[6].items) { /* -volumes */
767 if (as->parms[7].items) { /* -dvolumes */
768 Ddvols = 1, Dall = 0;
770 if (as->parms[8].items) { /* -vstats */
771 Dvstats = 1, Dall = 0;
773 if (as->parms[9].items) { /* -dstats */
774 Ddstats = 1, Dall = 0;
776 if (as->parms[10].items) { /* -nfstats */
779 if (as->parms[11].items) { /* -globals */
780 Dglobals = 1, Dall = 0;
782 if (as->parms[12].items) { /* -stats */
783 Dstats = 1, Dall = 0;
785 if (as->parms[13].items) { /* -locks */
786 Dlocks = 1, Dall = 0;
788 if (as->parms[14].items) { /* -mem */
791 if (as->parms[15].items) { /* -rxstats */
792 Drxstats = 1, Dall = 0;
794 if (as->parms[16].items) { /* -rx */
797 if (as->parms[17].items) { /* -timestable */
798 Dindextimes = 1, Dall = 0;
800 if (as->parms[18].items) { /* -flagstable */
801 Dindexflags = 1, Dall = 0;
803 if (as->parms[19].items) { /* -cbhash */
804 DCallbacks = 1, Dall = 0;
806 if (as->parms[20].items) { /* -vnodes */
807 Dvnodes = 1, Dall = 0;
809 if (as->parms[21].items) { /* -buffers */
810 Dbuffers = 1, Dall = 0;
812 if (as->parms[22].items) { /* -allocedmem */
813 Dallocs = 1, Dall = 0;
815 if (as->parms[23].items) { /* -user */
818 if (as->parms[24].items) { /* -bkg */
821 if (as->parms[25].items) { /* -vlru */
824 if (as->parms[26].items) { /* -callout */
825 Dcallout = 1, Dall = 0;
827 if (as->parms[27].items) { /* -dnlc */
830 if (as->parms[28].items) { /* -dlru */
834 if (as->parms[29].items) { /* -raw */
838 if (as->parms[30].items) { /* -gcpags */
839 Dgcpags = 1, Dall = 0;
842 if (as->parms[31].items) { /* -dhash */
843 DdvnextTbl = 1, DdcnextTbl = 1, Dall = 0;
851 #include "AFS_component_version_number.c"
854 main(int argc, char **argv)
856 struct cmd_syndesc *ts;
860 struct sigaction nsa;
862 sigemptyset(&nsa.sa_mask);
863 nsa.sa_handler = SIG_DFL;
864 nsa.sa_flags = SA_FULLDUMP;
865 sigaction(SIGSEGV, &nsa, NULL);
868 ts = cmd_CreateSyntax(NULL, cmdproc, NULL, 0,
869 "Read internal cache manager structs");
870 cmd_AddParm(ts, "-kobj", CMD_SINGLE, CMD_OPTIONAL,
871 "kernel object (default /vmunix)");
872 cmd_AddParm(ts, "-kcore", CMD_SINGLE, CMD_OPTIONAL,
873 "kernel core image (default /dev/kmem)");
874 cmd_AddParm(ts, "-cells", CMD_FLAG, CMD_OPTIONAL, "cell state");
875 cmd_AddParm(ts, "-users", CMD_FLAG, CMD_OPTIONAL, "users state");
876 cmd_AddParm(ts, "-servers", CMD_FLAG, CMD_OPTIONAL, "servers state");
877 cmd_AddParm(ts, "-conns", CMD_FLAG, CMD_OPTIONAL, "conns state");
878 cmd_AddParm(ts, "-volumes", CMD_FLAG, CMD_OPTIONAL,
879 "incore volume state");
880 cmd_AddParm(ts, "-dvolumes", CMD_FLAG, CMD_OPTIONAL, "disk volume state");
881 cmd_AddParm(ts, "-vstats", CMD_FLAG, CMD_OPTIONAL, "stat file state");
882 cmd_AddParm(ts, "-dstats", CMD_FLAG, CMD_OPTIONAL, "file data state");
883 cmd_AddParm(ts, "-nfstats", CMD_FLAG, CMD_OPTIONAL,
884 "nfs translator state");
885 cmd_AddParm(ts, "-globals", CMD_FLAG, CMD_OPTIONAL,
886 "general global state");
887 cmd_AddParm(ts, "-stats", CMD_FLAG, CMD_OPTIONAL,
888 "general cm performance state");
889 cmd_AddParm(ts, "-locks", CMD_FLAG, CMD_OPTIONAL,
890 "global cm related locks state");
891 cmd_AddParm(ts, "-mem", CMD_FLAG, CMD_OPTIONAL,
892 "core represents the physical mem (i.e. /dev/mem) and not virtual");
893 cmd_AddParm(ts, "-rxstats", CMD_FLAG, CMD_OPTIONAL,
894 "general rx statistics");
895 cmd_AddParm(ts, "-rx", CMD_FLAG, CMD_OPTIONAL, "all info about rx");
896 cmd_AddParm(ts, "-timestable", CMD_FLAG, CMD_OPTIONAL,
897 "dcache LRU info table");
898 cmd_AddParm(ts, "-flagstable", CMD_FLAG, CMD_OPTIONAL,
899 "dcache flags info table");
900 cmd_AddParm(ts, "-cbhash", CMD_FLAG, CMD_OPTIONAL,
901 "vcache hashed by cbExpires");
902 cmd_AddParm(ts, "-vnodes", CMD_FLAG, CMD_OPTIONAL, "afs vnodes");
903 cmd_AddParm(ts, "-buffers", CMD_FLAG, CMD_OPTIONAL,
904 "afs dir buffer cache");
905 cmd_AddParm(ts, "-allocedmem", CMD_FLAG, CMD_OPTIONAL,
907 cmd_AddParm(ts, "-user", CMD_FLAG, CMD_OPTIONAL,
908 "core is from a user-level program");
909 cmd_AddParm(ts, "-bkg", CMD_FLAG, CMD_OPTIONAL, "background daemon info");
910 cmd_AddParm(ts, "-vlru", CMD_FLAG, CMD_OPTIONAL, "vcache lru list");
911 cmd_AddParm(ts, "-callout", CMD_FLAG, CMD_OPTIONAL,
912 "callout info (aix only)");
913 cmd_AddParm(ts, "-dnlc", CMD_FLAG, CMD_OPTIONAL,
914 "DNLC table,freelist,trace");
915 cmd_AddParm(ts, "-dlru", CMD_FLAG, CMD_OPTIONAL, "dcache lru list");
918 cmd_AddParm(ts, "-raw", CMD_FLAG, CMD_OPTIONAL, "show raw values");
919 cmd_AddParm(ts, "-gcpags", CMD_FLAG, CMD_OPTIONAL,
920 "PAG garbage collection info");
921 cmd_AddParm(ts, "-dhash", CMD_FLAG, CMD_OPTIONAL,
922 "show dcache hash chains");
924 code = cmd_Dispatch(argc, argv);
927 #endif /* !AFS_KDUMP_LIB */
930 #ifndef AFS_KDUMP_LIB
932 Knlist(struct afs_nlist *sp, int cnt, int size)
937 code = nlist(obj, sp);
939 code = knlist(sp, cnt, size);
942 #endif /*AFS_KDUMP_LIB */
945 #if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
947 findsym(char *sname, off_t * offset)
949 #if defined(AFS_SUN5_ENV)
955 ss_ans = symsrch(sname);
957 printf("(WARNING) Couldn't find %s in %s. Proceeding..\n", sname,
962 *offset = ss_ans->st_value;
964 #else /* defined(AFS_SUN5_ENV) */
965 #if defined(AFS_AIX_ENV)
969 if (Knlist(&nl, 1, sizeof nl) == -1) {
970 printf("(WARNING) knlist: couldn't find %s. Proceeding...",
975 *offset = nl.n_value;
978 #endif /* defined(AFS_AIX_ENV) */
980 struct afs_nlist request[2];
982 memset(request, 0, sizeof request);
983 request[0].n_name = sname;
984 if (AFSNLIST(obj, request) < 0) {
985 fprintf(stderr, "nlist(%s, %s) failure: %d (%s)\n", obj, sname,
986 errno, strerror(errno));
989 *offset = request[0].n_value;
990 if (!request[0].n_value) {
991 printf("(WARNING) Couldn't find %s in %s. Proceeding..\n", sname,
997 #endif /* defined(AFS_SUN5_ENV) */
1001 #define CBHTSIZE 128
1006 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
1007 printf("Kdump not supported\n");
1009 int cell, cnt, cnt1;
1010 #ifndef AFS_KDUMP_LIB
1012 kmem = opencore(core);
1014 #endif /* AFS_KDUMP_LIB */
1016 #ifdef KDUMP_RX_LOCK
1017 /* Test to see if kernel is using RX_ENABLE_LOCKS in rx structs. */
1018 #ifdef AFS_SGI53_ENV
1019 #ifdef AFS_SGI64_ENV
1020 use_rx_lock = 1; /* Always using fine gain locking. */
1022 use_rx_lock = (sysmp(MP_NPROCS) > 1) ? 1 : 0;
1024 #endif /* AFS_SGI53_ENV */
1025 #endif /* KDUMP_RX_LOCK */
1027 if (Dcells || Dall) {
1028 print_cells(1); /* Handle the afs_cells structures */
1029 print_cellaliases(1);
1033 if (Dusers || Dall) {
1034 print_users(1); /* Handle the afs_users structs */
1037 if (Dservers || Dall) {
1038 print_servers(1); /* Handle the afs_servers structs */
1042 print_Conns(1); /* Handle the afs_servers structs */
1045 if (Dvols || Dall) {
1046 print_volumes(1); /* Handle the afs_volumes structs */
1049 if (Ddvols || Dall) {
1051 ("\n\nIGNORE reading the 'volumeinfo' file for now (NOT IMPORTANT)!\n");
1054 if (DCallbacks || Dall) {
1055 print_cbHash(1); /* Handle the cbHashT table of queued vcaches */
1058 if (Dvstats || Dall || Dvnodes) {
1059 print_vcaches(1); /* Handle the afs_vcaches structs */
1062 if (Ddstats || Dall) {
1066 if (Dindextimes || Dall) {
1067 print_DindexTimes(1);
1070 if (Dindexflags || Dall) {
1071 print_DindexFlags(1);
1074 if (DdvnextTbl || Dall) {
1075 print_DdvnextTbl(1);
1078 if (DdcnextTbl || Dall) {
1079 print_DdcnextTbl(1);
1082 if (Dbuffers || Dall) {
1090 if (Dstats || Dall) {
1092 struct afs_CMStats afs_cmstats;
1093 struct afs_stats_CMPerf afs_cmperfstats;
1095 printf("\n\nPrinting count references to cm-related functions..\n\n");
1096 findsym("afs_cmstats", &symoff);
1097 kread(kmem, symoff, (char *)&afs_cmstats, sizeof afs_cmstats);
1098 print_cmstats(&afs_cmstats);
1099 printf("\n\nPrinting some cm struct performance stats..\n\n");
1100 findsym("afs_stats_cmperf", &symoff);
1101 kread(kmem, symoff, (char *)&afs_cmperfstats, sizeof afs_cmperfstats);
1102 print_cmperfstats(&afs_cmperfstats);
1105 if (Dlocks || Dall) {
1106 print_global_locks(kmem);
1108 if (Dglobals || Dall) {
1109 printf("\n\nPrinting Misc afs globals...\n");
1110 print_global_afs_resource(kmem);
1111 print_global_afs_cache(kmem);
1116 if (Dvlru || Dall) {
1119 if (Ddlru || Dall) {
1122 if (Drxstats || Dall) {
1123 print_rxstats(kmem);
1128 #ifndef AFS_KDUMP_LIB
1129 if (Dallocs || Dall) {
1133 if (Dcallout || Dall) {
1134 print_callout(kmem);
1136 if (Ddnlc || Dall) {
1139 if (Dgcpags || Dall) {
1146 #if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
1147 int Sum_cellnames = 0, Sum_userstp = 0, Sum_volnames = 0, Sum_exps =
1148 0, Sum_nfssysnames = 0;
1149 int Sum_vcachemvids = 0, Sum_vcachelinkData = 0, Sum_vcacheacc =
1150 0, Sum_vcachelocks = 0;
1151 int Sum_cellaliases = 0, Sum_cellname_names = 0;
1154 print_cells(int pnt)
1157 struct cell *cells, cle, *clentry = &cle, *clep;
1159 struct afs_q CellLRU, lru, *vu = &lru, *tq, *uq;
1163 printf("\n\nPrinting Cells' LRU list...\n");
1164 findsym("CellLRU", &symoff);
1165 kread(kmem, symoff, (char *)&CellLRU, sizeof CellLRU);
1166 lru_addr = (u_long) symoff;
1167 for (tq = CellLRU.next; (u_long) tq != lru_addr; tq = uq) {
1169 kread(kmem, (off_t) tq, (char *)vu, sizeof CellLRU);
1171 kread(kmem, (off_t) clep, (char *)clentry, sizeof *clentry);
1172 print_cell(kmem, clentry, clep, pnt);
1176 printf("... found %d 'afs_cells' entries\n", j);
1182 print_cellaliases(int pnt)
1185 struct cell_alias *ca, cae;
1189 printf("\n\nPrinting cell_alias list...\n");
1190 findsym("afs_cellalias_head", &symoff);
1191 kread(kmem, symoff, (char *)&ca, sizeof ca);
1193 char alias[100], cell[100];
1195 kread(kmem, (off_t) ca, (char *)&cae, sizeof cae);
1196 kread(kmem, (off_t) cae.alias, alias, (KDUMP_SIZE_T) 40);
1198 Sum_cellaliases += strlen(alias) + 1;
1199 kread(kmem, (off_t) cae.cell, cell, (KDUMP_SIZE_T) 40);
1201 Sum_cellaliases += strlen(cell) + 1;
1203 printf("%x: alias=%s cell=%s index=%d\n", ca, alias, cell,
1209 printf("... found %d 'cell_alias' entries\n", j);
1215 print_cellnames(int pnt)
1218 struct cell_name *cn, cne;
1222 printf("\n\nPrinting cell_name list...\n");
1223 findsym("afs_cellname_head", &symoff);
1224 kread(kmem, symoff, (char *)&cn, sizeof cn);
1228 kread(kmem, (off_t) cn, (char *)&cne, sizeof cne);
1229 kread(kmem, (off_t) cne.cellname, cellname, (KDUMP_SIZE_T) 40);
1230 cellname[40] = '\0';
1231 Sum_cellname_names += strlen(cellname) + 1;
1233 printf("%x: cellnum=%d cellname=%s used=%d\n", cn, cne.cellnum,
1234 cellname, cne.used);
1239 printf("... found %d 'cell_name' entries\n", j);
1245 print_users(int pnt)
1248 struct unixuser *afs_users[NUSERS], ue, *uentry = &ue, *uep;
1252 printf("\n\nPrinting 'afs_users' structures...\n");
1253 findsym("afs_users", &symoff);
1254 kread(kmem, symoff, (char *)afs_users, sizeof afs_users);
1255 for (i = 0, j = 0; i < NUSERS; i++) {
1256 for (uep = afs_users[i]; uep; uep = uentry->next, j++) {
1257 kread(kmem, (off_t) uep, (char *)uentry, sizeof *uentry);
1258 print_unixuser(kmem, uentry, uep, pnt);
1262 printf("... found %d 'afs_users' entries\n", j);
1266 struct server **serversFound = NULL;
1267 afs_int32 NserversFound = 0;
1268 #define SF_ALLOCATION_STEP 500
1271 add_found_server(struct server *sep)
1273 static afs_int32 NserversAllocated = 0;
1274 static afs_int32 failed = 0;
1279 if (NserversFound >= NserversAllocated) {
1280 NserversAllocated += SF_ALLOCATION_STEP;
1281 if (!serversFound) {
1282 serversFound = malloc(NserversAllocated *
1283 sizeof(struct server *));
1285 serversFound = realloc(serversFound,
1287 sizeof(struct server *));
1289 if (!serversFound) {
1290 printf("Can't allocate %lu bytes for list of found servers.\n",
1291 NserversAllocated * sizeof(struct server *));
1297 serversFound[NserversFound++] = sep;
1302 find_server(struct server *sep)
1306 for (i = 0; i < NserversFound; i++) {
1307 if (sep == serversFound[i])
1314 print_servers(int pnt)
1317 struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep;
1318 struct srvAddr *afs_srvAddrs[NSERVERS], sa, *sap;
1319 afs_int32 i, nServers, nSrvAddrs, nSrvAddrStructs;
1320 afs_int32 afs_totalServers, afs_totalSrvAddrs;
1322 int chainCount[NSERVERS];
1325 memset(chainCount, 0, sizeof(chainCount));
1326 printf("\n\nPrinting 'afs_servers' structures...\n");
1328 findsym("afs_servers", &symoff);
1329 kread(kmem, symoff, (char *)afs_servers, NSERVERS * sizeof(long));
1330 for (i = 0, nServers = 0; i < NSERVERS; i++) {
1332 printf(" --- Chain %d ---\n", i);
1333 for (sep = afs_servers[i]; sep; sep = sentry->next, nServers++) {
1334 kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
1335 if (pnt && !failed) {
1336 if (add_found_server(sep) < 0)
1341 if (Dconns || Dall || !pnt)
1342 print_server(kmem, sentry, sep, 1, pnt);
1344 print_server(kmem, sentry, sep, 0, pnt);
1349 printf("... found %d 'afs_servers' entries (total conns = %d)\n",
1352 printf("... found %d 'afs_servers' entries\n", nServers);
1353 printf("Chain lengths:\n");
1354 for (i = 0; i < NSERVERS; i++) {
1355 printf("%2d: %5d\n", i, chainCount[i]);
1361 /* Verify against afs_totalServers. */
1363 memset(chainCount, 0, sizeof(chainCount));
1364 if (findsym("afs_totalServers", &symoff)) {
1365 kread(kmem, symoff, (char *)&afs_totalServers, sizeof(afs_int32));
1366 if (afs_totalServers != nServers) {
1368 ("ERROR: afs_totalServers = %d, differs from # of servers in hash table.\n",
1371 printf("afs_totalServers = %d, matches hash chain count.\n",
1376 printf("\n\nPrinting 'afs_srvAddr' structures...\n");
1377 if (findsym("afs_srvAddrs", &symoff)) {
1378 kread(kmem, symoff, (char *)afs_srvAddrs,
1379 NSERVERS * sizeof(long));
1380 nSrvAddrStructs = 0;
1381 for (i = 0, nSrvAddrs = 0; i < NSERVERS; i++) {
1382 printf(" --- Chain %d ---\n", i);
1383 for (sap = afs_srvAddrs[i]; sap; sap = sa.next_bkt) {
1384 kread(kmem, (off_t) sap, (char *)&sa, sizeof(sa));
1386 ("%lx: sa_ip=%s, sa_port=%d, sa_iprank=%d, sa_flags=%x, conns=%lx, server=%lx, nexth=%lx\n",
1387 sap, PrintIPAddr(sa.sa_ip), sa.sa_portal,
1388 sa.sa_iprank, sa.sa_flags, sa.conns, sa.server,
1390 if (sap != (struct srvAddr *)sa.server) {
1391 /* only count ones not in a server struct. */
1397 if (!find_server(sa.server)) {
1398 kread(kmem, (off_t) sa.server, (char *)sentry,
1401 ("ERROR: Server missing from hash chain: server=%lx, server->next=%lx\n",
1402 sa.server, sentry->next);
1403 print_server(kmem, sentry, sa.server, 1, pnt);
1405 ("----------------------------------------------------\n");
1412 ("... found %d 'afs_srvAddr' entries, %d alloc'd (not in server struct)\n",
1413 nSrvAddrs, nSrvAddrStructs);
1414 printf("Chain lengths:\n");
1415 for (i = 0; i < NSERVERS; i++) {
1416 printf("%2d: %5d\n", i, chainCount[i]);
1418 if (findsym("afs_totalSrvAddrs", &symoff)) {
1419 kread(kmem, symoff, (char *)&afs_totalSrvAddrs,
1421 if (afs_totalSrvAddrs != nSrvAddrStructs) {
1423 ("ERROR: afs_totalSrvAddrs = %d, differs from number of alloc'd srvAddrs in hash table.\n",
1427 ("afs_totalSrvAddrs = %d, matches alloc'd srvAddrs in hash chain count.\n",
1438 print_Conns(int pnt)
1441 struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep;
1445 printf("\n\nPrinting all 'afs_conns' to the servers...\n");
1446 findsym("afs_servers", &symoff);
1447 kread(kmem, symoff, (char *)afs_servers, sizeof afs_servers);
1448 for (i = 0, j = 0; i < NSERVERS; i++) {
1449 for (sep = afs_servers[i]; sep; sep = sentry->next, j++) {
1450 kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
1451 print_server(kmem, sentry, sep, 2, pnt);
1455 printf("... found %d 'afs_conns' entries\n", Nconns);
1460 print_volumes(int pnt)
1463 struct volume *afs_volumes[NVOLS], ve, *ventry = &ve, *vep;
1467 printf("\n\nPrinting 'afs_volumes' structures...\n");
1468 findsym("afs_volumes", &symoff);
1469 kread(kmem, symoff, (char *)afs_volumes, NVOLS * sizeof(long));
1470 for (i = 0, j = 0; i < NVOLS; i++) {
1471 for (vep = afs_volumes[i]; vep; vep = ventry->next, j++) {
1472 kread(kmem, (off_t) vep, (char *)ventry, sizeof *ventry);
1473 print_volume(kmem, ventry, vep, pnt);
1477 printf("... found %d 'afs_volumes' entries\n", j);
1482 print_cbHash(int pnt)
1485 struct afs_q cbHashT[CBHTSIZE];
1489 printf("\n\nPrinting 'cbHashT' table...\n");
1490 findsym("cbHashT", &symoff);
1491 kread(kmem, symoff, (char *)cbHashT, sizeof cbHashT);
1492 for (i = 0; i < CBHTSIZE; i++) {
1494 printf("%lx: %x %x\n", (long)symoff + 8 * i, cbHashT[i].prev,
1498 printf("... that should be %d callback hash entries\n", i);
1502 print_vcaches(int pnt)
1505 struct vcache *afs_vhashTable[VCSIZE], Ve, *Ventry = &Ve, *Vep;
1509 printf("\n\nPrinting afs_vcaches structures...\n");
1511 printf("print_vcaches: sizeof(struct vcache) = %ld\n",
1512 (long)sizeof(struct vcache));
1513 findsym("afs_vhashT", &symoff);
1514 kread(kmem, symoff, (char *)afs_vhashTable, sizeof afs_vhashTable);
1515 for (i = 0, j = 0; i < VCSIZE; i++) {
1517 printf("Printing hash chain %d...\n", i);
1518 for (Vep = afs_vhashTable[i]; Vep; Vep = Ventry->hnext, j++) {
1519 kread(kmem, (off_t) Vep, (char *)Ventry, sizeof *Ventry);
1520 if (Dvstats || Dall || !pnt)
1521 print_vcache(kmem, Ventry, Vep, pnt);
1522 if (Dvnodes || Dall)
1523 print_vnode(kmem, Ventry, Vep, pnt);
1527 printf("... found %d 'afs_vcaches' entries\n", j);
1532 print_dcaches(int pnt)
1536 struct dcache dc, *dcp = &dc, *dp;
1537 afs_int32 i, j, count;
1540 /* Handle the afs_dcaches structs */
1542 printf("\n\nPrinting afs_dcache related structures...\n");
1543 findsym("afs_cacheFiles", &symoff);
1544 kread(kmem, symoff, (char *)&count, sizeof count);
1545 findsym("afs_indexTable", &symoff);
1546 kread(kmem, symoff, (char *)&table, sizeof(long));
1547 ptr = malloc(count * sizeof(long));
1548 kread(kmem, table, (char *)ptr, count * sizeof(long));
1549 for (i = 0, j = 0; i < count; i++) {
1550 if (dp = (struct dcache *)ptr[i]) {
1552 printf("afs_indexTable[%d] %x: ", i, dp);
1553 kread(kmem, (off_t) dp, (char *)dcp, sizeof *dcp);
1554 print_dcache(kmem, dcp, dp, pnt);
1559 printf("... found %d 'dcache' entries\n", j);
1560 findsym("afs_DLRU", &symoff);
1561 kread(kmem, symoff, (char *)&dlru, sizeof(struct afs_q));
1563 printf("DLRU next=0x%x, prev=0x%x\n", dlru.next, dlru.prev);
1571 print_DindexTimes(int pnt)
1576 afs_int32 temp, *indexTime = &temp;
1577 afs_int32 i, j, count;
1579 /* Handle the afs_indexTimes array */
1581 printf("\n\nPrinting afs_indexTimes[]...\n");
1582 findsym("afs_cacheFiles", &symoff);
1583 kread(kmem, symoff, (char *)&count, sizeof count);
1584 findsym("afs_indexTimes", &symoff);
1585 kread(kmem, symoff, (char *)&table, sizeof(long));
1586 ptr = malloc(count * sizeof(afs_hyper_t));
1587 kread(kmem, table, (char *)ptr, count * sizeof(afs_hyper_t));
1588 for (i = 0, j = 0; i < count; i++) {
1590 printf("afs_indexTimes[%d]\t%10d.%d\n", i, ptr[i].high,
1592 /* if (dp = (struct dcache *)ptr[i]) {
1593 printf("afs_indexTable[%d] %lx: ", i, dp);
1594 kread(kmem, (off_t) dp, (char *)dcp, sizeof *dcp);
1595 print_dcache(kmem, dcp, dp);
1601 printf("afs_indexTimes has %d entries\n", j);
1607 print_DdvnextTbl(int pnt)
1612 afs_int32 temp, *indexTime = &temp;
1613 afs_int32 i, j, count;
1615 /* Handle the afs_dvnextTbl arrays */
1617 printf("\n\nPrinting afs_dvnextTbl[]...\n");
1618 findsym("afs_cacheFiles", &symoff);
1619 kread(kmem, symoff, (char *)&count, sizeof count);
1620 findsym("afs_dvnextTbl", &symoff);
1621 kread(kmem, symoff, (char *)&table, sizeof(long));
1622 ptr = malloc(count * sizeof(afs_int32));
1623 kread(kmem, table, (char *)ptr, count * sizeof(afs_int32));
1624 for (i = 0, j = 0; i < count; i++) {
1626 printf("afs_dvnextTbl[%d]\t%d\n", i, ptr[i]);
1630 printf("afs_dvnextTbl has %d entries\n", j);
1636 print_DdcnextTbl(int pnt)
1641 afs_int32 temp, *indexTime = &temp;
1642 afs_int32 i, j, count;
1644 /* Handle the afs_dcnextTbl arrays */
1646 printf("\n\nPrinting afs_dcnextTbl[]...\n");
1647 findsym("afs_cacheFiles", &symoff);
1648 kread(kmem, symoff, (char *)&count, sizeof count);
1649 findsym("afs_dcnextTbl", &symoff);
1650 kread(kmem, symoff, (char *)&table, sizeof(long));
1651 ptr = malloc(count * sizeof(afs_int32));
1652 kread(kmem, table, (char *)ptr, count * sizeof(afs_int32));
1653 for (i = 0, j = 0; i < count; i++) {
1655 printf("afs_dcnextTbl[%d]\t%d\n", i, ptr[i]);
1659 printf("afs_dcnextTbl has %d entries\n", j);
1665 print_DindexFlags(int pnt)
1670 unsigned char *flags;
1671 afs_int32 temp, *indexTime = &temp;
1674 /* Handle the afs_indexFlags array */
1676 printf("\n\nPrinting afs_indexFlags[]...\n");
1677 findsym("afs_cacheFiles", &symoff);
1678 kread(kmem, symoff, (char *)&count, sizeof count);
1679 findsym("afs_indexFlags", &symoff);
1680 kread(kmem, symoff, (char *)&table, sizeof(long));
1681 flags = malloc(count * sizeof(char));
1682 kread(kmem, table, flags, count * sizeof(char));
1683 for (i = 0, j = 0; i < count; i++) {
1685 printf("afs_indexFlags[%d]\t%4u\n", i, flags[i]);
1689 printf("afs_indexFlags has %d entries\n", j);
1695 print_buffers(int pnt)
1700 unsigned char *buffers;
1705 printf("\n\nPrinting 'buffers' table...\n");
1706 findsym("Buffers", &symoff);
1707 kread(kmem, symoff, (char *)&table, sizeof(long));
1708 findsym("nbuffers", &symoff);
1709 kread(kmem, symoff, (char *)&count, sizeof(int));
1710 buffers = malloc(count * sizeof(struct buffer));
1711 kread(kmem, table, buffers, count * sizeof(struct buffer));
1712 bp = (struct buffer *)buffers;
1713 for (i = 0, j = 0; i < count; i++, bp++) {
1714 #ifdef AFS_SGI62_ENV
1717 ("Buffer #%d:\tfid=%llu page=%d, accTime=%d,\n\tHash=%x, data=%x, lockers=%x, dirty=%d, hashI=%d\n",
1718 i, bp->fid[0], bp->page, bp->accesstime, bp->hashNext,
1719 bp->data, bp->lockers, bp->dirty, bp->hashIndex);
1723 ("Buffer #%d:\tfid=%lu page=%d, accTime=%d,\n\tHash=%x, data=%x, lockers=%x, dirty=%d, hashI=%d\n",
1724 i, bp->fid, bp->page, bp->accesstime, bp->hashNext,
1725 bp->data, bp->lockers, bp->dirty, bp->hashIndex);
1730 printf("\n\t ... that should be %d buffer entries\n", i);
1738 struct afs_exporter *exp_entry, ex, *exp = &ex, *exp1;
1739 struct nfsclientpag *afs_nfspags[NNFSCLIENTS], e, *entry = &e, *ep;
1742 /* Handle the afs_exporter structures */
1744 printf("\n\nPrinting 'afs_exporters' link list...\n");
1745 findsym("root_exported", &symoff);
1746 kread(kmem, symoff, (char *)&cell, sizeof(long));
1747 for (exp1 = (struct afs_exporter *)cell, j = 0; exp1;
1748 exp1 = exp->exp_next, j++) {
1749 kread(kmem, (off_t) exp1, (char *)exp, sizeof *exp);
1751 printf("AFS_EXPORTER(%x): \n", exp1);
1752 print_exporter(kmem, exp, exp1, pnt);
1756 printf("... found %d 'afs_exporters' entries\n", j);
1758 /* Handle the afs_nfsclientpags structs */
1760 printf("\n\nPrinting 'afs_nfsclientpags' structures...\n");
1761 if (!findsym("afs_nfspags", &symoff))
1763 kread(kmem, symoff, (char *)afs_nfspags, sizeof afs_nfspags);
1764 for (i = 0, j = 0; i < NNFSCLIENTS; i++) {
1765 for (ep = afs_nfspags[i]; ep; ep = entry->next, j++) {
1766 kread(kmem, (off_t) ep, (char *)entry, sizeof *entry);
1767 print_nfsclient(kmem, entry, ep, pnt);
1771 printf("... found %d 'afs_nfsclientpags' entries\n", j);
1775 #if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV)
1776 typedef struct event {
1777 struct event *next; /* next in hash chain */
1778 char *event; /* lwp event: an address */
1779 int refcount; /* Is it in use? */
1780 kcondvar_t cond; /* Currently associated condition variable */
1781 int seq; /* Sequence number: this is incremented
1782 * by wakeup calls; wait will not return until
1788 #ifdef AFS_LINUX22_ENV
1789 /* This is replicated from LINUX/osi_alloc.c */
1790 #define MEM_SPACE sizeof(int)
1794 struct osi_linux_mem {
1795 int mem_next; /* types are or'd into low bits of next */
1798 #define MEMTYPE(A) ((A) & 0x3)
1799 #define MEMADDR(A) ((struct osi_linux_mem*)((A) & (~0x3)))
1800 #define PR_MEMTYPE(A) ((MEMTYPE(A) == KM_TYPE) ? "phys" : "virt")
1802 print_alloced_memlist(void)
1805 struct osi_linux_mem *memp, memlist, next;
1810 findsym("afs_linux_memlist_size", &symoff);
1811 kread(kmem, symoff, (char *)&count, sizeof count);
1812 findsym("afs_linux_memlist", &symoff);
1813 kread(kmem, symoff, (char *)&memp, sizeof memp);
1815 #ifdef AFS_LINUX_64BIT_KERNEL
1816 kread(kmem, (unsigned long)memp, (char *)&next, sizeof next);
1818 kread(kmem, (int)memp, (char *)&next, sizeof next);
1819 #endif /* AFS_LINUX_64BIT_KERNEL */
1821 memset(&next, 0, sizeof next);
1823 printf("Allocated memory list: %d elements\n", count);
1824 printf("%20s %4s %10s\n", "Address", "Type", "Next");
1825 printf("%20lx %4s %10x\n", (long)((char *)memp) + MEM_SPACE,
1826 PR_MEMTYPE(next.mem_next), next.mem_next);
1828 while (next_addr = (off_t) MEMADDR(next.mem_next)) {
1831 kread(kmem, next_addr, (char *)&next, sizeof next);
1832 printf("%20lx %4s %10x\n", (long)next_addr + MEM_SPACE,
1833 PR_MEMTYPE(next.mem_next), next.mem_next);
1835 printf("Found %d elements in allocated memory list, expected %d\n", n,
1841 print_allocs(int pnt)
1844 long count, i, j, k, l, m, n, T = 0, tvs;
1845 struct afs_CMStats afs_cmstats;
1846 struct afs_stats_CMPerf afs_cmperfstats;
1848 findsym("afs_cmstats", &symoff);
1849 kread(kmem, symoff, (char *)&afs_cmstats, sizeof afs_cmstats);
1850 findsym("afs_stats_cmperf", &symoff);
1851 kread(kmem, symoff, (char *)&afs_cmperfstats, sizeof afs_cmperfstats);
1854 printf("\n\n%20s:\t%8d bytes\n", "Sysname area", MAXSYSNAME);
1858 j = (i * sizeof(struct cell)) + Sum_cellnames;
1861 ("%20s:\t%8d bytes\t[%d cells/%d bytes each + %d bytes for cell names]\n",
1862 "Cell package", j, i, sizeof(struct cell), Sum_cellnames);
1864 Sum_cellaliases = 0;
1865 i = print_cellaliases(0);
1866 j = (i * sizeof(struct cell_alias)) + Sum_cellaliases;
1869 ("%20s:\t%8d bytes\t[%d cell_aliases/%d bytes each + %d bytes for cell names]\n",
1870 "Cell package", j, i, sizeof(struct cell_alias), Sum_cellaliases);
1872 Sum_cellname_names = 0;
1873 i = print_cellnames(0);
1874 j = (i * sizeof(struct cell_name)) + Sum_cellname_names;
1877 ("%20s:\t%8d bytes\t[%d cell_names/%d bytes each + %d bytes for cell name strings]\n",
1878 "Cell package", j, i, sizeof(struct cell_name), Sum_cellname_names);
1882 j = (i * sizeof(struct unixuser)) + Sum_userstp;
1885 ("%20s:\t%8d bytes\t[%d users/%d bytes each + %d bytes for secret tokens]\n",
1886 "User package", j, i, sizeof(struct unixuser), Sum_userstp);
1888 i = print_servers(0);
1889 j = (i * sizeof(struct server));
1891 printf("%20s:\t%8d bytes\t[%d servers/%d bytes each]\n", "Server package",
1892 j, i, sizeof(struct server));
1893 j = (Nconns * sizeof(struct afs_conn));
1895 printf("%20s:\t%8d bytes\t[%d conns/%d bytes each]\n",
1896 "Connection package", j, Nconns, sizeof(struct afs_conn));
1898 i = (AFS_NCBRS * sizeof(struct afs_cbr)) * (j =
1903 printf("%20s:\t%8d bytes\t[%d cbs/%d bytes each]\n",
1904 "Server CB free pool", i, (j * AFS_NCBRS),
1905 sizeof(struct afs_cbr));
1908 i = print_volumes(0);
1909 j = (MAXVOLS * sizeof(struct volume)) + Sum_volnames;
1912 ("%20s:\t%8d bytes\t[%d volumes/%d bytes each + %d bytes for volnames - %d active entries]\n",
1913 "Volume package", j, MAXVOLS, sizeof(struct volume), Sum_volnames,
1916 Sum_vcachemvids = Sum_vcachelinkData = Sum_vcacheacc = Sum_vcachelocks =
1918 tvs = i = print_vcaches(0);
1919 j = (i * sizeof(struct vcache));
1921 /* printf("%20s:\t%d bytes\t[%d vcaches/%d bytes each]\n", "Vcache package", j, i, sizeof(struct vcache));*/
1922 #ifdef AFS_AIX32_ENV
1923 i = (tvs + Sum_vcachemvids + Sum_vcachelinkData +
1924 Sum_vcachelocks) * AFS_SMALLOCSIZ;
1926 ("%20s:\t%8d bytes\t[%d act gnodes, %d mount pnts, %d symbolic links, %d unix locks]\n",
1927 "[VC use of sml fp]*", i, tvs, Sum_vcachemvids, Sum_vcachelinkData,
1930 i = (Sum_vcachemvids + Sum_vcachelinkData +
1931 Sum_vcachelocks) * AFS_SMALLOCSIZ;
1933 ("%20s:\t8%d bytes\t[%d mount pnts, %d symbolic links, %d unix locks]\n",
1934 "[VC use of sml fp]*", i, Sum_vcachemvids, Sum_vcachelinkData,
1938 #define NAXSs (1000 / sizeof(struct axscache))
1940 i = (NAXSs * sizeof(struct axscache));
1942 printf("%20s:\t%8d bytes\t[%d access used by vcaches/%d bytes each]\n",
1943 "ACL List free pool", i, Sum_vcacheacc, sizeof(struct axscache));
1946 struct axscache *xp, xpe, *nxp = &xpe;
1948 findsym("afs_xaxscnt", &symoff);
1949 kread(kmem, symoff, (char *)&i, sizeof i);
1950 j = i * (NAXSs * sizeof(struct axscache));
1953 ("%20s:\t%8d bytes\t[%d access used by vcaches/%d bytes each - %d blocks of %d]\n",
1954 "ACL List free pool", j, Sum_vcacheacc, sizeof(struct axscache),
1955 i, (NAXSs * sizeof(struct axscache)));
1960 i = print_dcaches(0);
1961 j = (i * sizeof(struct dcache));
1964 ("%20s:\t%8d bytes\t[%d dcaches/%d bytes each - ONLY USED COUNTED]\n",
1965 "Dcache package", j, i, sizeof(struct dcache));
1967 findsym("afs_dcentries", &symoff);
1968 kread(kmem, symoff, (char *)&i, sizeof i);
1969 j = (i * sizeof(struct dcache));
1971 printf("%20s:\t%8d bytes\t[%d dcaches/%d bytes each]\n", "Dcache package",
1972 j, i, sizeof(struct dcache));
1974 findsym("afs_cacheFiles", &symoff);
1975 kread(kmem, symoff, (char *)&i, sizeof i);
1976 findsym("afs_cacheStats", &symoff);
1977 kread(kmem, symoff, (char *)&j, sizeof j);
1979 k = (j * sizeof(struct vcache));
1981 ("%20s:\t%8d bytes\t[%d free vcaches/%d bytes each - %d active entries]\n",
1982 "Vcache free list", k, j, sizeof(struct vcache), tvs);
1983 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
1984 "Dcache Index Table", i * 4, i, 4);
1986 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
1987 "Dcache Index Times", i * 8, i, 8);
1989 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
1990 "Dcache Index Times", i * 4, i, 4);
1992 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
1993 "Dcache Index Flags", i, i, 1);
1994 /* printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Dcache free list", i, i, 1);*/
1996 T += k + (i * 4) + (i * 8) + i;
1998 T += k + (i * 4) + (i * 4) + i;
2001 i = (j = afs_cmperfstats.bufAlloced) * sizeof(struct buffer);
2003 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Buffer package",
2004 i, j, sizeof(struct buffer));
2005 #define AFS_BUFFER_PAGESIZE 2048
2006 i = j * AFS_BUFFER_PAGESIZE;
2008 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
2009 "Xtra Buffer pkg area", i, j, AFS_BUFFER_PAGESIZE);
2012 Sum_nfssysnames = 0;
2014 k = Sum_exps * sizeof(struct afs_exporter);
2017 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
2018 "Xlator Exporter list", k, Sum_exps,
2019 sizeof(struct afs_exporter));
2021 j = (i * sizeof(struct nfsclientpag)) + Sum_nfssysnames;
2025 ("%20s:\t%8d bytes\t[%d entries/%d bytes each + %d for remote sysnames]\n",
2026 "Xlator Nfs clnt pkg", j, i, sizeof(struct nfsclientpag),
2029 i = (j = afs_cmperfstats.LargeBlocksAlloced) * AFS_LRALLOCSIZ;
2032 ("%20s:\t%8d bytes\t[%d entries/%d bytes each - %d active entries]\n",
2033 "Large Free Pool", i, j, AFS_LRALLOCSIZ,
2034 afs_cmperfstats.LargeBlocksActive);
2036 i = (j = afs_cmperfstats.SmallBlocksAlloced) * AFS_SMALLOCSIZ;
2039 ("%20s:\t%8d bytes\t[%d entries/%d bytes each - %d active entries]\n",
2040 "Small Free Pool", i, j, AFS_SMALLOCSIZ,
2041 afs_cmperfstats.SmallBlocksActive);
2043 #if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV)
2044 findsym("afs_evhashcnt", &symoff);
2045 kread(kmem, symoff, (char *)&j, sizeof j);
2046 i = (j * sizeof(event_t));
2048 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
2049 "afs glock Event Pool", i, j, sizeof(event_t));
2050 /* printf("XXXXXXX Count event queue allocs!!!! XXXXXX\n");*/
2054 if (findsym("rxevent_nFree", &symoff))
2055 kread(kmem, symoff, (char *)&j, sizeof j);
2056 if (findsym("rxevent_nPosted", &symoff))
2057 kread(kmem, symoff, (char *)&i, sizeof i);
2058 k = (i + j) * sizeof(struct rxevent);
2061 printf("%20s:\t%8d bytes\t[%d free, %d posted/%d bytes each]\n",
2062 "Rx event pkg", k, j, i, sizeof(struct rxevent));
2064 T += (k = 20 * sizeof(struct rxevent));
2066 ("%20s:\t%8d bytes\t[%d entries/%d bytes each - THIS IS MIN ALLOC/NOT ACTUAL]\n",
2067 "Rx event pkg", k, 20, sizeof(struct rxevent));
2070 findsym("rx_nFreePackets", &symoff);
2071 kread(kmem, symoff, (char *)&count, sizeof count);
2073 findsym("rx_initSendWindow", &symoff);
2074 kread(kmem, symoff, (char *) &i, sizeof i);
2077 findsym("rx_nPackets", &symoff);
2078 kread(kmem, symoff, (char *)&j, sizeof j);
2079 k = (j + i + 2) * sizeof(struct rx_packet);
2081 printf("%20s:\t%8d bytes\t[%d free packets/%d bytes each]\n",
2082 "Rx packet freelist", k, count, sizeof(struct rx_packet));
2083 #define rx_hashTableSize 256 /* XXX */
2084 i = (rx_hashTableSize * sizeof(struct rx_connection *));
2085 j = (rx_hashTableSize * sizeof(struct rx_peer *));
2088 printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
2089 "Rx conn/peer tables", k, rx_hashTableSize,
2090 sizeof(struct rx_connection *));
2092 findsym("rxi_Alloccnt", &symoff);
2093 kread(kmem, symoff, (char *)&j, sizeof j);
2094 findsym("rxi_Allocsize", &symoff);
2095 kread(kmem, symoff, (char *)&i, sizeof i);
2097 printf("%20s:\t%8d bytes\t[%d outstanding allocs]\n", "RX misc allocs", i,
2101 j = afs_cmperfstats.OutStandingMemUsage;
2102 printf("\n\n%20s:\t%8d bytes\n", "Mem used by afs", j);
2103 printf("%20s:\t%8d bytes\n", "Accounted-for mem", T);
2104 printf("%20s:\t%8d bytes\n", "Non acc'd-for mem", j - T);
2107 ("\n\nNOTE:\n\tAll [...]* entries above aren't counted towards the total mem since they're redundant\n");
2109 #ifdef AFS_LINUX22_ENV
2111 print_alloced_memlist();
2115 #if defined(sparc) && !defined(__linux__)
2117 readmem(kmem, buf, vad, len)
2123 #endif /** AFS_SUN5_ENV **/
2127 if ((newlen = kvm_kread(kd, vad, buf, len)) != len) {
2128 printf("Couldn't process dumpfile with supplied namelist %s\n", obj);
2134 #ifndef AFS_KDUMP_LIB
2136 kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len)
2140 memset(buf, 0, len);
2142 #if defined(sparc) && !defined(__linux__)
2143 #ifndef AFS_SUN5_ENV
2146 readmem(kmem, buf, (off_t) loc, len);
2148 #ifndef AFS_SUN5_ENV
2152 #if ! defined(AFS_SUN5_ENV)
2153 #if defined(AFS_SGI61_ENV) && !defined(AFS_32BIT_KERNEL_ENV)
2154 if (lseek64(kmem, loc, L_SET /*0 */ ) != loc)
2156 if (lseek(kmem, loc, L_SET /*0 */ ) != loc)
2163 printf("WARNING: Read failed: loc=0\n");
2165 if ((i = read(kmem, buf, len)) != len) {
2166 printf("WARNING: Read failed: ");
2167 if (sizeof(loc) > sizeof(long)) {
2168 printf("loc=%llx", loc);
2170 printf("loc=%lx", (long)loc);
2172 printf(", buf=%lx, len=%ld, i=%d, errno=%d\n", (long)buf,
2173 (long)len, i, errno);
2174 return; /*exit(1); */
2178 #endif /* AFS_KDUMP_LIB */
2183 * When examining the dump of a 64 bit kernel, we use this function to
2184 * read symbols. The function opencore() calls this or rdsymbols() using
2185 * the macro RDSYMBOLS
2197 Elf64_Sym *stbl, *p1, *p2;
2198 Elf64_Shdr *(*elf_getshdr) (Elf_Scn *) = elf64_getshdr;
2201 Elf32_Sym *stbl, *p1, *p2;
2202 Elf32_Shdr *(*elf_getshdr) (Elf_Scn *) = elf32_getshdr;
2204 Elf_Data *dp = NULL, *sdp = NULL;
2208 if (!(fp = fopen(obj, "r"))) {
2209 printf("Can't open %s (%d)\n", core, errno);
2215 if ((efd = elf_begin(fd, ELF_C_READ, 0)) == NULL) {
2216 printf("Can't elf begin (%d)\n", errno);
2219 while (cn = elf_nextscn(efd, cn)) {
2220 if ((shdr = elf_getshdr(cn)) == NULL) {
2222 printf("Can't read section header (%d)\n", errno);
2225 if (shdr->sh_type == SHT_SYMTAB)
2228 dp = elf_getdata(cn, dp);
2229 p1 = stbl = (void *)dp->d_buf;
2230 nsyms = dp->d_size / sizeof(*stbl);
2231 cn = elf_getscn(efd, shdr->sh_link);
2232 sdp = elf_getdata(cn, sdp);
2233 tblp = malloc(sdp->d_size);
2234 memcpy(tblp, sdp->d_buf, sdp->d_size);
2235 p2 = tbl = malloc(nsyms * sizeof(*stbl));
2236 for (i = 0, scnt = 0; i < nsyms; i++, p1++, p2++) {
2237 p2->st_name = p1->st_name;
2238 p2->st_value = p1->st_value;
2239 p2->st_size = p1->st_size;
2240 p2->st_info = p1->st_info;
2241 p2->st_shndx = p1->st_shndx;
2248 #endif /** AFS_SUN5_ENV **/
2252 opencore(char *core)
2254 #ifdef AFS_KDUMP_LIB
2256 #else /* AFS_KDUMP_LIB */
2259 #if defined(sparc) && !defined(__linux__)
2260 #ifndef AFS_SUN5_ENV
2264 if ((kd = kvm_open(obj, core, NULL, O_RDONLY, "crash")) == NULL) {
2265 printf("Can't open kvm - core file %s\n", core);
2268 #ifndef AFS_SUN5_ENV
2277 if ((fd = open(core, O_RDONLY)) < 0) {
2283 #endif /* AFS_KDUMP_LIB */
2288 print_exporter(int kmem, struct afs_exporter *exporter,
2289 struct afs_exporter *ptr, int pnt)
2292 printf("\tstates=%x, type=%x, *data=%lx\n", exporter->exp_states,
2293 exporter->exp_type, exporter->exp_data);
2295 ("\texp_stats (calls=%d, rejectedcalls=%d, nopag=%d, invalidpag=%d)\n",
2296 exporter->exp_stats.calls, exporter->exp_stats.rejectedcalls,
2297 exporter->exp_stats.nopag, exporter->exp_stats.invalidpag);
2303 print_nfsclient(int kmem, struct nfsclientpag *ep,
2304 struct nfsclientpag *ptr, int pnt)
2310 printf("%lx: uid=%d, host=%x, pag=%x, lastt=%d, ref=%d count=%d\n",
2311 ptr, ep->uid, ep->host, ep->pag,
2312 ep->lastcall, ep->refCount, ep->sysnamecount);
2314 for(count = 0; count < ep->sysnamecount; count++){
2315 kread(kmem, (off_t) ep->sysname[count], sysname, (KDUMP_SIZE_T) 30);
2316 printf(" %lx: @sys[%d]=%s\n",
2317 ep->sysname[count], count, sysname);
2318 Sum_nfssysnames += MAXSYSNAME;
2323 #if defined(AFS_SUN5_ENV)
2325 pmutex(char *sp, kmutex_t *mp)
2332 print_unixuser(int kmem, struct unixuser *uep,
2333 struct unixuser *ptr, int pnt)
2335 Sum_userstp += uep->stLen;
2338 ("%lx: uid=x%x, cell=%x, vid=%d, refc=%d, states=%x, tokTime=%d, tikLen=%d\n",
2339 ptr, uep->uid, uep->cell, uep->vid, uep->refCount, uep->states,
2340 uep->tokenTime, uep->stLen);
2342 ("\tstp=%lx, clearTok[Han=x%x, x<%x,%x,%x,%x,%x,%x,%x,%x>, vid=%d, Bt=%d, Et=%d], exporter=%lx\n",
2343 uep->stp, uep->ct.AuthHandle, uep->ct.HandShakeKey[0],
2344 uep->ct.HandShakeKey[1], uep->ct.HandShakeKey[2],
2345 uep->ct.HandShakeKey[3], uep->ct.HandShakeKey[4],
2346 uep->ct.HandShakeKey[5], uep->ct.HandShakeKey[6],
2347 uep->ct.HandShakeKey[7], uep->ct.ViceId, uep->ct.BeginTimestamp,
2348 uep->ct.EndTimestamp, uep->exporter);
2353 print_cell(int kmem, struct cell *clep, struct cell *ptr, int pnt)
2360 kread(kmem, (off_t) clep->cellName, cellName, (KDUMP_SIZE_T) 40);
2362 Sum_cellnames += strlen(cellName) + 1;
2365 ("%lx: cellname=%s, states=%x, cnum=%d, cindex=%d fsport=%d vlport=%d timeout=%d cnamep=%x\n",
2366 ptr, cellName, clep->states, clep->cellNum, clep->cellIndex,
2367 clep->fsport, clep->vlport, clep->timeout, clep->cnamep);
2370 printf("\tlinked cellp %lx\n", clep->lcellp);
2372 printf("\tCell's servers: ");
2373 for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
2374 if (pretty && (clep->cellHosts[i] == 0))
2376 printf("[%lx] ", clep->cellHosts[i]);
2384 print_server(int kmem, struct server *sep, struct server *ptr, int conns,
2387 struct srvAddr sa, *sap = &sa, *sap1;
2390 if (conns != 2 && pnt) {
2392 ("%lx: cell=%lx, addr=%lx, flags=0x%x, actTime=%x, lastDownS=%x, numDownIn=%d, sumofDownt=%d\n",
2393 ptr, sep->cell, sep->addr, sep->flags, sep->activationTime,
2394 sep->lastDowntimeStart, sep->numDowntimeIncidents,
2395 sep->sumOfDowntimes);
2396 if (sep->flags & SRVR_MULTIHOMED) {
2399 ("\tuuid=[%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x] addr_uniquifier=%x\n",
2400 sep->sr_uuid.time_low, sep->sr_uuid.time_mid,
2401 sep->sr_uuid.time_hi_and_version,
2402 sep->sr_uuid.clock_seq_hi_and_reserved,
2403 sep->sr_uuid.clock_seq_low, sep->sr_uuid.node[0],
2404 sep->sr_uuid.node[1], sep->sr_uuid.node[2],
2405 sep->sr_uuid.node[3], sep->sr_uuid.node[4],
2406 sep->sr_uuid.node[5], sep->sr_addr_uniquifier);
2410 for (j = 0, cnt = 1, sap1 = sep->addr; sap1;
2411 sap1 = sap->next_sa, j++, cnt++) {
2412 kread(kmem, (off_t) sap1, (char *)sap, sizeof(*sap));
2416 ("\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",
2417 cnt, sap1, PrintIPAddr(sap->sa_ip), sap->sa_portal,
2418 sap->sa_iprank, sap->sa_flags, sap->conns,
2419 sap->server, sap->next_bkt);
2422 ("\t[sa_ip=%s, sa_port=%d, sa_iprank=%d, sa_flags=%x, conns=%lx, server=%lx, nexth=%lx]\n",
2423 PrintIPAddr(sap->sa_ip), sap->sa_portal,
2424 sap->sa_iprank, sap->sa_flags, sap->conns,
2425 sap->server, sap->next_bkt);
2430 if (sep->cbrs && pnt) {
2431 struct afs_cbr cba, *cbsap = &cba, *cbsap1;
2433 printf(" Callbacks to be returned:\n");
2434 for (j = 0, cbsap1 = sep->cbrs; cbsap1; cbsap1 = cbsap->next, j++) {
2435 kread(kmem, (off_t) cbsap1, (char *)cbsap, sizeof(*cbsap));
2436 printf(" #%2d) %lx [v=%d, n=%d, u=%d]\n", j, cbsap1,
2437 cbsap->fid.Volume, cbsap->fid.Vnode, cbsap->fid.Unique);
2441 for (j = 0, sap1 = sep->addr; sap1; sap1 = sap->next_sa, j++) {
2442 kread(kmem, (off_t) sap1, (char *)sap, sizeof(*sap));
2443 print_conns(kmem, sap1, sap->conns, conns, pnt);
2451 print_conns(int kmem, struct srvAddr *srv, struct afs_conn *conns, int Con,
2454 struct afs_conn *cep, ce, *centry = &ce;
2457 cep = (struct afs_conn *)conns;
2458 if (pnt && Con != 2) {
2460 printf("\tRPC connections for server %lx:\n", srv);
2462 printf("\tNO RPC connections for server %x\n", srv);
2464 for (; cep; cep = centry->next, Nconns++, i++) {
2465 if (pnt && Con != 2)
2466 printf("\t #%d> ", i);
2467 kread(kmem, (off_t) cep, (char *)centry, sizeof *centry);
2468 print_conn(kmem, centry, cep, pnt);
2474 print_conn(int kmem, struct afs_conn *conns, struct afs_conn *ptr, int pnt)
2478 printf("%lx: user=%lx, rx=%lx, srvr=%lx, ref=%d, port=%d, forceC=%d\n",
2479 ptr, conns->user, conns->id, conns->srvr, conns->refCount,
2480 conns->port, conns->forceConnectFS);
2486 print_volume(int kmem, struct volume *vep, struct volume *ptr, int pnt)
2494 loc = (afs_int32 *) & vep->lock;
2496 kread(kmem, (off_t) vep->name, Volname, (KDUMP_SIZE_T) 40);
2497 Sum_volnames += strlen(Volname) + 1;
2501 printf("%lx: cell=%x, vol=%d, name=%s, roVol=%d, backVol=%d\n", ptr,
2502 vep->cell, vep->volume, (vep->name ? Volname : "nil"), vep->roVol,
2506 ("\trwVol=%d, setupTime=%d, copyDate=%d, expTime=%d, vtix=%d, refC=%d, states=%x\n",
2507 vep->rwVol, vep->setupTime, vep->copyDate, vep->expireTime,
2508 vep->vtix, vep->refCount, vep->states);
2511 ("\trwVol=%d, setupTime=%d, copyDate=%d, vtix=%d, refC=%d, states=%x\n",
2512 vep->rwVol, vep->setupTime, vep->copyDate, vep->vtix, vep->refCount,
2515 printf("\tVolume's statuses: ");
2516 for (i = 0; i < AFS_MAXHOSTS && vep->serverHost[i]; i++)
2517 printf("[%d] ", vep->status[i]);
2520 printf("\tVolume's servers: ");
2521 for (i = 0; i < AFS_MAXHOSTS && vep->serverHost[i]; i++)
2522 printf("[%lx] ", vep->serverHost[i]);
2525 print_venusfid("\tdotdot", &vep->dotdot);
2528 print_venusfid("\tmtpnt", &vep->mtpoint);
2533 printf("\trootVnode = %d, rootUnique = %d\n", vep->rootVnode,
2536 printf("\tlock=0x%x\n", *loc);
2541 print_venusfid(char *string, struct VenusFid *vid)
2543 printf("%s(c=%x, v=%d, n=%d, u=%d)", string, vid->Cell, vid->Fid.Volume,
2544 vid->Fid.Vnode, vid->Fid.Unique);
2549 print_vnode(int kmem, struct vnode *vep, struct vnode *ptr, int pnt)
2553 struct gnode *save_gnode;
2554 #endif /* AFS_AIX_ENV */
2560 save_gnode = vep->v_gnode;
2561 kread(kmem, (off_t) save_gnode, (char *)&gnode, sizeof(struct gnode));
2562 vep->v_gnode = &gnode;
2563 #endif /* AFS_AIX_ENV */
2566 printf("%x: v_type=%d, v_flag=%d, v_count=%d, \n", ptr, vep->v_type,
2567 vep->v_flag, vep->v_count);
2569 ("\tv_v_stream=%x, v_pages=0x%x, v_mountdhere=%d, v_rdev=%d, v_vfsp=0x%x, v_filocks=0x%x\n",
2570 vep->v_stream, vep->v_pages, vep->v_vfsmountedhere, vep->v_rdev,
2571 vep->v_vfsp, vep->v_filocks);
2572 pmutex("\tVnode", &vep->v_lock);
2573 printf("\tCond v: 0x%x\n", vep->v_cv);
2576 vep->v_gnode = save_gnode;
2577 #endif /* AFS_AIX_ENV */
2578 #ifdef AFS_SGI65_ENV
2579 #if defined(AFS_32BIT_KERNEL_ENV)
2580 printf("%lx: v_mreg=0x%lx", ptr, vep->v_mreg);
2582 printf("%llx: v_mreg=0x%llx", ptr, vep->v_mreg);
2584 printf(", v_mregb=0x%lx\n", vep->v_mregb);
2586 #ifdef AFS_LINUX22_ENV
2587 /* Print out the stat cache and other inode info. */
2589 ("\ti_ino=%d, i_mode=%x, i_nlink=%d, i_uid=%d, i_gid=%d, i_size=%d\n",
2590 vep->i_ino, vep->i_mode, vep->i_nlink, vep->i_uid, vep->i_gid,
2592 #ifdef AFS_LINUX24_ENV
2594 ("\ti_atime=%u, i_mtime=%u, i_ctime=%u, i_version=%u, i_nrpages=%u\n",
2595 vep->i_atime, vep->i_mtime, vep->i_ctime, vep->i_version,
2596 vep->i_data.nrpages);
2599 ("\ti_atime=%u, i_mtime=%u, i_ctime=%u, i_version=%u, i_nrpages=%u\n",
2600 vep->i_atime, vep->i_mtime, vep->i_ctime, vep->i_version,
2603 #ifdef AFS_LINUX26_ENV
2604 printf("\ti_op=0x%x, i_rdev=0x%x, i_sb=0x%x\n", vep->i_op,
2605 vep->i_rdev, vep->i_sb);
2606 #else /* AFS_LINUX26_ENV */
2607 printf("\ti_op=0x%x, i_dev=0x%x, i_rdev=0x%x, i_sb=0x%x\n", vep->i_op,
2608 vep->i_dev, vep->i_rdev, vep->i_sb);
2609 #endif /* AFS_LINUX26_ENV */
2610 #ifdef AFS_LINUX24_ENV
2611 #ifdef AFS_PARISC_LINUX24_ENV
2612 printf("\ti_sem: count=%d, wait=0x%x\n", vep->i_sem.count,
2615 printf("\ti_sem: count=%d, sleepers=%d, wait=0x%x\n", vep->i_sem.count,
2616 vep->i_sem.sleepers, vep->i_sem.wait);
2619 printf("\ti_sem: count=%d, waking=%d, wait=0x%x\n", vep->i_sem.count,
2620 vep->i_sem.waking, vep->i_sem.wait);
2622 #ifdef AFS_LINUX26_ENV
2623 printf("\ti_hash=0x%x:0x%x, i_list=0x%x:0x%x, i_dentry=0x%x:0x%x\n",
2624 vep->i_hash.pprev, vep->i_hash.next, vep->i_list.prev,
2625 vep->i_list.next, vep->i_dentry.prev, vep->i_dentry.next);
2626 #else /* AFS_LINUX26_ENV */
2627 printf("\ti_hash=0x%x:0x%x, i_list=0x%x:0x%x, i_dentry=0x%x:0x%x\n",
2628 vep->i_hash.prev, vep->i_hash.next, vep->i_list.prev,
2629 vep->i_list.next, vep->i_dentry.prev, vep->i_dentry.next);
2630 #endif /* AFS_LINUX26_ENV */
2631 #endif /* AFS_LINUX22_ENV */
2635 print_vcache(int kmem, struct vcache *vep, struct vcache *ptr, int pnt)
2639 struct VenusFid vid;
2640 struct axscache acc, *accp = &acc, *acp;
2641 struct SimpleLocks sl, *slcp = &sl, *slp;
2645 kread(kmem, (off_t) vep->mvid, (char *)&vid, sizeof(struct VenusFid));
2649 Sum_vcachelinkData++;
2650 loc = (long *)&vep->lock;
2656 printf("%lx: refC=%d, pv=%d, pu=%d, flushDv=%d.%d, mapDV=%d.%d, ",
2657 ptr, VREFCOUNT(vep), vep->parentVnode, vep->parentUnique,
2658 vep->flushDV.high, vep->flushDV.low, vep->mapDV.high,
2660 #ifdef AFS_64BIT_CLIENT
2662 ("truncPos=(0x%x, 0x%x),\n\tcallb=x%lx, cbE=%d, opens=%d, XoW=%d, ",
2663 (int)(vep->truncPos >> 32), (int)(vep->truncPos & 0xffffffff),
2664 vep->callback, vep->cbExpires, vep->opens, vep->execsOrWriters);
2665 #else /* AFS_64BIT_CLIENT */
2666 printf("truncPos=%d,\n\tcallb=x%lx, cbE=%d, opens=%d, XoW=%d, ",
2667 vep->truncPos, vep->callback, vep->cbExpires, vep->opens,
2668 vep->execsOrWriters);
2669 #endif /* AFS_64BIT_CLIENT */
2670 printf("flcnt=%d, mvstat=%d\n", vep->flockCount, vep->mvstat);
2671 printf("\tstates=x%x, ", vep->states);
2673 printf("vstates=x%x, ", vep->vstates);
2674 #endif /* AFS_SUN5_ENV */
2675 printf("dchint=%x, anyA=0x%x\n", vep->dchint, vep->anyAccess);
2676 #ifdef AFS_64BIT_CLIENT
2678 ("\tmstat[len=(0x%x, 0x%x), DV=%d.%d, Date=%d, Owner=%d, Group=%d, Mode=0%o, linkc=%d]\n",
2679 (int)(vep->m.Length >> 32), (int)(vep->m.Length & 0xffffffff),
2680 vep->m.DataVersion.high, vep->m.DataVersion.low, vep->m.Date,
2681 vep->m.Owner, vep->m.Group, vep->m.Mode, vep->m.LinkCount);
2682 #else /* AFS_64BIT_CLIENT */
2683 printf("\tquick[dc=%x, stamp=%x, f=%x, min=%d, len=%d]\n",
2684 vep->quick.dc, vep->quick.stamp, vep->quick.f,
2685 vep->quick.minLoc, vep->quick.len);
2687 ("\tmstat[len=%d, DV=%d.%d, Date=%d, Owner=%d, Group=%d, Mode=0%o, linkc=%d]\n",
2688 vep->m.Length, vep->m.DataVersion.high, vep->m.DataVersion.low,
2689 vep->m.Date, vep->m.Owner, vep->m.Group, vep->m.Mode,
2691 #endif /* AFS_64BIT_CLIENT */
2694 ("%x: refC=%d, pv=%d, pu=%d, flushDv=%d, mapDV=%d, truncPos=%d\n",
2695 ptr, vep->vrefCount, vep->parentVnode, vep->parentUnique,
2696 vep->flushDV, vep->mapDV, vep->truncPos);
2697 printf("\tcallb=x%x, cbE=%d, opens=%d, XoW=%d, flcnt=%d, mvstat=%d\n",
2698 vep->callback, vep->cbExpires, vep->opens, vep->execsOrWriters,
2699 vep->flockCount, vep->mvstat);
2700 printf("\tstates=x%x, dchint=%x, anyA=0x%x\n", vep->states,
2701 vep->h1.dchint, vep->anyAccess);
2703 ("\tmstat[len=%d, DV=%d, Date=%d, Owner=%d, Group=%d, Mode=%d, linkc=%d]\n",
2704 vep->m.Length, vep->m.DataVersion, vep->m.Date, vep->m.Owner,
2705 vep->m.Group, vep->m.Mode, vep->m.LinkCount);
2707 #ifdef AFS_AIX32_ENV
2708 loc = (afs_int32 *) & vep->pvmlock;
2709 printf("\tpvmlock=x%x, segid=%X, credp=%lx\n", *loc, vep->segid,
2713 ("\tlock [wait=%x excl=%x readers=%x #waiting=%x last_reader=%d writer=%d src=%d]\n",
2714 vep->lock.wait_states, vep->lock.excl_locked,
2715 vep->lock.readers_reading, vep->lock.num_waiting,
2716 vep->lock.pid_last_reader, vep->lock.pid_writer,
2717 vep->lock.src_indicator);
2718 print_venusfid("\tfid", &vep->fid);
2721 print_venusfid("mvid", &vid);
2727 printf("\tAccess Link list: %x\n", vep->Access);
2728 for (j = 0, acp = vep->Access; acp; acp = accp->next, j++) {
2729 kread(kmem, (off_t) acp, (char *)accp, sizeof(*accp));
2732 printf("\t %lx: %d) uid=0x%x, access=0x%x, next=%lx\n", acp,
2733 j, accp->uid, accp->axess, accp->next);
2738 printf("\tLocking Link list: %lx\n", vep->slocks);
2742 printf("\tCallbacks queue prev= %lx next= %lx\n", vep->callsort.prev,
2743 vep->callsort.next);
2745 printf("\tvlruq.prev=%lx, vlruq.next=%lx\n", vep->vlruq.prev,
2748 /* For defect 7733 - Print linkData field for symlinks */
2750 if (vep->linkData) {
2751 cloc = (char *)vep->linkData;
2752 printf("\tSymlink information = '");
2754 kread(kmem, (off_t) cloc, &linkchar, (KDUMP_SIZE_T) 1);
2756 if (linkchar == '\0') {
2760 printf("%c", linkchar);
2765 #ifdef AFS_LINUX22_ENV
2766 printf("\tmapcnt=%d\n", vep->mapcnt);
2772 print_dcache(int kmem, struct dcache *dcp, struct dcache *dp, int pnt)
2776 printf("%lx: ", dp);
2777 print_venusfid(" fid", &dcp->f.fid);
2778 printf("refcnt=%d, dflags=%x, mflags=%x, validPos=%d\n", dcp->refCount,
2779 dcp->dflags, dcp->mflags, dcp->validPos);
2782 printf("\tf.modtime=%d, f.versNo=%d.%d\n", dcp->f.modTime,
2783 dcp->f.versionNo.high, dcp->f.versionNo.low);
2785 printf("\tf.hvn=%d, f.hcn=%d, f.modtime=%d, f.versNo=%d\n",
2786 dcp->f.hvNextp, dcp->f.hcNextp, dcp->f.modTime, dcp->f.versionNo);
2788 #ifdef AFS_SGI62_ENV
2790 ("\tf.chunk=%d, f.inode=%" AFS_INT64_FMT ", f.chunkBytes=%d, f.states=%x",
2791 dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states);
2794 ("\tf.chunk=%d, f.inode=%d, f.chunkBytes=%d, f.states=%x\n",
2795 dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states);
2797 printf("\tlruq.prev=%lx, lruq.next=%lx, index=%d\n",
2798 dcp->lruq.prev, dcp->lruq.next, dcp->index);
2805 struct brequest afs_brs[NBRS], ue, *uentry = &ue, *uep;
2806 afs_int32 count, i, j;
2809 printf("\n\nPrinting some background daemon info...\n\n");
2810 findsym("afs_brsWaiters", &symoff);
2811 kread(kmem, symoff, (char *)&scount, sizeof scount);
2812 printf("Number of processes waiting for bkg daemon %d\n", scount);
2813 findsym("afs_brsDaemons", &symoff);
2814 kread(kmem, symoff, (char *)&scount, sizeof scount);
2815 printf("Number of free bkg daemons %d\n", scount);
2816 findsym("afs_brs", &symoff);
2817 kread(kmem, symoff, (char *)afs_brs, sizeof afs_brs);
2818 printf("Print the current bkg process table\n");
2819 for (i = 0, j = 0; i < NBRS; i++, j++) {
2820 /* kread(kmem, (off_t) afs_brs[i], (char *)uentry, sizeof *uentry);*/
2821 uentry = &afs_brs[i];
2822 if (uentry->refCount == 0)
2825 ("[%d] vcache=0x%lx, cred=0x%lx, code=%d, refCount=%d, opcode=%d, flags=%x [%lx, %lx, %lx, %lx]\n",
2826 i, uentry->vc, uentry->cred, uentry->code, uentry->refCount,
2827 uentry->opcode, uentry->flags, uentry->size_parm[0],
2828 uentry->size_parm[1], uentry->ptr_parm[0], uentry->ptr_parm[1]);
2831 printf("... found %d active 'afs_brs' entries\n", j);
2835 print_vlru(int kmem)
2838 struct vcache Ve, *Ventry = &Ve, *Vep, *tvc;
2839 struct afs_q VLRU, vlru, *vu = &vlru, *tq, *uq;
2840 u_long vlru_addr, l1, l2, l3;
2841 afs_int32 count, i, j = 0, maxvcount, vcount, nvnode;
2844 printf("\n\nPrinting vcache VLRU info (oldest first)...\n\n");
2845 findsym("afs_cacheStats", &symoff);
2846 kread(kmem, symoff, (char *)&maxvcount, sizeof maxvcount);
2847 findsym("VLRU", &symoff);
2848 kread(kmem, symoff, (char *)&VLRU, sizeof VLRU);
2849 vlru_addr = (u_long) symoff;
2850 for (tq = VLRU.prev; (u_long) tq != vlru_addr; tq = uq) {
2852 kread(kmem, (off_t) tq, (char *)vu, sizeof VLRU);
2854 kread(kmem, (off_t) tvc, (char *)Ventry, sizeof *Ventry);
2855 print_vcache(kmem, Ventry, tvc, 1);
2858 printf("... found %d active vcache entries in the VLRU\n", j);
2862 print_dlru(int kmem)
2865 struct dcache Ve, *Ventry = &Ve, *Vep, *tdc;
2866 struct afs_q DLRU, dlru, *vu = &dlru, *tq, *uq;
2867 u_long dlru_addr, l1, l2, l3;
2868 afs_int32 count, i, j = 0, maxvcount, vcount, nvnode;
2871 printf("\n\nPrinting vcache DLRU info...\n\n");
2872 findsym("afs_DLRU", &symoff);
2873 kread(kmem, symoff, (char *)&DLRU, sizeof DLRU);
2874 dlru_addr = (u_long) symoff;
2875 for (tq = DLRU.prev; (u_long) tq != dlru_addr; tq = uq) {
2876 tdc = (struct dcache *)tq;
2877 kread(kmem, (off_t) tq, (char *)vu, sizeof DLRU);
2879 kread(kmem, (off_t) tdc, (char *)Ventry, sizeof *Ventry);
2880 print_dcache(kmem, Ventry, tdc, 1);
2883 printf("... found %d active dcache entries in the DLRU\n\n\n", j);
2885 findsym("afs_freeDSList", &symoff);
2886 kread(kmem, symoff, (char *)&dlru_addr, sizeof dlru_addr);
2887 printf("\tfreeDSList link list starts at 0x%x\n", dlru_addr);
2889 for (tdc = (struct dcache *)dlru_addr; tdc;
2890 tdc = (struct dcache *)Ventry->lruq.next) {
2891 kread(kmem, (off_t) tdc, (char *)Ventry, sizeof *Ventry);
2892 print_dcache(kmem, Ventry, tdc, 1);
2894 /* printf("%3d) %x\n", j, tdc);*/
2896 printf("... found %d dcache entries in the freeDSList\n", j);
2900 print_gcpags(int pnt)
2903 afs_int32 afs_gcpags;
2904 afs_int32 afs_gcpags_procsize;
2907 printf("\n\nPrinting GCPAGS structures...\n");
2909 findsym("afs_gcpags", &symoff);
2910 kread(kmem, symoff, (char *)&afs_gcpags, sizeof afs_gcpags);
2912 findsym("afs_gcpags_procsize", &symoff);
2913 kread(kmem, symoff, (char *)&afs_gcpags_procsize,
2914 sizeof afs_gcpags_procsize);
2916 printf("afs_gcpags=%d\n", afs_gcpags);
2917 printf("afs_gcpags_procsize=%d\n", afs_gcpags_procsize);
2924 #include <sys/syspest.h> /* to define the assert and ASSERT macros */
2925 #include <sys/timer.h> /* For the timer related defines */
2926 #include <sys/intr.h> /* for the serialization defines */
2927 #include <sys/malloc.h> /* for the parameters to xmalloc() */
2930 struct tos *toprev; /* previous tos in callout table */
2931 struct tos *tonext; /* next tos in callout table */
2932 struct trb *trb; /* this timer request block */
2938 int ncallo; /* number of callout table elements */
2939 struct tos *head; /* callout table head element */
2944 print_callout(int kmem)
2948 printf("\n\nCallout table doesn't exist for this system\n");
2950 struct callo Co, *Coe = &Co, *Cop;
2951 struct tos To, *Toe = &To, *tos;
2952 struct trb Trb, *Trbe = &Trb, *trb;
2956 printf("\n\nPrinting callout table info...\n\n");
2957 findsym("afs_callo", &symoff);
2958 kread(kmem, symoff, (char *)&Co, sizeof Co);
2959 printf("Number of callouts %d\n", Co.ncallo);
2960 if (Co.ncallo > 0) {
2961 printf("Count\tType\taddr\tfunc\tdata\n");
2962 for (tos = Co.head; tos != NULL; tos = Toe->tonext) {
2964 kread(kmem, (off_t) tos, (char *)&To, sizeof To);
2965 kread(kmem, (off_t) Toe->trb, (char *)&Trb, sizeof Trb);
2966 printf("%d\t%d\t%x\t%x\t%x\n", i, Toe->type, Toe->p1, Trbe->tof,
2974 print_dnlc(int kmem)
2976 struct nc *nameHash[256];
2982 print_global_locks(int kmem)
3006 "afs_xinterface"}, {
3010 printf("\n\nPrinting afs global locks...\n\n");
3011 for (i = 0; locks[i].name; i++) {
3012 findsym(locks[i].name, &symoff);
3013 kread(kmem, symoff, (char *)&count, sizeof count);
3014 printf("%s = 0x%x\n", locks[i].name, count);
3020 print_global_afs_resource(int kmem)
3027 printf("\n\nPrinting some general resource related globals...\n\n");
3028 findsym("afs_setTimeHost", &symoff);
3029 kread(kmem, symoff, (char *)&count, sizeof count);
3030 printf("\tafs_setTimeHost = 0x%x\n", count);
3031 findsym("afs_volCounter", &symoff);
3032 kread(kmem, symoff, (char *)&count, sizeof count);
3033 printf("\tafs_volCounter = 0x%x\n", count);
3034 findsym("afs_cellindex", &symoff);
3035 kread(kmem, symoff, (char *)&count, sizeof count);
3036 printf("\tafs_cellIndex = 0x%x\n", count);
3037 findsym("afs_marinerHost", &symoff);
3038 kread(kmem, symoff, (char *)&count, sizeof count);
3039 printf("\tafs_marinerHost = 0x%x\n", count);
3040 findsym("afs_sysname", &symoff);
3041 kread(kmem, symoff, (char *)&addr, sizeof addr);
3043 printf("\tafs_sysname = %d\n", addr);
3045 kread(kmem, (off_t) addr, sysname, (KDUMP_SIZE_T) 30);
3046 printf("\tafs_sysname = %s\n", sysname);
3048 #ifdef AFS_SGI65_ENV
3049 findsym("afs_ipno", &symoff);
3050 kread(kmem, symoff, (char *)&count, sizeof count);
3051 printf("\tCPU BOARD = IP%d\n", count);
3057 print_global_afs_cache(int kmem)
3062 #ifdef AFS_SGI62_ENV
3069 printf("\n\nPrinting some general cache related globals...\n\n");
3070 findsym("afs_mariner", &symoff);
3071 kread(kmem, symoff, (char *)&count, sizeof count);
3072 printf("\tafs_mariner = 0x%x\n", count);
3073 findsym("freeVCList", &symoff);
3074 kread(kmem, symoff, (char *)&count, sizeof count);
3075 printf("\tafs_freeVCList = 0x%x XXX\n", count);
3076 findsym("afs_freeDCList", &symoff);
3077 kread(kmem, symoff, (char *)&count, sizeof count);
3078 printf("\tfreeDCList = 0x%x\n", count);
3079 findsym("afs_freeDCCount", &symoff);
3080 kread(kmem, symoff, (char *)&count, sizeof count);
3081 printf("\tfreeDCCount = 0x%x (%d)\n", count, count);
3082 findsym("afs_discardDCList", &symoff);
3083 kread(kmem, symoff, (char *)&count, sizeof count);
3084 printf("\tdiscardDCList = 0x%x\n", count);
3085 findsym("afs_discardDCCount", &symoff);
3086 kread(kmem, symoff, (char *)&count, sizeof count);
3087 printf("\tdiscardDCCount = 0x%x (%d)\n", count, count);
3088 findsym("afs_freeDSList", &symoff);
3089 kread(kmem, symoff, (char *)&count, sizeof count);
3090 printf("\tfreeDSList= 0x%x XXXX\n", count);
3091 #ifdef AFS_SGI62_ENV
3092 findsym("cacheInode", &symoff);
3093 kread(kmem, symoff, (char *)&inode, sizeof inode);
3094 printf("\tcacheInode = 0x%llx (%" AFS_INT64_FMT ")\n", inode, inode);
3095 findsym("volumeInode", &symoff);
3096 kread(kmem, symoff, (char *)&inode, sizeof inode);
3097 printf("\tvolumeInode = 0x%llx (%" AFS_INT64_FMT ")\n", inode, inode);
3099 findsym("cacheInode", &symoff);
3100 kread(kmem, symoff, (char *)&count, sizeof count);
3101 printf("\tcacheInode = 0x%x (%d)\n", count, count);
3102 findsym("volumeInode", &symoff);
3103 kread(kmem, symoff, (char *)&count, sizeof count);
3104 printf("\tvolumeInode = 0x%x (%d)\n", count, count);
3106 findsym("cacheDiskType", &symoff);
3107 kread(kmem, symoff, (char *)&count, sizeof count);
3108 printf("\tcacheDiskType = 0x%x (%d)\n", count, count);
3110 findsym("afs_indexCounter", &symoff);
3111 kread(kmem, symoff, (char *)&h, sizeof(struct afs_hyper_t));
3112 printf("\tafs_indexCounter = 0x%X.%X (%d.%d)\n", h.high, h.low, h.high,
3115 findsym("afs_cacheFiles", &symoff);
3116 kread(kmem, symoff, (char *)&count, sizeof count);
3117 printf("\tafs_cacheFiles = 0x%x (%d)\n", count, count);
3118 findsym("afs_cacheBlocks", &symoff);
3119 kread(kmem, symoff, (char *)&count, sizeof count);
3120 printf("\tafs_cacheBlocks = 0x%x (%d)\n", count, count);
3121 findsym("afs_cacheStats", &symoff);
3122 kread(kmem, symoff, (char *)&count, sizeof count);
3123 printf("\tafs_cacheStats = 0x%x (%d)\n", count, count);
3124 findsym("afs_blocksUsed", &symoff);
3125 kread(kmem, symoff, (char *)&count, sizeof count);
3126 printf("\tafs_blocksUsed = 0x%x (%d)\n", count, count);
3127 findsym("afs_blocksDiscarded", &symoff);
3128 kread(kmem, symoff, (char *)&count, sizeof count);
3129 printf("\tafs_blocksDiscarded = 0x%x (%d)\n", count, count);
3130 findsym("afs_fsfragsize", &symoff);
3131 kread(kmem, symoff, (char *)&count, sizeof count);
3132 printf("\tafs_fsfragsize = 0x%x\n", count);
3133 findsym("afs_WaitForCacheDrain", &symoff);
3134 kread(kmem, symoff, (char *)&count, sizeof count);
3135 printf("\tafs_WaitForCacheDrain = 0x%x (%d)\n", count, count);
3136 findsym("afs_CacheTooFull", &symoff);
3137 kread(kmem, symoff, (char *)&count, sizeof count);
3138 printf("\tafs_CacheTooFull = 0x%x (%d)\n", count, count);
3141 if (findsym("pagCounter", &symoff)) {
3142 kread(kmem, symoff, (char *)&count, sizeof count);
3143 printf("\tpagCounter = 0x%x (%d)\n", count, count);
3145 printf("Ignoring pagCounter\n");
3151 print_rxstats(int kmem)
3156 struct rx_statistics rx_stats;
3158 printf("\n\nPrinting some general RX stats...\n\n");
3159 findsym("rx_stats", &symoff);
3160 kread(kmem, symoff, (char *)&rx_stats, sizeof rx_stats);
3161 printf("\t\tpacketRequests = %d\n", rx_stats.packetRequests);
3162 printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_RECEIVE,
3163 rx_stats.receivePktAllocFailures);
3164 printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_SEND,
3165 rx_stats.sendPktAllocFailures);
3166 printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_SPECIAL,
3167 rx_stats.specialPktAllocFailures);
3168 printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_RECV_CBUF,
3169 rx_stats.receiveCbufPktAllocFailures);
3170 printf("\t\tnoPackets[%d] = %d\n", RX_PACKET_CLASS_SEND_CBUF,
3171 rx_stats.sendCbufPktAllocFailures);
3172 printf("\t\tsocketGreedy = %d\n", rx_stats.socketGreedy);
3173 printf("\t\tbogusPacketOnRead = %d\n", rx_stats.bogusPacketOnRead);
3174 printf("\t\tbogusHost = %d\n", rx_stats.bogusHost);
3175 printf("\t\tnoPacketOnRead = %d\n", rx_stats.noPacketOnRead);
3176 printf("\t\tnoPacketBuffersOnRead = %d\n",
3177 rx_stats.noPacketBuffersOnRead);
3178 printf("\t\tselects = %d\n", rx_stats.selects);
3179 printf("\t\tsendSelects = %d\n", rx_stats.sendSelects);
3180 for (i = 0; i < RX_N_PACKET_TYPES; i++)
3181 printf("\t\tpacketsRead[%d] = %d\n", i, rx_stats.packetsRead[i]);
3182 printf("\t\tdataPacketsRead = %d\n", rx_stats.dataPacketsRead);
3183 printf("\t\tackPacketsRead = %d\n", rx_stats.ackPacketsRead);
3184 printf("\t\tdupPacketsRead = %d\n", rx_stats.dupPacketsRead);
3185 printf("\t\tspuriousPacketsRead = %d\n", rx_stats.spuriousPacketsRead);
3186 for (i = 0; i < RX_N_PACKET_TYPES; i++)
3187 printf("\t\tpacketsSent[%d] = %d\n", i, rx_stats.packetsSent[i]);
3188 printf("\t\tackPacketsSent = %d\n", rx_stats.ackPacketsSent);
3189 printf("\t\tpingPacketsSent = %d\n", rx_stats.pingPacketsSent);
3190 printf("\t\tabortPacketsSent = %d\n", rx_stats.abortPacketsSent);
3191 printf("\t\tbusyPacketsSent = %d\n", rx_stats.busyPacketsSent);
3192 printf("\t\tdataPacketsSent = %d\n", rx_stats.dataPacketsSent);
3193 printf("\t\tdataPacketsReSent = %d\n", rx_stats.dataPacketsReSent);
3194 printf("\t\tdataPacketsPushed = %d\n", rx_stats.dataPacketsPushed);
3195 printf("\t\tignoreAckedPacket = %d\n", rx_stats.ignoreAckedPacket);
3196 printf("\t\ttotalRtt = %d sec, %d usec\n", rx_stats.totalRtt.sec,
3197 rx_stats.totalRtt.usec);
3198 printf("\t\tminRtt = %d sec, %d usec\n", rx_stats.minRtt.sec,
3199 rx_stats.minRtt.usec);
3200 printf("\t\tmaxRtt = %d sec, %d usec\n", rx_stats.maxRtt.sec,
3201 rx_stats.maxRtt.usec);
3202 printf("\t\tnRttSamples = %d\n", rx_stats.nRttSamples);
3203 printf("\t\tnServerConns = %d\n", rx_stats.nServerConns);
3204 printf("\t\tnClientConns = %d\n", rx_stats.nClientConns);
3205 printf("\t\tnPeerStructs = %d\n", rx_stats.nPeerStructs);
3206 printf("\t\tnCallStructs = %d\n", rx_stats.nCallStructs);
3207 printf("\t\tnFreeCallStructs = %d\n", rx_stats.nFreeCallStructs);
3208 printf("\t\tnetSendFailures = %d\n", rx_stats.netSendFailures);
3209 printf("\t\tfatalErrors = %d\n", rx_stats.fatalErrors);
3217 char sysname[100], c;
3218 afs_int32 count, i, ar[100];
3220 struct rx_statistics rx_stats;
3222 printf("\n\nPrinting some RX globals...\n\n");
3223 findsym("rx_extraQuota", &symoff);
3224 kread(kmem, symoff, (char *)&count, sizeof count);
3225 printf("\trx_extraQuota = %d\n", count);
3226 findsym("rx_extraPackets", &symoff);
3227 kread(kmem, symoff, (char *)&count, sizeof count);
3228 printf("\trx_extraPackets = %d\n", count);
3229 findsym("rx_stackSize", &symoff);
3230 kread(kmem, symoff, (char *)&count, sizeof count);
3231 printf("\trx_stackSize = %d\n", count);
3232 findsym("rx_connDeadTime", &symoff);
3233 kread(kmem, symoff, (char *)&count, sizeof count);
3235 printf("\trx_connDeadTime = %d\n", count);
3236 findsym("rx_idleConnectionTime", &symoff);
3237 kread(kmem, symoff, (char *)&count, sizeof count);
3239 printf("\trx_idleConnectionTime = %d\n", count);
3241 findsym("rx_idlePeerTime", &symoff);
3242 kread(kmem, symoff, (char *)&count, sizeof count);
3243 printf("\trx_idlePeerTime = %d\n", count);
3245 findsym("rx_initSendWindow", &symoff);
3246 kread(kmem, symoff, (char *)&count, sizeof count);
3247 printf("\trx_initSendWindow = %d\n", count);
3249 findsym("rxi_nSendFrags", &symoff);
3250 kread(kmem, symoff, (char *)&count, sizeof count);
3251 printf("\trxi_nSendFrags = %d\n", count);
3253 findsym("rx_nPackets", &symoff);
3254 kread(kmem, symoff, (char *)&count, sizeof count);
3256 printf("\trx_nPackets = %d\n", count);
3257 findsym("rx_nFreePackets", &symoff);
3258 kread(kmem, symoff, (char *)&count, sizeof count);
3260 printf("\trx_nFreePackets = %d\n", count);
3261 findsym("rx_socket", &symoff);
3262 kread(kmem, symoff, (char *)&count, sizeof count);
3264 printf("\trx_socket = 0x%x\n", count);
3265 findsym("rx_port", &symoff);
3266 kread(kmem, symoff, (char *)&sm, sizeof sm);
3268 printf("\trx_Port = %d\n", sm);
3269 findsym("rx_packetQuota", &symoff);
3270 kread(kmem, symoff, (char *)ar, sizeof ar);
3272 for (i = 0; i < RX_N_PACKET_CLASSES; i++)
3273 printf("\trx_packetQuota[%d] = %d\n", i, ar[i]);
3274 findsym("rx_nextCid", &symoff);
3275 kread(kmem, symoff, (char *)&count, sizeof count);
3277 printf("\trx_nextCid = 0x%x\n", count);
3278 findsym("rx_epoch", &symoff);
3279 kread(kmem, symoff, (char *)&count, sizeof count);
3281 printf("\trx_epoch = 0u%u\n", count);
3282 findsym("rx_waitingForPackets", &symoff);
3283 kread(kmem, symoff, (char *)&c, sizeof(c));
3285 printf("\trx_waitingForPackets = %x\n", (int)c);
3286 findsym("rxi_nCalls", &symoff);
3287 kread(kmem, symoff, (char *)&count, sizeof count);
3289 printf("\trxi_nCalls = %d\n", count);
3290 findsym("rxi_dataQuota", &symoff);
3291 kread(kmem, symoff, (char *)&count, sizeof count);
3293 printf("\trxi_dataQuota = %d\n", count);
3295 if (findsym("rxi_Alloccnt", &symoff)) {
3296 kread(kmem, symoff, (char *)&count, sizeof count);
3297 printf("\trxi_Alloccnt = %d\n", count);
3300 if (findsym("rxi_Allocsize", &symoff)) {
3301 kread(kmem, symoff, (char *)&count, sizeof count);
3302 printf("\trxi_Allocsize = %d\n", count);
3305 findsym("rxi_availProcs", &symoff);
3306 kread(kmem, symoff, (char *)&count, sizeof count);
3308 printf("\trxi_availProcs = %d\n", count);
3309 findsym("rxi_totalMin", &symoff);
3310 kread(kmem, symoff, (char *)&count, sizeof count);
3312 printf("\trxi_totalMin = %d\n", count);
3313 findsym("rxi_minDeficit", &symoff);
3314 kread(kmem, symoff, (char *)&count, sizeof count);
3316 printf("\trxi_minDeficit = %d\n", count);
3317 print_services(kmem);
3318 #ifdef KDUMP_RX_LOCK
3320 print_peertable_lock(kmem);
3321 print_conntable_lock(kmem);
3322 print_calltable_lock(kmem);
3324 print_peertable(kmem);
3325 print_conntable(kmem);
3326 print_calltable(kmem);
3329 print_peertable(kmem);
3330 print_conntable(kmem);
3331 print_calltable(kmem);
3333 print_eventtable(kmem);
3334 print_rxstats(kmem);
3339 print_services(afs_int32 kmem)
3342 struct rx_service *rx_services[RX_MAX_SERVICES], se, *sentry = &se, *sep;
3344 afs_int32 count, i, j;
3346 findsym("rx_services", &symoff);
3347 kread(kmem, symoff, (char *)rx_services, RX_MAX_SERVICES * sizeof(long));
3349 printf("\n\nPrinting all 'rx_services' structures...\n");
3350 for (i = 0, j = 0; i < RX_MAX_SERVICES; i++) {
3351 if (rx_services[i]) {
3353 kread(kmem, (off_t) rx_services[i], (char *)sentry,
3355 kread(kmem, (off_t) sentry->serviceName, sysname,
3358 ("\t%lx: serviceId=%d, port=%d, serviceName=%s, socket=0x%x\n",
3359 rx_services[i], sentry->serviceId, sentry->servicePort,
3360 sysname, sentry->socket);
3362 ("\t\tnSecObj=%d, nReqRunning=%d, maxProcs=%d, minProcs=%d, connDeadTime=%d, idleDeadTime=%d\n",
3363 sentry->nSecurityObjects, sentry->nRequestsRunning,
3364 sentry->maxProcs, sentry->minProcs, sentry->connDeadTime,
3365 sentry->idleDeadTime);
3368 printf("... found %d 'rx_services' entries in the table\n", j);
3372 #ifdef KDUMP_RX_LOCK
3374 print_peertable_lock(afs_int32 kmem)
3377 struct rx_peer_rx_lock *rx_peerTable[256], se, *sentry = &se, *sep;
3380 findsym("rx_peerHashTable", &symoff);
3381 kread(kmem, symoff, (char *)&count, sizeof(long));
3383 printf("No 'rx_peer' structures found.\n");
3387 kread(kmem, count, (char *)rx_peerTable, 256 * sizeof(long));
3388 printf("\n\nPrinting all 'rx_peer' structures...\n");
3389 for (i = 0, j = 0; i < 256; i++) {
3390 for (sep = rx_peerTable[i]; sep; sep = sentry->next, j++) {
3391 kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3392 printf("\t%lx: next=0x%lx, host=0x%x, ", sep, sentry->next,
3394 printf("ifMTU=%d, natMTU=%d, maxMTU=%d\n", sentry->ifMTU,
3395 sentry->natMTU, sentry->maxMTU);
3396 printf("\t\trtt=%d:%d, timeout(%d:%d), nSent=%d, reSends=%d\n",
3397 sentry->rtt, sentry->rtt_dev, sentry->timeout.sec,
3398 sentry->timeout.usec, sentry->nSent, sentry->reSends);
3399 printf("\t\trefCount=%d, port=%d, idleWhen=0x%x\n",
3400 sentry->refCount, sentry->port, sentry->idleWhen);
3402 ("\t\tCongestionQueue (0x%x:0x%x), inPacketSkew=0x%x, outPacketSkew=0x%x\n",
3403 sentry->congestionQueue.prev, sentry->congestionQueue.next,
3404 sentry->inPacketSkew, sentry->outPacketSkew);
3405 printf("\t\tpeer_lock=%d\n", sentry->peer_lock);
3408 printf("... found %d 'rx_peer' entries in the table\n", j);
3411 #endif /* KDUMP_RX_LOCK */
3413 print_peertable(afs_int32 kmem)
3416 struct rx_peer *rx_peerTable[256], se, *sentry = &se, *sep;
3419 findsym("rx_peerHashTable", &symoff);
3420 kread(kmem, symoff, (char *)&count, sizeof(long));
3422 kread(kmem, count, (char *)rx_peerTable, 256 * sizeof(long));
3423 printf("\n\nPrinting all 'rx_peer' structures...\n");
3424 for (i = 0, j = 0; i < 256; i++) {
3425 for (sep = rx_peerTable[i]; sep; sep = sentry->next, j++) {
3426 kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3427 printf("\t%lx: next=0x%lx, host=0x%x, ", sep, sentry->next,
3429 printf("ifMTU=%d, natMTU=%d, maxMTU=%d\n", sentry->ifMTU,
3430 sentry->natMTU, sentry->maxMTU);
3431 printf("\t\trtt=%d:%d, timeout(%d:%d), nSent=%d, reSends=%d\n",
3432 sentry->rtt, sentry->rtt_dev, sentry->timeout.sec,
3433 sentry->timeout.usec, sentry->nSent, sentry->reSends);
3434 printf("\t\trefCount=%d, port=%d, idleWhen=0x%x\n",
3435 sentry->refCount, sentry->port, sentry->idleWhen);
3437 ("\t\tCongestionQueue (0x%x:0x%x), inPacketSkew=0x%x, outPacketSkew=0x%x\n",
3438 sentry->congestionQueue.prev, sentry->congestionQueue.next,
3439 sentry->inPacketSkew, sentry->outPacketSkew);
3440 #ifdef RX_ENABLE_LOCKS
3441 printf("\t\tpeer_lock=%d\n", sentry->peer_lock);
3442 #endif /* RX_ENABLE_LOCKS */
3445 printf("... found %d 'rx_peer' entries in the table\n", j);
3449 #ifdef KDUMP_RX_LOCK
3451 print_conntable_lock(afs_int32 kmem)
3454 struct rx_connection_rx_lock *rx_connTable[256], se, *sentry = &se;
3455 struct rx_connection_rx_lock *sep;
3458 findsym("rx_connHashTable", &symoff);
3459 kread(kmem, symoff, (char *)&count, sizeof(long));
3461 printf("No 'rx_connection' structures found.\n");
3465 kread(kmem, count, (char *)rx_connTable, 256 * sizeof(long));
3466 printf("\n\nPrinting all 'rx_connection' structures...\n");
3467 for (i = 0, j = 0; i < 256; i++) {
3468 for (sep = rx_connTable[i]; sep; sep = sentry->next, j++) {
3469 kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3471 ("\t%lx: next=0x%lx, peer=0x%lx, epoch=0x%x, cid=0x%x, ackRate=%d\n",
3472 sep, se.next, se.peer, se.epoch, se.cid, se.ackRate);
3473 printf("\t\tcall[%lx=%d, %lx=%d, %lx=%d, %lx=%d]\n", se.call[0],
3474 se.callNumber[0], se.call[1], se.callNumber[1], se.call[2],
3475 se.callNumber[2], se.call[3], se.callNumber[3]);
3477 ("\t\ttimeout=%d, flags=0x%x, type=0x%x, serviceId=%d, service=0x%lx, refCount=%d\n",
3478 se.timeout, se.flags, se.type, se.serviceId, se.service,
3481 ("\t\tserial=%d, lastSerial=%d, secsUntilDead=%d, secsUntilPing=%d, secIndex=%d\n",
3482 se.serial, se.lastSerial, se.secondsUntilDead,
3483 se.secondsUntilPing, se.securityIndex);
3485 ("\t\terror=%d, secObject=0x%lx, secData=0x%lx, secHeaderSize=%d, secmaxTrailerSize=%d\n",
3486 se.error, se.securityObject, se.securityData,
3487 se.securityHeaderSize, se.securityMaxTrailerSize);
3489 ("\t\tchallEvent=0x%lx, lastSendTime=0x%x, maxSerial=%d, hardDeadTime=%d\n",
3490 se.challengeEvent, se.lastSendTime, se.maxSerial,
3492 if (se.flags & RX_CONN_MAKECALL_WAITING)
3494 ("\t\t***** Conn in RX_CONN_MAKECALL_WAITING state *****\n");
3496 ("\t\tcall_lock=%d, call_cv=%d, data_lock=%d, refCount=%d\n",
3497 se.conn_call_lock, se.conn_call_cv, se.conn_data_lock,
3501 printf("... found %d 'rx_connection' entries in the table\n", j);
3503 #endif /* KDUMP_RX_LOCK */
3506 print_conntable(afs_int32 kmem)
3509 struct rx_connection *rx_connTable[256], se, *sentry = &se, *sep;
3512 findsym("rx_connHashTable", &symoff);
3513 kread(kmem, symoff, (char *)&count, sizeof(long));
3515 kread(kmem, count, (char *)rx_connTable, 256 * sizeof(long));
3516 printf("\n\nPrinting all 'rx_connection' structures...\n");
3517 for (i = 0, j = 0; i < 256; i++) {
3518 for (sep = rx_connTable[i]; sep; sep = sentry->next, j++) {
3519 kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3521 ("\t%lx: next=0x%lx, peer=0x%lx, epoch=0x%x, cid=0x%x, ackRate=%d\n",
3522 sep, se.next, se.peer, se.epoch, se.cid, se.ackRate);
3523 printf("\t\tcall[%x=%d, %x=%d, %x=%d, %x=%d]\n", se.call[0],
3524 se.callNumber[0], se.call[1], se.callNumber[1], se.call[2],
3525 se.callNumber[2], se.call[3], se.callNumber[3]);
3527 ("\t\ttimeout=%d, flags=0x%x, type=0x%x, serviceId=%d, service=0x%lx, refCount=%d\n",
3528 se.timeout, se.flags, se.type, se.serviceId, se.service,
3531 ("\t\tserial=%d, lastSerial=%d, secsUntilDead=%d, secsUntilPing=%d, secIndex=%d\n",
3532 se.serial, se.lastSerial, se.secondsUntilDead,
3533 se.secondsUntilPing, se.securityIndex);
3535 ("\t\terror=%d, secObject=0x%lx, secData=0x%lx, secHeaderSize=%d, secmaxTrailerSize=%d\n",
3536 se.error, se.securityObject, se.securityData,
3537 se.securityHeaderSize, se.securityMaxTrailerSize);
3539 ("\t\tchallEvent=0x%lx, lastSendTime=0x%x, maxSerial=%d, hardDeadTime=%d\n",
3540 se.challengeEvent, se.lastSendTime, se.maxSerial,
3542 if (se.flags & RX_CONN_MAKECALL_WAITING)
3544 ("\t\t***** Conn in RX_CONN_MAKECALL_WAITING state *****\n");
3545 #ifdef RX_ENABLE_LOCKS
3547 ("\t\tcall_lock=%d, call_cv=%d, data_lock=%d, refCount=%d\n",
3548 se.conn_call_lock, se.conn_call_cv, se.conn_data_lock,
3550 #endif /* RX_ENABLE_LOCKS */
3553 printf("... found %d 'rx_connection' entries in the table\n", j);
3557 #ifdef KDUMP_RX_LOCK
3559 print_calltable_lock(afs_int32 kmem)
3562 struct rx_connection_rx_lock *rx_connTable[256], se;
3563 struct rx_connection_rx_lock *sentry = &se;
3564 struct rx_connection_rx_lock *sep;
3565 long count, i, j, k;
3567 findsym("rx_connHashTable", &symoff);
3568 kread(kmem, symoff, (char *)&count, sizeof(long));
3570 printf("No 'rx_call' structures found.\n");
3574 kread(kmem, count, (char *)rx_connTable, 256 * sizeof(long));
3575 printf("\n\nPrinting all active 'rx_call' structures...\n");
3576 for (i = 0, j = 0; i < 256; i++) {
3577 for (sep = rx_connTable[i]; sep; sep = se.next) {
3578 kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3579 for (k = 0; k < RX_MAXCALLS; k++) {
3580 struct rx_call_rx_lock ce, *centry = &ce;
3581 struct rx_call_rx_lock *call = se.call[k];
3584 kread(kmem, (off_t) call, (char *)centry, sizeof *centry);
3586 ("\t%lx: conn=0x%lx, qiheader(0x%lx:0x%lx), tq(0x%lx:0x%lx), rq(0x%lx:0x%lx)\n",
3587 call, centry->conn, centry->queue_item_header.prev,
3588 centry->queue_item_header.next, centry->tq.prev,
3589 centry->tq.next, centry->rq.prev, centry->rq.next);
3591 ("\t\t: curvec=%d, curpos=%d, nLeft=%d, nFree=%d, currPacket=0x%lx, callNumber=0x%x\n",
3592 centry->curvec, centry->curpos, centry->nLeft,
3593 centry->nFree, centry->currentPacket,
3594 centry->callNumber);
3596 ("\t\t: channel=%d, state=0x%x, mode=0x%x, flags=0x%x, localStatus=0x%x, remStatus=0x%x\n",
3597 centry->channel, centry->state, centry->mode,
3598 centry->flags, centry->localStatus,
3599 centry->remoteStatus);
3601 ("\t\t: error=%d, timeout=0x%x, rnext=0x%x, rprev=0x%x, rwind=0x%x, tfirst=0x%x, tnext=0x%x\n",
3602 centry->error, centry->timeout, centry->rnext,
3603 centry->rprev, centry->rwind, centry->tfirst,
3606 ("\t\t: twind=%d, resendEvent=0x%lx, timeoutEvent=0x%lx, keepAliveEvent=0x%lx, delayedAckEvent=0x%lx\n",
3607 centry->twind, centry->resendEvent,
3608 centry->timeoutEvent, centry->keepAliveEvent,
3609 centry->delayedAckEvent);
3611 ("\t\t: lastSendTime=0x%x, lastReceiveTime=0x%x, lastAcked=0x%x, startTime=0x%x, startWait=0x%x\n",
3612 centry->lastSendTime, centry->lastReceiveTime,
3613 centry->lastAcked, centry->startTime,
3615 if (centry->flags & RX_CALL_WAIT_PROC)
3617 ("\t\t******** Call in RX_CALL_WAIT_PROC state **********\n");
3618 if (centry->flags & RX_CALL_WAIT_WINDOW_ALLOC)
3620 ("\t\t******** Call in RX_CALL_WAIT_WINDOW_ALLOC state **********\n");
3621 if (centry->flags & RX_CALL_READER_WAIT)
3623 ("\t\t******** Conn in RX_CALL_READER_WAIT state **********\n");
3624 if (centry->flags & RX_CALL_WAIT_PACKETS)
3626 ("\t\t******** Conn in RX_CALL_WAIT_PACKETS state **********\n");
3628 ("\t\t: lock=0x%x, cv_twind=0x%x, cv_rq=0x%x, refCount=%d\n",
3629 centry->lock, centry->cv_twind, centry->cv_rq,
3631 printf("\t\t: MTU=%d\n", centry->MTU);
3636 printf("... found %d 'rx_call' entries in the table\n", j);
3638 #endif /* KDUMP_RX_LOCK */
3641 print_calltable(afs_int32 kmem)
3644 struct rx_connection *rx_connTable[256], se, *sentry = &se, *sep;
3645 long count, i, j, k;
3647 findsym("rx_connHashTable", &symoff);
3648 kread(kmem, symoff, (char *)&count, sizeof(long));
3650 kread(kmem, count, (char *)rx_connTable, 256 * sizeof(long));
3651 printf("\n\nPrinting all active 'rx_call' structures...\n");
3652 for (i = 0, j = 0; i < 256; i++) {
3653 for (sep = rx_connTable[i]; sep; sep = se.next) {
3654 kread(kmem, (off_t) sep, (char *)sentry, sizeof *sentry);
3655 for (k = 0; k < RX_MAXCALLS; k++) {
3656 struct rx_call ce, *centry = &ce, *call = se.call[k];
3659 kread(kmem, (off_t) call, (char *)centry, sizeof *centry);
3661 ("\t%lx: conn=0x%lx, qiheader(0x%lx:0x%lx), tq(0x%lx:0x%lx), rq(0x%lx:0x%lx)\n",
3662 call, centry->conn, centry->queue_item_header.prev,
3663 centry->queue_item_header.next, centry->tq.prev,
3664 centry->tq.next, centry->rq.prev, centry->rq.next);
3666 ("\t\t: curvec=%d, curpos=%d, nLeft=%d, nFree=%d, currPacket=0x%lx, callNumber=0x%x\n",
3667 centry->curvec, centry->curpos, centry->nLeft,
3668 centry->nFree, centry->currentPacket,
3669 centry->callNumber);
3671 ("\t\t: channel=%d, state=0x%x, mode=0x%x, flags=0x%x, localStatus=0x%x, remStatus=0x%x\n",
3672 centry->channel, centry->state, centry->mode,
3673 centry->flags, centry->localStatus,
3674 centry->remoteStatus);
3676 ("\t\t: error=%d, timeout=0x%x, rnext=0x%x, rprev=0x%x, rwind=0x%x, tfirst=0x%x, tnext=0x%x\n",
3677 centry->error, centry->timeout, centry->rnext,
3678 centry->rprev, centry->rwind, centry->tfirst,
3681 ("\t\t: twind=%d, resendEvent=0x%lx, timeoutEvent=0x%lx, keepAliveEvent=0x%lx, delayedAckEvent=0x%lx\n",
3682 centry->twind, centry->resendEvent,
3683 centry->timeoutEvent, centry->keepAliveEvent,
3684 centry->delayedAckEvent);
3686 ("\t\t: lastSendTime=0x%x, lastReceiveTime=0x%x, lastAcked=0x%x, startTime=0x%x, startWait=0x%x\n",
3687 centry->lastSendTime, centry->lastReceiveTime,
3688 centry->lastAcked, centry->startTime,
3690 if (centry->flags & RX_CALL_WAIT_PROC)
3692 ("\t\t******** Call in RX_CALL_WAIT_PROC state **********\n");
3693 if (centry->flags & RX_CALL_WAIT_WINDOW_ALLOC)
3695 ("\t\t******** Call in RX_CALL_WAIT_WINDOW_ALLOC state **********\n");
3696 if (centry->flags & RX_CALL_READER_WAIT)
3698 ("\t\t******** Conn in RX_CALL_READER_WAIT state **********\n");
3699 if (centry->flags & RX_CALL_WAIT_PACKETS)
3701 ("\t\t******** Conn in RX_CALL_WAIT_PACKETS state **********\n");
3702 #ifdef RX_ENABLE_LOCKS
3704 ("\t\t: lock=0x%x, cv_twind=0x%x, cv_rq=0x%x, refCount=%d\n",
3705 centry->lock, centry->cv_twind, centry->cv_rq,
3707 #endif /* RX_ENABLE_LOCKS */
3708 printf("\t\t: MTU=%d\n", centry->MTU);
3713 printf("... found %d 'rx_call' entries in the table\n", j);
3717 print_eventtable(afs_int32 kmem)
3720 struct rx_queue epq;
3721 struct rx_queue evq;
3722 char *epend, *evend;
3723 afs_int32 count, i, j = 0, k = 0;
3725 #if ! defined(AFS_HPUX_ENV) && ! defined(AFS_AIX_ENV)
3726 findsym("rxevent_nFree", &symoff);
3727 kread(kmem, symoff, (char *)&count, sizeof(afs_int32));
3728 printf("\n\n\trxevent_nFree = %d\n", count);
3730 findsym("rxevent_nPosted", &symoff);
3731 kread(kmem, symoff, (char *)&count, sizeof(afs_int32));
3732 printf("\trxevent_nPosted = %d\n", count);
3739 * Print the up/downtime stats for the given class of server records
3743 print_upDownStats(struct afs_stats_SrvUpDownInfo *a_upDownP)
3744 { /*print_upDownStats */
3747 * First, print the simple values.
3749 printf("\t\t%10d numTtlRecords\n", a_upDownP->numTtlRecords);
3750 printf("\t\t%10d numUpRecords\n", a_upDownP->numUpRecords);
3751 printf("\t\t%10d numDownRecords\n", a_upDownP->numDownRecords);
3752 printf("\t\t%10d sumOfRecordAges\n", a_upDownP->sumOfRecordAges);
3753 printf("\t\t%10d ageOfYoungestRecord\n", a_upDownP->ageOfYoungestRecord);
3754 printf("\t\t%10d ageOfOldestRecord\n", a_upDownP->ageOfOldestRecord);
3755 printf("\t\t%10d numDowntimeIncidents\n",
3756 a_upDownP->numDowntimeIncidents);
3757 printf("\t\t%10d numRecordsNeverDown\n", a_upDownP->numRecordsNeverDown);
3758 printf("\t\t%10d maxDowntimesInARecord\n",
3759 a_upDownP->maxDowntimesInARecord);
3760 printf("\t\t%10d sumOfDowntimes\n", a_upDownP->sumOfDowntimes);
3761 printf("\t\t%10d shortestDowntime\n", a_upDownP->shortestDowntime);
3762 printf("\t\t%10d longestDowntime\n", a_upDownP->longestDowntime);
3765 * Now, print the array values.
3767 printf("\t\tDowntime duration distribution:\n");
3768 printf("\t\t\t%8d: 0 min .. 10 min\n", a_upDownP->downDurations[0]);
3769 printf("\t\t\t%8d: 10 min .. 30 min\n", a_upDownP->downDurations[1]);
3770 printf("\t\t\t%8d: 30 min .. 1 hr\n", a_upDownP->downDurations[2]);
3771 printf("\t\t\t%8d: 1 hr .. 2 hr\n", a_upDownP->downDurations[3]);
3772 printf("\t\t\t%8d: 2 hr .. 4 hr\n", a_upDownP->downDurations[4]);
3773 printf("\t\t\t%8d: 4 hr .. 8 hr\n", a_upDownP->downDurations[5]);
3774 printf("\t\t\t%8d: > 8 hr\n", a_upDownP->downDurations[6]);
3776 printf("\t\tDowntime incident distribution:\n");
3777 printf("\t\t\t%8d: 0 times\n", a_upDownP->downIncidents[0]);
3778 printf("\t\t\t%8d: 1 time\n", a_upDownP->downDurations[1]);
3779 printf("\t\t\t%8d: 2 .. 5 times\n", a_upDownP->downDurations[2]);
3780 printf("\t\t\t%8d: 6 .. 10 times\n", a_upDownP->downDurations[3]);
3781 printf("\t\t\t%8d: 10 .. 50 times\n", a_upDownP->downDurations[4]);
3782 printf("\t\t\t%8d: > 50 times\n", a_upDownP->downDurations[5]);
3783 } /*print_upDownStats */
3787 print_cmperfstats(struct afs_stats_CMPerf *perfP)
3789 struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to server up/down info */
3791 printf("\t%10d numPerfCalls\n", perfP->numPerfCalls);
3792 printf("\t%10d epoch\n", perfP->epoch);
3793 printf("\t%10d numCellsVisible\n", perfP->numCellsVisible);
3794 printf("\t%10d numCellsContacted\n", perfP->numCellsContacted);
3795 printf("\t%10d dlocalAccesses\n", perfP->dlocalAccesses);
3796 printf("\t%10d vlocalAccesses\n", perfP->vlocalAccesses);
3797 printf("\t%10d dremoteAccesses\n", perfP->dremoteAccesses);
3798 printf("\t%10d vremoteAccesses\n", perfP->vremoteAccesses);
3799 printf("\t%10d cacheNumEntries\n", perfP->cacheNumEntries);
3800 printf("\t%10d cacheBlocksTotal\n", perfP->cacheBlocksTotal);
3801 printf("\t%10d cacheBlocksInUse\n", perfP->cacheBlocksInUse);
3802 printf("\t%10d cacheBlocksOrig\n", perfP->cacheBlocksOrig);
3803 printf("\t%10d cacheMaxDirtyChunks\n", perfP->cacheMaxDirtyChunks);
3804 printf("\t%10d cacheCurrDirtyChunks\n", perfP->cacheCurrDirtyChunks);
3805 printf("\t%10d dcacheHits\n", perfP->dcacheHits);
3806 printf("\t%10d vcacheHits\n", perfP->vcacheHits);
3807 printf("\t%10d dcacheMisses\n", perfP->dcacheMisses);
3808 printf("\t%10d vcacheMisses\n", perfP->vcacheMisses);
3809 printf("\t%10d cacheFlushes\n", perfP->cacheFlushes);
3810 printf("\t%10d cacheFilesReused\n", perfP->cacheFilesReused);
3811 printf("\t%10d vcacheXAllocs\n", perfP->vcacheXAllocs);
3812 printf("\t%10d dcacheXAllocs\n", perfP->dcacheXAllocs);
3814 printf("\t%10d bufAlloced\n", perfP->bufAlloced);
3815 printf("\t%10d bufHits\n", perfP->bufHits);
3816 printf("\t%10d bufMisses\n", perfP->bufMisses);
3817 printf("\t%10d bufFlushDirty\n", perfP->bufFlushDirty);
3819 printf("\t%10d LargeBlocksActive\n", perfP->LargeBlocksActive);
3820 printf("\t%10d LargeBlocksAlloced\n", perfP->LargeBlocksAlloced);
3821 printf("\t%10d SmallBlocksActive\n", perfP->SmallBlocksActive);
3822 printf("\t%10d SmallBlocksAlloced\n", perfP->SmallBlocksAlloced);
3823 printf("\t%10d MediumBlocksActive\n", perfP->MediumBlocksActive);
3824 printf("\t%10d MediumBlocksAlloced\n", perfP->MediumBlocksAlloced);
3825 printf("\t%10d OutStandingMemUsage\n", perfP->OutStandingMemUsage);
3826 printf("\t%10d OutStandingAllocs\n", perfP->OutStandingAllocs);
3827 printf("\t%10d CallBackAlloced\n", perfP->CallBackAlloced);
3828 printf("\t%10d CallBackFlushes\n", perfP->CallBackFlushes);
3829 printf("\t%10d CallBackLoops\n", perfP->cbloops);
3831 printf("\t%10d srvRecords\n", perfP->srvRecords);
3832 printf("\t%10d srvNumBuckets\n", perfP->srvNumBuckets);
3833 printf("\t%10d srvMaxChainLength\n", perfP->srvMaxChainLength);
3834 printf("\t%10d srvRecordsHWM\n", perfP->srvRecordsHWM);
3835 printf("\t%10d srvMaxChainLengthHWM\n", perfP->srvMaxChainLengthHWM);
3837 printf("\t%10d sysName_ID\n", perfP->sysName_ID);
3838 printf("\t%10d osi_Read_EFAULTS\n", perfP->osiread_efaults);
3840 printf("\tFile Server up/downtimes, same cell:\n");
3841 print_upDownStats(&(perfP->fs_UpDown[0]));
3843 printf("\tFile Server up/downtimes, diff cell:\n");
3844 print_upDownStats(&(perfP->fs_UpDown[1]));
3846 printf("\tVL Server up/downtimes, same cell:\n");
3847 print_upDownStats(&(perfP->vl_UpDown[0]));
3849 printf("\tVL Server up/downtimes, diff cell:\n");
3850 print_upDownStats(&(perfP->vl_UpDown[1]));
3855 print_cmstats(struct afs_CMStats *cmp)
3857 printf("\t%10d afs_init\n", cmp->callInfo.C_afs_init);
3858 printf("\t%10d gop_rdwr\n", cmp->callInfo.C_gop_rdwr);
3859 printf("\t%10d aix_gnode_rele\n", cmp->callInfo.C_aix_gnode_rele);
3860 printf("\t%10d gettimeofday\n", cmp->callInfo.C_gettimeofday);
3861 printf("\t%10d m_cpytoc\n", cmp->callInfo.C_m_cpytoc);
3862 printf("\t%10d aix_vattr_null\n", cmp->callInfo.C_aix_vattr_null);
3863 printf("\t%10d afs_gn_frunc\n", cmp->callInfo.C_afs_gn_ftrunc);
3864 printf("\t%10d afs_gn_rdwr\n", cmp->callInfo.C_afs_gn_rdwr);
3865 printf("\t%10d afs_gn_ioctl\n", cmp->callInfo.C_afs_gn_ioctl);
3866 printf("\t%10d afs_gn_locktl\n", cmp->callInfo.C_afs_gn_lockctl);
3867 printf("\t%10d afs_gn_readlink\n", cmp->callInfo.C_afs_gn_readlink);
3868 printf("\t%10d afs_gn_readdir\n", cmp->callInfo.C_afs_gn_readdir);
3869 printf("\t%10d afs_gn_select\n", cmp->callInfo.C_afs_gn_select);
3870 printf("\t%10d afs_gn_strategy\n", cmp->callInfo.C_afs_gn_strategy);
3871 printf("\t%10d afs_gn_symlink\n", cmp->callInfo.C_afs_gn_symlink);
3872 printf("\t%10d afs_gn_revoke\n", cmp->callInfo.C_afs_gn_revoke);
3873 printf("\t%10d afs_gn_link\n", cmp->callInfo.C_afs_gn_link);
3874 printf("\t%10d afs_gn_mkdir\n", cmp->callInfo.C_afs_gn_mkdir);
3875 printf("\t%10d afs_gn_mknod\n", cmp->callInfo.C_afs_gn_mknod);
3876 printf("\t%10d afs_gn_remove\n", cmp->callInfo.C_afs_gn_remove);
3877 printf("\t%10d afs_gn_rename\n", cmp->callInfo.C_afs_gn_rename);
3878 printf("\t%10d afs_gn_rmdir\n", cmp->callInfo.C_afs_gn_rmdir);
3879 printf("\t%10d afs_gn_fid\n", cmp->callInfo.C_afs_gn_fid);
3880 printf("\t%10d afs_gn_lookup\n", cmp->callInfo.C_afs_gn_lookup);
3881 printf("\t%10d afs_gn_open\n", cmp->callInfo.C_afs_gn_open);
3882 printf("\t%10d afs_gn_create\n", cmp->callInfo.C_afs_gn_create);
3883 printf("\t%10d afs_gn_hold\n", cmp->callInfo.C_afs_gn_hold);
3884 printf("\t%10d afs_gn_rele\n", cmp->callInfo.C_afs_gn_rele);
3885 printf("\t%10d afs_gn_unmap\n", cmp->callInfo.C_afs_gn_unmap);
3886 printf("\t%10d afs_gn_access\n", cmp->callInfo.C_afs_gn_access);
3887 printf("\t%10d afs_gn_getattr\n", cmp->callInfo.C_afs_gn_getattr);
3888 printf("\t%10d afs_gn_setattr\n", cmp->callInfo.C_afs_gn_setattr);
3889 printf("\t%10d afs_gn_fclear\n", cmp->callInfo.C_afs_gn_fclear);
3890 printf("\t%10d afs_gn_fsync\n", cmp->callInfo.C_afs_gn_fsync);
3891 printf("\t%10d phash\n", cmp->callInfo.C_pHash);
3892 printf("\t%10d DInit\n", cmp->callInfo.C_DInit);
3893 printf("\t%10d DRead\n", cmp->callInfo.C_DRead);
3894 printf("\t%10d FixupBucket\n", cmp->callInfo.C_FixupBucket);
3895 printf("\t%10d afs_newslot\n", cmp->callInfo.C_afs_newslot);
3896 printf("\t%10d DRelease\n", cmp->callInfo.C_DRelease);
3897 printf("\t%10d DFlush\n", cmp->callInfo.C_DFlush);
3898 printf("\t%10d DFlushEntry\n", cmp->callInfo.C_DFlushEntry);
3899 printf("\t%10d DVOffset\n", cmp->callInfo.C_DVOffset);
3900 printf("\t%10d DZap\n", cmp->callInfo.C_DZap);
3901 printf("\t%10d DNew\n", cmp->callInfo.C_DNew);
3902 printf("\t%10d afs_RemoveVCB\n", cmp->callInfo.C_afs_RemoveVCB);
3903 printf("\t%10d afs_NewVCache\n", cmp->callInfo.C_afs_NewVCache);
3904 printf("\t%10d afs_FlushActiveVcaches\n",
3905 cmp->callInfo.C_afs_FlushActiveVcaches);
3906 printf("\t%10d afs_VerifyVCache\n", cmp->callInfo.C_afs_VerifyVCache);
3907 printf("\t%10d afs_WriteVCache\n", cmp->callInfo.C_afs_WriteVCache);
3908 printf("\t%10d afs_GetVCache\n", cmp->callInfo.C_afs_GetVCache);
3909 printf("\t%10d afs_StuffVcache\n", cmp->callInfo.C_afs_StuffVcache);
3910 printf("\t%10d afs_FindVCache\n", cmp->callInfo.C_afs_FindVCache);
3911 printf("\t%10d afs_PutDCache\n", cmp->callInfo.C_afs_PutDCache);
3912 printf("\t%10d afs_PutVCache\n", cmp->callInfo.C_afs_PutVCache);
3913 printf("\t%10d CacheStoreProc\n", cmp->callInfo.C_CacheStoreProc);
3914 printf("\t%10d afs_FindDcache\n", cmp->callInfo.C_afs_FindDCache);
3915 printf("\t%10d afs_TryToSmush\n", cmp->callInfo.C_afs_TryToSmush);
3916 printf("\t%10d afs_AdjustSize\n", cmp->callInfo.C_afs_AdjustSize);
3917 printf("\t%10d afs_CheckSize\n", cmp->callInfo.C_afs_CheckSize);
3918 printf("\t%10d afs_StoreWarn\n", cmp->callInfo.C_afs_StoreWarn);
3919 printf("\t%10d CacheFetchProc\n", cmp->callInfo.C_CacheFetchProc);
3920 printf("\t%10d UFS_CacheStoreProc\n", cmp->callInfo.C_UFS_CacheStoreProc);
3921 printf("\t%10d UFS_CacheFetchProc\n", cmp->callInfo.C_UFS_CacheFetchProc);
3922 printf("\t%10d afs_GetDCache\n", cmp->callInfo.C_afs_GetDCache);
3923 printf("\t%10d afs_SimpleVStat\n", cmp->callInfo.C_afs_SimpleVStat);
3924 printf("\t%10d afs_ProcessFS\n", cmp->callInfo.C_afs_ProcessFS);
3925 printf("\t%10d afs_InitCacheInfo\n", cmp->callInfo.C_afs_InitCacheInfo);
3926 printf("\t%10d afs_InitVolumeInfo\n", cmp->callInfo.C_afs_InitVolumeInfo);
3927 printf("\t%10d afs_InitCacheFile\n", cmp->callInfo.C_afs_InitCacheFile);
3928 printf("\t%10d afs_CacheInit\n", cmp->callInfo.C_afs_CacheInit);
3929 printf("\t%10d afs_GetDSlot\n", cmp->callInfo.C_afs_GetDSlot);
3930 printf("\t%10d afs_WriteThroughDSlots\n",
3931 cmp->callInfo.C_afs_WriteThroughDSlots);
3932 printf("\t%10d afs_MemGetDSlot\n", cmp->callInfo.C_afs_MemGetDSlot);
3933 printf("\t%10d afs_UFSGetDSlot\n", cmp->callInfo.C_afs_UFSGetDSlot);
3934 printf("\t%10d afs_StoreDCache\n", cmp->callInfo.C_afs_StoreDCache);
3935 printf("\t%10d afs_StoreMini\n", cmp->callInfo.C_afs_StoreMini);
3936 printf("\t%10d afs_StoreAllSegments\n",
3937 cmp->callInfo.C_afs_StoreAllSegments);
3938 printf("\t%10d afs_InvalidateAllSegments\n",
3939 cmp->callInfo.C_afs_InvalidateAllSegments);
3940 printf("\t%10d afs_TruncateAllSegments\n",
3941 cmp->callInfo.C_afs_TruncateAllSegments);
3942 printf("\t%10d afs_CheckVolSync\n", cmp->callInfo.C_afs_CheckVolSync);
3943 printf("\t%10d afs_wakeup\n", cmp->callInfo.C_afs_wakeup);
3944 printf("\t%10d afs_CFileOpen\n", cmp->callInfo.C_afs_CFileOpen);
3945 printf("\t%10d afs_CFileTruncate\n", cmp->callInfo.C_afs_CFileTruncate);
3946 printf("\t%10d afs_GetDownD\n", cmp->callInfo.C_afs_GetDownD);
3947 printf("\t%10d afs_WriteDCache\n", cmp->callInfo.C_afs_WriteDCache);
3948 printf("\t%10d afs_FlushDCache\n", cmp->callInfo.C_afs_FlushDCache);
3949 printf("\t%10d afs_GetDownDSlot\n", cmp->callInfo.C_afs_GetDownDSlot);
3950 printf("\t%10d afs_FlushVCache\n", cmp->callInfo.C_afs_FlushVCache);
3951 printf("\t%10d afs_GetDownV\n", cmp->callInfo.C_afs_GetDownV);
3952 printf("\t%10d afs_QueueVCB\n", cmp->callInfo.C_afs_QueueVCB);
3953 printf("\t%10d afs_call\n", cmp->callInfo.C_afs_call);
3954 printf("\t%10d afs_syscall_call\n", cmp->callInfo.C_afs_syscall_call);
3955 printf("\t%10d afs_syscall_icreate\n",
3956 cmp->callInfo.C_afs_syscall_icreate);
3957 printf("\t%10d afs_syscall_iopen\n", cmp->callInfo.C_afs_syscall_iopen);
3958 printf("\t%10d afs_syscall_iincdec\n",
3959 cmp->callInfo.C_afs_syscall_iincdec);
3960 printf("\t%10d afs_syscall_ireadwrite\n",
3961 cmp->callInfo.C_afs_syscall_ireadwrite);
3962 printf("\t%10d afs_syscall\n", cmp->callInfo.C_afs_syscall);
3963 printf("\t%10d lpioctl\n", cmp->callInfo.C_lpioctl);
3964 printf("\t%10d lsetpag\n", cmp->callInfo.C_lsetpag);
3965 printf("\t%10d afs_CheckInit\n", cmp->callInfo.C_afs_CheckInit);
3966 printf("\t%10d ClearCallback\n", cmp->callInfo.C_ClearCallBack);
3967 printf("\t%10d SRXAFSCB_GetCE\n", cmp->callInfo.C_SRXAFSCB_GetCE);
3968 printf("\t%10d SRXAFSCB_GetLock\n", cmp->callInfo.C_SRXAFSCB_GetLock);
3969 printf("\t%10d SRXAFSCB_CallBack\n", cmp->callInfo.C_SRXAFSCB_CallBack);
3970 printf("\t%10d SRXAFSCB_InitCallBackState\n",
3971 cmp->callInfo.C_SRXAFSCB_InitCallBackState);
3972 printf("\t%10d SRXAFSCB_Probe\n", cmp->callInfo.C_SRXAFSCB_Probe);
3973 printf("\t%10d afs_Chunk\n", cmp->callInfo.C_afs_Chunk);
3974 printf("\t%10d afs_ChunkBase\n", cmp->callInfo.C_afs_ChunkBase);
3975 printf("\t%10d afs_ChunkOffset\n", cmp->callInfo.C_afs_ChunkOffset);
3976 printf("\t%10d afs_ChunkSize\n", cmp->callInfo.C_afs_ChunkSize);
3977 printf("\t%10d afs_ChunkToBase\n", cmp->callInfo.C_afs_ChunkToBase);
3978 printf("\t%10d afs_ChunkToSize\n", cmp->callInfo.C_afs_ChunkToSize);
3979 printf("\t%10d afs_SetChunkSize\n", cmp->callInfo.C_afs_SetChunkSize);
3980 printf("\t%10d afs_config\n", cmp->callInfo.C_afs_config);
3981 printf("\t%10d mem_freebytes\n", cmp->callInfo.C_mem_freebytes);
3982 printf("\t%10d mem_getbytes\n", cmp->callInfo.C_mem_getbytes);
3983 printf("\t%10d afs_Daemon\n", cmp->callInfo.C_afs_Daemon);
3984 printf("\t%10d afs_CheckRootVolume\n",
3985 cmp->callInfo.C_afs_CheckRootVolume);
3986 printf("\t%10d BPath\n", cmp->callInfo.C_BPath);
3987 printf("\t%10d BPrefetch\n", cmp->callInfo.C_BPrefetch);
3988 printf("\t%10d BStore\n", cmp->callInfo.C_BStore);
3989 printf("\t%10d afs_BBusy\n", cmp->callInfo.C_afs_BBusy);
3990 printf("\t%10d afs_BQueue\n", cmp->callInfo.C_afs_BQueue);
3991 printf("\t%10d afs_BRelease\n", cmp->callInfo.C_afs_BRelease);
3992 printf("\t%10d afs_BackgroundDaemon\n",
3993 cmp->callInfo.C_afs_BackgroundDaemon);
3994 printf("\t%10d exporter_add\n", cmp->callInfo.C_exporter_add);
3995 printf("\t%10d exporter_find\n", cmp->callInfo.C_exporter_find);
3996 printf("\t%10d afs_gfs_kalloc\n", cmp->callInfo.C_afs_gfs_kalloc);
3997 printf("\t%10d afs_gfs_kfree\n", cmp->callInfo.C_afs_gfs_kfree);
3998 printf("\t%10d gop_lookupname\n", cmp->callInfo.C_gop_lookupname);
3999 printf("\t%10d afs_uniqtime\n", cmp->callInfo.C_afs_uniqtime);
4000 printf("\t%10d gfs_vattr_null\n", cmp->callInfo.C_gfs_vattr_null);
4001 printf("\t%10d afs_lock\n", cmp->callInfo.C_afs_lock);
4002 printf("\t%10d afs_unlock\n", cmp->callInfo.C_afs_unlock);
4003 printf("\t%10d afs_update\n", cmp->callInfo.C_afs_update);
4004 printf("\t%10d afs_gclose\n", cmp->callInfo.C_afs_gclose);
4005 printf("\t%10d afs_gopen\n", cmp->callInfo.C_afs_gopen);
4006 printf("\t%10d afs_greadlink\n", cmp->callInfo.C_afs_greadlink);
4007 printf("\t%10d afs_select\n", cmp->callInfo.C_afs_select);
4008 printf("\t%10d afs_gbmap\n", cmp->callInfo.C_afs_gbmap);
4009 printf("\t%10d afs_getfsdata\n", cmp->callInfo.C_afs_getfsdata);
4010 printf("\t%10d afs_gsymlink\n", cmp->callInfo.C_afs_gsymlink);
4011 printf("\t%10d afs_namei\n", cmp->callInfo.C_afs_namei);
4012 printf("\t%10d afs_gmount\n", cmp->callInfo.C_afs_gmount);
4013 printf("\t%10d afs_gget\n", cmp->callInfo.C_afs_gget);
4014 printf("\t%10d afs_glink\n", cmp->callInfo.C_afs_glink);
4015 printf("\t%10d afs_gmkdir\n", cmp->callInfo.C_afs_gmkdir);
4016 printf("\t%10d afs_unlink\n", cmp->callInfo.C_afs_unlink);
4017 printf("\t%10d afs_grmdir\n", cmp->callInfo.C_afs_grmdir);
4018 printf("\t%10d afs_makenode\n", cmp->callInfo.C_afs_makenode);
4019 printf("\t%10d afs_grename\n", cmp->callInfo.C_afs_grename);
4020 printf("\t%10d afs_rele\n", cmp->callInfo.C_afs_rele);
4021 printf("\t%10d afs_syncgp\n", cmp->callInfo.C_afs_syncgp);
4022 printf("\t%10d afs_getval\n", cmp->callInfo.C_afs_getval);
4023 printf("\t%10d afs_trunc\n", cmp->callInfo.C_afs_trunc);
4024 printf("\t%10d afs_rwgp\n", cmp->callInfo.C_afs_rwgp);
4025 printf("\t%10d afs_stat\n", cmp->callInfo.C_afs_stat);
4026 printf("\t%10d afsc_link\n", cmp->callInfo.C_afsc_link);
4027 printf("\t%10d afs_vfs_mount\n", cmp->callInfo.C_afs_vfs_mount);
4028 printf("\t%10d afs_uniqtime\n", cmp->callInfo.C_afs_uniqtime);
4029 printf("\t%10d iopen\n", cmp->callInfo.C_iopen);
4030 printf("\t%10d idec\n", cmp->callInfo.C_idec);
4031 printf("\t%10d iinc\n", cmp->callInfo.C_iinc);
4032 printf("\t%10d ireadwrite\n", cmp->callInfo.C_ireadwrite);
4033 printf("\t%10d iread\n", cmp->callInfo.C_iread);
4034 printf("\t%10d iwrite\n", cmp->callInfo.C_iwrite);
4035 printf("\t%10d iforget\n", cmp->callInfo.C_iforget);
4036 printf("\t%10d icreate\n", cmp->callInfo.C_icreate);
4037 printf("\t%10d igetinode\n", cmp->callInfo.C_igetinode);
4038 printf("\t%10d osi_SleepR\n", cmp->callInfo.C_osi_SleepR);
4039 printf("\t%10d osi_SleepS\n", cmp->callInfo.C_osi_SleepS);
4040 printf("\t%10d osi_SleepW\n", cmp->callInfo.C_osi_SleepW);
4041 printf("\t%10d osi_Sleep\n", cmp->callInfo.C_osi_Sleep);
4042 printf("\t%10d afs_LookupMCE\n", cmp->callInfo.C_afs_LookupMCE);
4043 printf("\t%10d afs_MemReadBlk\n", cmp->callInfo.C_afs_MemReadBlk);
4044 printf("\t%10d afs_MemReadUIO\n", cmp->callInfo.C_afs_MemReadUIO);
4045 printf("\t%10d afs_MemWriteBlk\n", cmp->callInfo.C_afs_MemWriteBlk);
4046 printf("\t%10d afs_MemWriteUIO\n", cmp->callInfo.C_afs_MemWriteUIO);
4047 printf("\t%10d afs_MemCacheStoreProc\n",
4048 cmp->callInfo.C_afs_MemCacheStoreProc);
4049 printf("\t%10d afs_MemCacheFetchProc\n",
4050 cmp->callInfo.C_afs_MemCacheFetchProc);
4051 printf("\t%10d afs_MemCacheTruncate\n",
4052 cmp->callInfo.C_afs_MemCacheTruncate);
4053 printf("\t%10d afs_MemCacheStoreProc\n",
4054 cmp->callInfo.C_afs_MemCacheStoreProc);
4055 printf("\t%10d afs_GetNfsClientPag\n",
4056 cmp->callInfo.C_afs_GetNfsClientPag);
4057 printf("\t%10d afs_FindNfsClientPag\n",
4058 cmp->callInfo.C_afs_FindNfsClientPag);
4059 printf("\t%10d afs_PutNfsClientPag\n",
4060 cmp->callInfo.C_afs_PutNfsClientPag);
4061 printf("\t%10d afs_nfsclient_reqhandler\n",
4062 cmp->callInfo.C_afs_nfsclient_reqhandler);
4063 printf("\t%10d afs_nfsclient_GC\n", cmp->callInfo.C_afs_nfsclient_GC);
4064 printf("\t%10d afs_nfsclient_hold\n", cmp->callInfo.C_afs_nfsclient_hold);
4065 printf("\t%10d afs_nfsclient_stats\n",
4066 cmp->callInfo.C_afs_nfsclient_stats);
4067 printf("\t%10d afs_nfsclient_sysname\n",
4068 cmp->callInfo.C_afs_nfsclient_sysname);
4069 printf("\t%10d afs_rfs_dispatch\n", cmp->callInfo.C_afs_rfs_dispatch);
4070 printf("\t%10d afs_nfs2afscall\n", cmp->callInfo.C_Nfs2AfsCall);
4071 printf("\t%10d afs_sun_xuntext\n", cmp->callInfo.C_afs_sun_xuntext);
4072 printf("\t%10d osi_Active\n", cmp->callInfo.C_osi_Active);
4073 printf("\t%10d osi_FlushPages\n", cmp->callInfo.C_osi_FlushPages);
4074 printf("\t%10d osi_FlushText\n", cmp->callInfo.C_osi_FlushText);
4075 printf("\t%10d osi_CallProc\n", cmp->callInfo.C_osi_CallProc);
4076 printf("\t%10d osi_CancelProc\n", cmp->callInfo.C_osi_CancelProc);
4077 printf("\t%10d osi_Invisible\n", cmp->callInfo.C_osi_Invisible);
4078 printf("\t%10d osi_Time\n", cmp->callInfo.C_osi_Time);
4079 printf("\t%10d osi_Alloc\n", cmp->callInfo.C_osi_Alloc);
4080 printf("\t%10d osi_SetTime\n", cmp->callInfo.C_osi_SetTime);
4081 printf("\t%10d osi_Dump\n", cmp->callInfo.C_osi_Dump);
4082 printf("\t%10d osi_Free\n", cmp->callInfo.C_osi_Free);
4083 printf("\t%10d osi_UFSOpen\n", cmp->callInfo.C_osi_UFSOpen);
4084 printf("\t%10d osi_Close\n", cmp->callInfo.C_osi_Close);
4085 printf("\t%10d osi_Stat\n", cmp->callInfo.C_osi_Stat);
4086 printf("\t%10d osi_Truncate\n", cmp->callInfo.C_osi_Truncate);
4087 printf("\t%10d osi_Read\n", cmp->callInfo.C_osi_Read);
4088 printf("\t%10d osi_Write\n", cmp->callInfo.C_osi_Write);
4089 printf("\t%10d osi_MapStrategy\n", cmp->callInfo.C_osi_MapStrategy);
4090 printf("\t%10d osi_AllocLargeSpace\n",
4091 cmp->callInfo.C_osi_AllocLargeSpace);
4092 printf("\t%10d osi_FreeLargeSpace\n", cmp->callInfo.C_osi_FreeLargeSpace);
4093 printf("\t%10d osi_AllocSmallSpace\n",
4094 cmp->callInfo.C_osi_AllocSmallSpace);
4095 printf("\t%10d osi_FreeSmallSpace\n", cmp->callInfo.C_osi_FreeSmallSpace);
4096 printf("\t%10d osi_CloseToTheEdge\n", cmp->callInfo.C_osi_CloseToTheEdge);
4097 printf("\t%10d osi_xgreedy\n", cmp->callInfo.C_osi_xgreedy);
4098 printf("\t%10d osi_FreeSocket\n", cmp->callInfo.C_osi_FreeSocket);
4099 printf("\t%10d osi_NewSocket\n", cmp->callInfo.C_osi_NewSocket);
4100 printf("\t%10d osi_NetSend\n", cmp->callInfo.C_osi_NetSend);
4101 printf("\t%10d WaitHack\n", cmp->callInfo.C_WaitHack);
4102 printf("\t%10d osi_CancelWait\n", cmp->callInfo.C_osi_CancelWait);
4103 printf("\t%10d osi_Wakeup\n", cmp->callInfo.C_osi_Wakeup);
4104 printf("\t%10d osi_Wait\n", cmp->callInfo.C_osi_Wait);
4105 printf("\t%10d dirp_Read\n", cmp->callInfo.C_dirp_Read);
4106 printf("\t%10d dirp_Cpy\n", cmp->callInfo.C_dirp_Cpy);
4107 printf("\t%10d dirp_Eq\n", cmp->callInfo.C_dirp_Eq);
4108 printf("\t%10d dirp_Write\n", cmp->callInfo.C_dirp_Write);
4109 printf("\t%10d dirp_Zap\n", cmp->callInfo.C_dirp_Zap);
4110 printf("\t%10d afs_ioctl\n", cmp->callInfo.C_afs_ioctl);
4111 printf("\t%10d handleIoctl\n", cmp->callInfo.C_HandleIoctl);
4112 printf("\t%10d afs_xioctl\n", cmp->callInfo.C_afs_xioctl);
4113 printf("\t%10d afs_pioctl\n", cmp->callInfo.C_afs_pioctl);
4114 printf("\t%10d HandlePioctl\n", cmp->callInfo.C_HandlePioctl);
4115 printf("\t%10d PGetVolumeStatus\n", cmp->callInfo.C_PGetVolumeStatus);
4116 printf("\t%10d PSetVolumeStatus\n", cmp->callInfo.C_PSetVolumeStatus);
4117 printf("\t%10d PFlush\n", cmp->callInfo.C_PFlush);
4118 printf("\t%10d PFlushVolumeData\n", cmp->callInfo.C_PFlushVolumeData);
4119 printf("\t%10d PNewStatMount\n", cmp->callInfo.C_PNewStatMount);
4120 printf("\t%10d PGetTokens\n", cmp->callInfo.C_PGetTokens);
4121 printf("\t%10d PSetTokens\n", cmp->callInfo.C_PSetTokens);
4122 printf("\t%10d PUnlog\n", cmp->callInfo.C_PUnlog);
4123 printf("\t%10d PCheckServers\n", cmp->callInfo.C_PCheckServers);
4124 printf("\t%10d PCheckAuth\n", cmp->callInfo.C_PCheckAuth);
4125 printf("\t%10d PCheckVolNames\n", cmp->callInfo.C_PCheckVolNames);
4126 printf("\t%10d PFindVolume\n", cmp->callInfo.C_PFindVolume);
4127 printf("\t%10d Prefetch\n", cmp->callInfo.C_Prefetch);
4128 printf("\t%10d PGetCacheSize\n", cmp->callInfo.C_PGetCacheSize);
4129 printf("\t%10d PSetCacheSize\n", cmp->callInfo.C_PSetCacheSize);
4130 printf("\t%10d PSetSysName\n", cmp->callInfo.C_PSetSysName);
4131 printf("\t%10d PExportAfs\n", cmp->callInfo.C_PExportAfs);
4132 printf("\t%10d HandleClientContext\n",
4133 cmp->callInfo.C_HandleClientContext);
4134 printf("\t%10d PViceAccess\n", cmp->callInfo.C_PViceAccess);
4135 printf("\t%10d PRemoveCallBack\n", cmp->callInfo.C_PRemoveCallBack);
4136 printf("\t%10d PRemoveMount\n", cmp->callInfo.C_PRemoveMount);
4137 printf("\t%10d PSetVolumeStatus\n", cmp->callInfo.C_PSetVolumeStatus);
4138 printf("\t%10d PListCells\n", cmp->callInfo.C_PListCells);
4139 printf("\t%10d PNewCell\n", cmp->callInfo.C_PNewCell);
4140 printf("\t%10d PGetUserCell\n", cmp->callInfo.C_PGetUserCell);
4141 printf("\t%10d PGetCellStatus\n", cmp->callInfo.C_PGetCellStatus);
4142 printf("\t%10d PSetCellStatus\n", cmp->callInfo.C_PSetCellStatus);
4143 printf("\t%10d PVenusLogging\n", cmp->callInfo.C_PVenusLogging);
4144 printf("\t%10d PGetAcl\n", cmp->callInfo.C_PGetAcl);
4145 printf("\t%10d PGetFID\n", cmp->callInfo.C_PGetFID);
4146 printf("\t%10d PSetAcl\n", cmp->callInfo.C_PSetAcl);
4147 printf("\t%10d PGetFileCell\n", cmp->callInfo.C_PGetFileCell);
4148 printf("\t%10d PGetWSCell\n", cmp->callInfo.C_PGetWSCell);
4149 printf("\t%10d PGetSPrefs\n", cmp->callInfo.C_PGetSPrefs);
4150 printf("\t%10d PSetSPrefs\n", cmp->callInfo.C_PSetSPrefs);
4151 printf("\t%10d afs_ResetAccessCache\n",
4152 cmp->callInfo.C_afs_ResetAccessCache);
4153 printf("\t%10d afs_FindUser\n", cmp->callInfo.C_afs_FindUser);
4154 printf("\t%10d afs_GetUser\n", cmp->callInfo.C_afs_GetUser);
4155 printf("\t%10d afs_GCUserData\n", cmp->callInfo.C_afs_GCUserData);
4156 printf("\t%10d afs_PutUser\n", cmp->callInfo.C_afs_PutUser);
4157 printf("\t%10d afs_SetPrimary\n", cmp->callInfo.C_afs_SetPrimary);
4158 printf("\t%10d afs_ResetUserConns\n", cmp->callInfo.C_afs_ResetUserConns);
4159 printf("\t%10d afs_RemoveUserConns\n", cmp->callInfo.C_RemoveUserConns);
4160 printf("\t%10d afs_ResourceInit\n", cmp->callInfo.C_afs_ResourceInit);
4161 printf("\t%10d afs_GetCell\n", cmp->callInfo.C_afs_GetCell);
4162 printf("\t%10d afs_GetCellByIndex\n", cmp->callInfo.C_afs_GetCellByIndex);
4163 printf("\t%10d afs_GetCellByName\n", cmp->callInfo.C_afs_GetCellByName);
4164 printf("\t%10d afs_GetRealCellByIndex\n",
4165 cmp->callInfo.C_afs_GetRealCellByIndex);
4166 printf("\t%10d afs_NewCell\n", cmp->callInfo.C_afs_NewCell);
4167 printf("\t%10d CheckVLDB\n", cmp->callInfo.C_CheckVLDB);
4168 printf("\t%10d afs_GetVolume\n", cmp->callInfo.C_afs_GetVolume);
4169 printf("\t%10d afs_PutVolume\n", cmp->callInfo.C_afs_PutVolume);
4170 printf("\t%10d afs_GetVolumeByName\n",
4171 cmp->callInfo.C_afs_GetVolumeByName);
4172 printf("\t%10d afs_random\n", cmp->callInfo.C_afs_random);
4173 printf("\t%10d InstallVolumeEntry\n", cmp->callInfo.C_InstallVolumeEntry);
4174 printf("\t%10d InstallVolumeInfo\n", cmp->callInfo.C_InstallVolumeInfo);
4175 printf("\t%10d afs_ResetVolumeInfo\n",
4176 cmp->callInfo.C_afs_ResetVolumeInfo);
4177 printf("\t%10d afs_FindServer\n", cmp->callInfo.C_afs_FindServer);
4178 printf("\t%10d afs_GetServer\n", cmp->callInfo.C_afs_GetServer);
4179 printf("\t%10d afs_SortServers\n", cmp->callInfo.C_afs_SortServers);
4180 printf("\t%10d afs_CheckServers\n", cmp->callInfo.C_afs_CheckServers);
4181 printf("\t%10d ServerDown\n", cmp->callInfo.C_ServerDown);
4182 printf("\t%10d afs_Conn\n", cmp->callInfo.C_afs_Conn);
4183 printf("\t%10d afs_PutConn\n", cmp->callInfo.C_afs_PutConn);
4184 printf("\t%10d afs_ConnByHost\n", cmp->callInfo.C_afs_ConnByHost);
4185 printf("\t%10d afs_ConnByMHosts\n", cmp->callInfo.C_afs_ConnByMHosts);
4186 printf("\t%10d afs_Analyze\n", cmp->callInfo.C_afs_Analyze);
4187 printf("\t%10d CheckVLServer\n", cmp->callInfo.C_CheckVLServer);
4188 printf("\t%10d afs_CheckCacheResets\n",
4189 cmp->callInfo.C_afs_CheckCacheResets);
4190 printf("\t%10d afs_CheckVolumeNames\n",
4191 cmp->callInfo.C_afs_CheckVolumeNames);
4192 printf("\t%10d afs_CheckCode\n", cmp->callInfo.C_afs_CheckCode);
4193 printf("\t%10d afs_CopyError\n", cmp->callInfo.C_afs_CopyError);
4194 printf("\t%10d afs_FinalizeReq\n", cmp->callInfo.C_afs_FinalizeReq);
4195 printf("\t%10d afs_GetVolCache\n", cmp->callInfo.C_afs_GetVolCache);
4196 printf("\t%10d afs_GetVolSlot\n", cmp->callInfo.C_afs_GetVolSlot);
4197 printf("\t%10d afs_UFSGetVolSlot\n", cmp->callInfo.C_afs_UFSGetVolSlot);
4198 printf("\t%10d afs_MemGetVolSlot\n", cmp->callInfo.C_afs_MemGetVolSlot);
4199 printf("\t%10d afs_WriteVolCache\n", cmp->callInfo.C_afs_WriteVolCache);
4200 printf("\t%10d haveCallbacksfrom\n", cmp->callInfo.C_HaveCallBacksFrom);
4201 printf("\t%10d afs_getpage\n", cmp->callInfo.C_afs_getpage);
4202 printf("\t%10d afs_putpage\n", cmp->callInfo.C_afs_putpage);
4203 printf("\t%10d afs_nfsrdwr\n", cmp->callInfo.C_afs_nfsrdwr);
4204 printf("\t%10d afs_map\n", cmp->callInfo.C_afs_map);
4205 printf("\t%10d afs_cmp\n", cmp->callInfo.C_afs_cmp);
4206 printf("\t%10d afs_PageLeft\n", cmp->callInfo.C_afs_PageLeft);
4207 printf("\t%10d afs_mount\n", cmp->callInfo.C_afs_mount);
4208 printf("\t%10d afs_unmount\n", cmp->callInfo.C_afs_unmount);
4209 printf("\t%10d afs_root\n", cmp->callInfo.C_afs_root);
4210 printf("\t%10d afs_statfs\n", cmp->callInfo.C_afs_statfs);
4211 printf("\t%10d afs_sync\n", cmp->callInfo.C_afs_sync);
4212 printf("\t%10d afs_vget\n", cmp->callInfo.C_afs_vget);
4213 printf("\t%10d afs_index\n", cmp->callInfo.C_afs_index);
4214 printf("\t%10d afs_setpag\n", cmp->callInfo.C_afs_setpag);
4215 printf("\t%10d genpag\n", cmp->callInfo.C_genpag);
4216 printf("\t%10d getpag\n", cmp->callInfo.C_getpag);
4217 printf("\t%10d genpag\n", cmp->callInfo.C_genpag);
4218 printf("\t%10d afs_GetMariner\n", cmp->callInfo.C_afs_GetMariner);
4219 printf("\t%10d afs_AddMarinerName\n", cmp->callInfo.C_afs_AddMarinerName);
4220 printf("\t%10d afs_open\n", cmp->callInfo.C_afs_open);
4221 printf("\t%10d afs_close\n", cmp->callInfo.C_afs_close);
4222 printf("\t%10d afs_closex\n", cmp->callInfo.C_afs_closex);
4223 printf("\t%10d afs_write\n", cmp->callInfo.C_afs_write);
4224 printf("\t%10d afs_UFSwrite\n", cmp->callInfo.C_afs_UFSWrite);
4225 printf("\t%10d afs_Memwrite\n", cmp->callInfo.C_afs_MemWrite);
4226 printf("\t%10d afs_rdwr\n", cmp->callInfo.C_afs_rdwr);
4227 printf("\t%10d afs_read\n", cmp->callInfo.C_afs_read);
4228 printf("\t%10d afs_UFSread\n", cmp->callInfo.C_afs_UFSRead);
4229 printf("\t%10d afs_Memread\n", cmp->callInfo.C_afs_MemRead);
4230 printf("\t%10d afs_CopyOutAttrs\n", cmp->callInfo.C_afs_CopyOutAttrs);
4231 printf("\t%10d afs_access\n", cmp->callInfo.C_afs_access);
4232 printf("\t%10d afs_getattr\n", cmp->callInfo.C_afs_getattr);
4233 printf("\t%10d afs_setattr\n", cmp->callInfo.C_afs_setattr);
4234 printf("\t%10d afs_VAttrToAS\n", cmp->callInfo.C_afs_VAttrToAS);
4235 printf("\t%10d EvalMountPoint\n", cmp->callInfo.C_EvalMountPoint);
4236 printf("\t%10d afs_lookup\n", cmp->callInfo.C_afs_lookup);
4237 printf("\t%10d afs_create\n", cmp->callInfo.C_afs_create);
4238 printf("\t%10d afs_LocalHero\n", cmp->callInfo.C_afs_LocalHero);
4239 printf("\t%10d afs_remove\n", cmp->callInfo.C_afs_remove);
4240 printf("\t%10d afs_link\n", cmp->callInfo.C_afs_link);
4241 printf("\t%10d afs_rename\n", cmp->callInfo.C_afs_rename);
4242 printf("\t%10d afs_InitReq\n", cmp->callInfo.C_afs_InitReq);
4243 printf("\t%10d afs_mkdir\n", cmp->callInfo.C_afs_mkdir);
4244 printf("\t%10d afs_rmdir\n", cmp->callInfo.C_afs_rmdir);
4245 printf("\t%10d afs_readdir\n", cmp->callInfo.C_afs_readdir);
4246 printf("\t%10d afs_read1dir\n", cmp->callInfo.C_afs_read1dir);
4247 printf("\t%10d afs_readdir_move\n", cmp->callInfo.C_afs_readdir_move);
4248 printf("\t%10d afs_readdir_iter\n", cmp->callInfo.C_afs_readdir_iter);
4249 printf("\t%10d afs_symlink\n", cmp->callInfo.C_afs_symlink);
4250 printf("\t%10d afs_HandleLink\n", cmp->callInfo.C_afs_HandleLink);
4251 printf("\t%10d afs_MemHandleLink\n", cmp->callInfo.C_afs_MemHandleLink);
4252 printf("\t%10d afs_UFSHandleLink\n", cmp->callInfo.C_afs_UFSHandleLink);
4253 printf("\t%10d HandleFlock\n", cmp->callInfo.C_HandleFlock);
4254 printf("\t%10d afs_readlink\n", cmp->callInfo.C_afs_readlink);
4255 printf("\t%10d afs_fsync\n", cmp->callInfo.C_afs_fsync);
4256 printf("\t%10d afs_inactive\n", cmp->callInfo.C_afs_inactive);
4257 printf("\t%10d afs_ustrategy\n", cmp->callInfo.C_afs_ustrategy);
4258 printf("\t%10d afs_strategy\n", cmp->callInfo.C_afs_strategy);
4259 printf("\t%10d afs_bread\n", cmp->callInfo.C_afs_bread);
4260 printf("\t%10d afs_brelse\n", cmp->callInfo.C_afs_brelse);
4261 printf("\t%10d afs_bmap\n", cmp->callInfo.C_afs_bmap);
4262 printf("\t%10d afs_fid\n", cmp->callInfo.C_afs_fid);
4263 printf("\t%10d afs_FakeOpen\n", cmp->callInfo.C_afs_FakeOpen);
4264 printf("\t%10d afs_FakeClose\n", cmp->callInfo.C_afs_FakeClose);
4265 printf("\t%10d afs_StoreOnLastReference\n",
4266 cmp->callInfo.C_afs_StoreOnLastReference);
4267 printf("\t%10d afs_AccessOK\n", cmp->callInfo.C_afs_AccessOK);
4268 printf("\t%10d afs_GetAccessBits\n", cmp->callInfo.C_afs_GetAccessBits);
4269 printf("\t%10d afsio_copy\n", cmp->callInfo.C_afsio_copy);
4270 printf("\t%10d afsio_trim\n", cmp->callInfo.C_afsio_trim);
4271 printf("\t%10d afsio_skip\n", cmp->callInfo.C_afsio_skip);
4272 printf("\t%10d afs_page_read\n", cmp->callInfo.C_afs_page_read);
4273 printf("\t%10d afs_page_write\n", cmp->callInfo.C_afs_page_write);
4274 printf("\t%10d afs_page_read\n", cmp->callInfo.C_afs_page_read);
4275 printf("\t%10d afs_get_groups_from_pag\n",
4276 cmp->callInfo.C_afs_get_groups_from_pag);
4277 printf("\t%10d afs_get_pag_from_groups\n",
4278 cmp->callInfo.C_afs_get_pag_from_groups);
4279 printf("\t%10d AddPag\n", cmp->callInfo.C_AddPag);
4280 printf("\t%10d PagInCred\n", cmp->callInfo.C_PagInCred);
4281 printf("\t%10d afs_getgroups\n", cmp->callInfo.C_afs_getgroups);
4282 printf("\t%10d afs_page_in\n", cmp->callInfo.C_afs_page_in);
4283 printf("\t%10d afs_page_out\n", cmp->callInfo.C_afs_page_out);
4284 printf("\t%10d afs_AdvanceFD\n", cmp->callInfo.C_afs_AdvanceFD);
4285 printf("\t%10d afs_lockf\n", cmp->callInfo.C_afs_lockf);
4286 printf("\t%10d afs_xsetgroups\n", cmp->callInfo.C_afs_xsetgroups);
4287 printf("\t%10d afs_nlinks\n", cmp->callInfo.C_afs_nlinks);
4288 printf("\t%10d afs_lockctl\n", cmp->callInfo.C_afs_lockctl);
4289 printf("\t%10d afs_xflock\n", cmp->callInfo.C_afs_xflock);
4290 printf("\t%10d PGetCPrefs\n", cmp->callInfo.C_PGetCPrefs);
4291 printf("\t%10d PSetCPrefs\n", cmp->callInfo.C_PSetCPrefs);
4293 printf("\t%10d afs_pagein\n", cmp->callInfo.C_afs_pagein);
4294 printf("\t%10d afs_pageout\n", cmp->callInfo.C_afs_pageout);
4295 printf("\t%10d afs_hp_strategy\n", cmp->callInfo.C_afs_hp_strategy);
4301 #define OffsetOf(s,mem) ((long)(&(((s *)0)->mem)))
4302 #define SizeOf(s,mem) ((long)sizeof(((s *)0)->mem))
4303 #define values(s,mem) OffsetOf(s,mem), SizeOf(s,mem)
4305 print_struct_vcache_offsets()
4307 printf("struct vcache.v offset = %ld, size = %ld\n",
4308 values(struct vcache, v));
4309 printf("struct vcache.vlruq offset = %ld, size = %ld\n",
4310 values(struct vcache, vlruq));
4311 printf("struct vcache.nextfree offset = %ld, size = %ld\n",
4312 values(struct vcache, nextfree));
4313 printf("struct vcache.hnext offset = %ld, size = %ld\n",
4314 values(struct vcache, hnext));
4315 printf("struct vcache.fid offset = %ld, size = %ld\n",
4316 values(struct vcache, fid));
4317 printf("struct vcache.m offset = %ld, size = %ld\n",
4318 values(struct vcache, m));
4319 printf("struct vcache.lock offset = %ld, size = %ld\n",
4320 values(struct vcache, lock));
4321 printf("struct vcache.parentVnode offset = %ld, size = %ld\n",
4322 values(struct vcache, parentVnode));
4323 printf("struct vcache.parentUnique offset = %ld, size = %ld\n",
4324 values(struct vcache, parentUnique));
4325 printf("struct vcache.mvid offset = %ld, size = %ld\n",
4326 values(struct vcache, mvid));
4327 printf("struct vcache.linkData offset = %ld, size = %ld\n",
4328 values(struct vcache, linkData));
4329 printf("struct vcache.flushDV offset = %ld, size = %ld\n",
4330 values(struct vcache, flushDV));
4331 printf("struct vcache.mapDV offset = %ld, size = %ld\n",
4332 values(struct vcache, mapDV));
4333 printf("struct vcache.truncPos offset = %ld, size = %ld\n",
4334 values(struct vcache, truncPos));
4335 printf("struct vcache.callback offset = %ld, size = %ld\n",
4336 values(struct vcache, callback));
4337 printf("struct vcache.cbExpires offset = %ld, size = %ld\n",
4338 values(struct vcache, cbExpires));
4339 printf("struct vcache.callsort offset = %ld, size = %ld\n",
4340 values(struct vcache, callsort));
4341 printf("struct vcache.Access offset = %ld, size = %ld\n",
4342 values(struct vcache, Access));
4343 printf("struct vcache.anyAccess offset = %ld, size = %ld\n",
4344 values(struct vcache, anyAccess));
4345 printf("struct vcache.last_looker offset = %ld, size = %ld\n",
4346 values(struct vcache, last_looker));
4347 printf("struct vcache.activeV offset = %ld, size = %ld\n",
4348 values(struct vcache, activeV));
4349 printf("struct vcache.slocks offset = %ld, size = %ld\n",
4350 values(struct vcache, slocks));
4351 printf("struct vcache.opens offset = %ld, size = %ld\n",
4352 values(struct vcache, opens));
4353 printf("struct vcache.execsOrWriters offset = %ld, size = %ld\n",
4354 values(struct vcache, execsOrWriters));
4355 printf("struct vcache.flockCount offset = %ld, size = %ld\n",
4356 values(struct vcache, flockCount));
4357 printf("struct vcache.mvstat offset = %ld, size = %ld\n",
4358 values(struct vcache, mvstat));
4359 printf("struct vcache.states offset = %ld, size = %ld\n",
4360 values(struct vcache, states));
4361 printf("struct vcache.quick offset = %ld, size = %ld\n",
4362 values(struct vcache, quick));
4363 printf("struct vcache.symhintstamp offset = %ld, size = %ld\n",
4364 values(struct vcache, symhintstamp));
4365 printf("struct vcache.h1 offset = %ld, size = %ld\n",
4366 values(struct vcache, h1));
4367 printf("struct vcache.lastr offset = %ld, size = %ld\n",
4368 values(struct vcache, lastr));
4369 printf("struct vcache.vc_rwlockid offset = %ld, size = %ld\n",
4370 values(struct vcache, vc_rwlockid));
4371 printf("struct vcache.vc_locktrips offset = %ld, size = %ld\n",
4372 values(struct vcache, vc_locktrips));
4373 printf("struct vcache.vc_rwlock offset = %ld, size = %ld\n",
4374 values(struct vcache, vc_rwlock));
4375 printf("struct vcache.mapcnt offset = %ld, size = %ld\n",
4376 values(struct vcache, mapcnt));
4377 printf("struct vcache.cred offset = %ld, size = %ld\n",
4378 values(struct vcache, cred));
4379 printf("struct vcache.vc_bhv_desc offset = %ld, size = %ld\n",
4380 values(struct vcache, vc_bhv_desc));
4381 printf("struct vcache.vc_error offset = %ld, size = %ld\n",
4382 values(struct vcache, vc_error));
4383 printf("struct vcache.xlatordv offset = %ld, size = %ld\n",
4384 values(struct vcache, xlatordv));
4385 printf("struct vcache.uncred offset = %ld, size = %ld\n",
4386 values(struct vcache, uncred));
4387 printf("struct vcache.asynchrony offset = %ld, size = %ld\n",
4388 values(struct vcache, asynchrony));
4391 print_struct_vnode_offsets()
4393 printf("struct vnode.v_list offset = %ld, size = %ld\n",
4394 values(struct vnode, v_list));
4395 printf("struct vnode.v_flag offset = %ld, size = %ld\n",
4396 values(struct vnode, v_flag));
4397 printf("struct vnode.v_count offset = %ld, size = %ld\n",
4398 values(struct vnode, v_count));
4399 printf("struct vnode.v_listid offset = %ld, size = %ld\n",
4400 values(struct vnode, v_listid));
4401 printf("struct vnode.v_intpcount offset = %ld, size = %ld\n",
4402 values(struct vnode, v_intpcount));
4403 printf("struct vnode.v_type offset = %ld, size = %ld\n",
4404 values(struct vnode, v_type));
4405 printf("struct vnode.v_rdev offset = %ld, size = %ld\n",
4406 values(struct vnode, v_rdev));
4407 printf("struct vnode.v_vfsmountedhere offset = %ld, size = %ld\n",
4408 values(struct vnode, v_vfsmountedhere));
4409 printf("struct vnode.v_vfsp offset = %ld, size = %ld\n",
4410 values(struct vnode, v_vfsp));
4411 printf("struct vnode.v_stream offset = %ld, size = %ld\n",
4412 values(struct vnode, v_stream));
4413 printf("struct vnode.v_filocks offset = %ld, size = %ld\n",
4414 values(struct vnode, v_filocks));
4415 printf("struct vnode.v_filocksem offset = %ld, size = %ld\n",
4416 values(struct vnode, v_filocksem));
4417 printf("struct vnode.v_number offset = %ld, size = %ld\n",
4418 values(struct vnode, v_number));
4419 printf("struct vnode.v_bh offset = %ld, size = %ld\n",
4420 values(struct vnode, v_bh));
4421 printf("struct vnode.v_namecap offset = %ld, size = %ld\n",
4422 values(struct vnode, v_namecap));
4423 printf("struct vnode.v_hashp offset = %ld, size = %ld\n",
4424 values(struct vnode, v_hashp));
4425 printf("struct vnode.v_hashn offset = %ld, size = %ld\n",
4426 values(struct vnode, v_hashn));
4427 printf("struct vnode.v_mreg offset = %ld, size = %ld\n",
4428 values(struct vnode, v_mreg));
4429 printf("struct vnode.v_mregb offset = %ld, size = %ld\n",
4430 values(struct vnode, v_mregb));
4431 printf("struct vnode.v_pgcnt offset = %ld, size = %ld\n",
4432 values(struct vnode, v_pgcnt));
4433 printf("struct vnode.v_dpages offset = %ld, size = %ld\n",
4434 values(struct vnode, v_dpages));
4435 printf("struct vnode.v_dpages_gen offset = %ld, size = %ld\n",
4436 values(struct vnode, v_dpages_gen));
4437 printf("struct vnode.v_dbuf offset = %ld, size = %ld\n",
4438 values(struct vnode, v_dbuf));
4439 printf("struct vnode.v_buf offset = %ld, size = %ld\n",
4440 values(struct vnode, v_buf));
4441 printf("struct vnode.v_bufgen offset = %ld, size = %ld\n",
4442 values(struct vnode, v_bufgen));
4443 printf("struct vnode.v_traceix offset = %ld, size = %ld\n",
4444 values(struct vnode, v_traceix));
4445 printf("struct vnode.v_buf_lock offset = %ld, size = %ld\n",
4446 values(struct vnode, v_buf_lock));
4447 printf("struct vnode.v_pc offset = %ld, size = %ld\n",
4448 values(struct vnode, v_pc));
4449 #ifdef VNODE_TRACING
4450 printf("struct vnode.v_trace offset = %ld, size = %ld\n",
4451 values(struct vnode, v_trace));
4454 printf("struct vnode.v_ckpt offset = %ld, size = %ld\n",
4455 values(struct vnode, v_ckpt));