50c49568356869e6dbc16b6c4ddc009e2fb4c9ca
[openafs.git] / src / xstat / xstat_cm_test.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /*
11  * Description:
12  *      Test of the xstat_cm module.
13  *
14  *------------------------------------------------------------------------*/
15
16 #include <afsconfig.h>
17 #include <afs/param.h>
18
19 #include <roken.h>
20
21 #include "xstat_cm.h"           /*Interface for xstat_cm module */
22 #include <afs/cmd.h>            /*Command line interpreter */
23 #include <afs/afsutil.h>
24
25 /*
26  * Command line parameter indices.
27  *      P_CM_NAMES : List of CacheManager names.
28  *      P_COLL_IDS : List of collection IDs to pick up.
29  *      P_ONESHOT  : Are we gathering exactly one round of data?
30  *      P_DEBUG    : Enable debugging output?
31  */
32 #define P_CM_NAMES      0
33 #define P_COLL_IDS      1
34 #define P_ONESHOT       2
35 #define P_FREQUENCY     3
36 #define P_PERIOD        4
37 #define P_DEBUG         5
38
39 /*
40  * Private globals.
41  */
42 static int debugging_on = 0;    /*Are we debugging? */
43 static int one_shot = 0;        /*Single round of data collection? */
44
45 static char *fsOpNames[] = {
46     "FetchData",
47     "FetchACL",
48     "FetchStatus",
49     "StoreData",
50     "StoreACL",
51     "StoreStatus",
52     "RemoveFile",
53     "CreateFile",
54     "Rename",
55     "Symlink",
56     "Link",
57     "MakeDir",
58     "RemoveDir",
59     "SetLock",
60     "ExtendLock",
61     "ReleaseLock",
62     "GetStatistics",
63     "GiveUpCallbacks",
64     "GetVolumeInfo",
65     "GetVolumeStatus",
66     "SetVolumeStatus",
67     "GetRootVolume",
68     "CheckToken",
69     "GetTime",
70     "NGetVolumeInfo",
71     "BulkStatus",
72     "XStatsVersion",
73     "GetXStats",
74     "XLookup"
75 };
76
77 static char *cmOpNames[] = {
78     "CallBack",
79     "InitCallBackState",
80     "Probe",
81     "GetLock",
82     "GetCE",
83     "XStatsVersion",
84     "GetXStats"
85 };
86
87 static char *xferOpNames[] = {
88     "FetchData",
89     "StoreData"
90 };
91
92
93 /*------------------------------------------------------------------------
94  * PrintCallInfo
95  *
96  * Description:
97  *      Print out the AFSCB_XSTATSCOLL_PERF_INFO collection we just
98  *      received.
99  *
100  * Arguments:
101  *      None.
102  *
103  * Returns:
104  *      Nothing.
105  *
106  * Environment:
107  *      All the info we need is nestled into xstat_cm_Results.
108  *
109  * Side Effects:
110  *      As advertised.
111  *------------------------------------------------------------------------*/
112
113 void
114 PrintCallInfo(void)
115 {                               /*PrintCallInfo */
116
117     int i;              /*Loop variable */
118     int numInt32s;              /*# int32words returned */
119     afs_int32 *currInt32;       /*Ptr to current afs_int32 value */
120     char *printableTime;        /*Ptr to printable time string */
121     time_t probeTime = xstat_cm_Results.probeTime;
122     /*
123      * Just print out the results of the particular probe.
124      */
125     numInt32s = xstat_cm_Results.data.AFSCB_CollData_len;
126     currInt32 = (afs_int32 *) (xstat_cm_Results.data.AFSCB_CollData_val);
127     printableTime = ctime(&probeTime);
128     printableTime[strlen(printableTime) - 1] = '\0';
129
130     printf
131         ("AFSCB_XSTATSCOLL_CALL_INFO (coll %d) for CM %s\n[Poll %u, %s]\n\n",
132          xstat_cm_Results.collectionNumber, xstat_cm_Results.connP->hostName,
133          xstat_cm_Results.probeNum, printableTime);
134
135     if (debugging_on)
136         printf("\n[%u entries returned at %" AFS_PTR_FMT "]\n\n", numInt32s, currInt32);
137
138     for (i = 0; i < numInt32s; i++)
139         printf("%u ", *currInt32++);
140     printf("\n");
141
142
143 }                               /*PrintCallInfo */
144
145 /* Print detailed functional call statistics */
146
147 void
148 print_cmCallStats(void)
149 {
150     char *printableTime;        /*Ptr to printable time string */
151     struct afs_CMStats *cmp;
152     time_t probeTime = xstat_cm_Results.probeTime;
153
154     printableTime = ctime(&probeTime);
155     printableTime[strlen(printableTime) - 1] = '\0';
156
157     printf
158         ("AFSCB_XSTATSCOLL_CALL_INFO (coll %d) for CM %s\n[Probe %u, %s]\n\n",
159          xstat_cm_Results.collectionNumber, xstat_cm_Results.connP->hostName,
160          xstat_cm_Results.probeNum, printableTime);
161
162     cmp = (struct afs_CMStats *)(xstat_cm_Results.data.AFSCB_CollData_val);
163
164     if (xstat_cm_Results.data.AFSCB_CollData_len != sizeof(struct afs_CMStats))
165         printf("Data sets differ in size. Is cache manager a different version?");
166
167     printf("\t%10u afs_init\n", cmp->callInfo.C_afs_init);
168     printf("\t%10u gop_rdwr\n", cmp->callInfo.C_gop_rdwr);
169     printf("\t%10u aix_gnode_rele\n", cmp->callInfo.C_aix_gnode_rele);
170     printf("\t%10u gettimeofday\n", cmp->callInfo.C_gettimeofday);
171     printf("\t%10u m_cpytoc\n", cmp->callInfo.C_m_cpytoc);
172     printf("\t%10u aix_vattr_null\n", cmp->callInfo.C_aix_vattr_null);
173     printf("\t%10u afs_gn_ftrunc\n", cmp->callInfo.C_afs_gn_ftrunc);
174     printf("\t%10u afs_gn_rdwr\n", cmp->callInfo.C_afs_gn_rdwr);
175     printf("\t%10u afs_gn_ioctl\n", cmp->callInfo.C_afs_gn_ioctl);
176     printf("\t%10u afs_gn_locktl\n", cmp->callInfo.C_afs_gn_lockctl);
177     printf("\t%10u afs_gn_readlink\n", cmp->callInfo.C_afs_gn_readlink);
178     printf("\t%10u afs_gn_readdir\n", cmp->callInfo.C_afs_gn_readdir);
179     printf("\t%10u afs_gn_select\n", cmp->callInfo.C_afs_gn_select);
180     printf("\t%10u afs_gn_strategy\n", cmp->callInfo.C_afs_gn_strategy);
181     printf("\t%10u afs_gn_symlink\n", cmp->callInfo.C_afs_gn_symlink);
182     printf("\t%10u afs_gn_revoke\n", cmp->callInfo.C_afs_gn_revoke);
183     printf("\t%10u afs_gn_link\n", cmp->callInfo.C_afs_gn_link);
184     printf("\t%10u afs_gn_mkdir\n", cmp->callInfo.C_afs_gn_mkdir);
185     printf("\t%10u afs_gn_mknod\n", cmp->callInfo.C_afs_gn_mknod);
186     printf("\t%10u afs_gn_remove\n", cmp->callInfo.C_afs_gn_remove);
187     printf("\t%10u afs_gn_rename\n", cmp->callInfo.C_afs_gn_rename);
188     printf("\t%10u afs_gn_rmdir\n", cmp->callInfo.C_afs_gn_rmdir);
189     printf("\t%10u afs_gn_fid\n", cmp->callInfo.C_afs_gn_fid);
190     printf("\t%10u afs_gn_lookup\n", cmp->callInfo.C_afs_gn_lookup);
191     printf("\t%10u afs_gn_open\n", cmp->callInfo.C_afs_gn_open);
192     printf("\t%10u afs_gn_create\n", cmp->callInfo.C_afs_gn_create);
193     printf("\t%10u afs_gn_close\n", cmp->callInfo.C_afs_gn_close);
194     printf("\t%10u afs_gn_map\n", cmp->callInfo.C_afs_gn_map);
195     printf("\t%10u afs_gn_hold\n", cmp->callInfo.C_afs_gn_hold);
196     printf("\t%10u afs_gn_rele\n", cmp->callInfo.C_afs_gn_rele);
197     printf("\t%10u afs_gn_unmap\n", cmp->callInfo.C_afs_gn_unmap);
198     printf("\t%10u afs_gn_access\n", cmp->callInfo.C_afs_gn_access);
199     printf("\t%10u afs_gn_getattr\n", cmp->callInfo.C_afs_gn_getattr);
200     printf("\t%10u afs_gn_setattr\n", cmp->callInfo.C_afs_gn_setattr);
201     printf("\t%10u afs_gn_fclear\n", cmp->callInfo.C_afs_gn_fclear);
202     printf("\t%10u afs_gn_fsync\n", cmp->callInfo.C_afs_gn_fsync);
203     printf("\t%10u phash\n", cmp->callInfo.C_pHash);
204     printf("\t%10u DInit\n", cmp->callInfo.C_DInit);
205     printf("\t%10u DRead\n", cmp->callInfo.C_DRead);
206     printf("\t%10u FixupBucket\n", cmp->callInfo.C_FixupBucket);
207     printf("\t%10u afs_newslot\n", cmp->callInfo.C_afs_newslot);
208     printf("\t%10u DRelease\n", cmp->callInfo.C_DRelease);
209     printf("\t%10u DFlush\n", cmp->callInfo.C_DFlush);
210     printf("\t%10u DFlushEntry\n", cmp->callInfo.C_DFlushEntry);
211     printf("\t%10u DVOffset\n", cmp->callInfo.C_DVOffset);
212     printf("\t%10u DZap\n", cmp->callInfo.C_DZap);
213     printf("\t%10u shutdown_bufferpackage\n",
214            cmp->callInfo.C_shutdown_bufferpackage);
215     printf("\t%10u afs_CheckKnownBad\n", cmp->callInfo.C_afs_CheckKnownBad);
216     printf("\t%10u DNew\n", cmp->callInfo.C_DNew);
217     printf("\t%10u afs_RemoveVCB\n", cmp->callInfo.C_afs_RemoveVCB);
218     printf("\t%10u afs_NewVCache\n", cmp->callInfo.C_afs_NewVCache);
219     printf("\t%10u afs_FlushActiveVcaches\n",
220            cmp->callInfo.C_afs_FlushActiveVcaches);
221     printf("\t%10u afs_VerifyVCache\n", cmp->callInfo.C_afs_VerifyVCache);
222     printf("\t%10u afs_WriteVCache\n", cmp->callInfo.C_afs_WriteVCache);
223     printf("\t%10u afs_GetVCache\n", cmp->callInfo.C_afs_GetVCache);
224     printf("\t%10u afs_StuffVcache\n", cmp->callInfo.C_afs_StuffVcache);
225     printf("\t%10u afs_FindVCache\n", cmp->callInfo.C_afs_FindVCache);
226     printf("\t%10u afs_PutDCache\n", cmp->callInfo.C_afs_PutDCache);
227     printf("\t%10u afs_PutVCache\n", cmp->callInfo.C_afs_PutVCache);
228     printf("\t%10u CacheStoreProc\n", cmp->callInfo.C_CacheStoreProc);
229     printf("\t%10u afs_FindDcache\n", cmp->callInfo.C_afs_FindDCache);
230     printf("\t%10u afs_TryToSmush\n", cmp->callInfo.C_afs_TryToSmush);
231     printf("\t%10u afs_AdjustSize\n", cmp->callInfo.C_afs_AdjustSize);
232     printf("\t%10u afs_CheckSize\n", cmp->callInfo.C_afs_CheckSize);
233     printf("\t%10u afs_StoreWarn\n", cmp->callInfo.C_afs_StoreWarn);
234     printf("\t%10u CacheFetchProc\n", cmp->callInfo.C_CacheFetchProc);
235     printf("\t%10u UFS_CacheStoreProc\n", cmp->callInfo.C_UFS_CacheStoreProc);
236     printf("\t%10u UFS_CacheFetchProc\n", cmp->callInfo.C_UFS_CacheFetchProc);
237     printf("\t%10u afs_GetDCache\n", cmp->callInfo.C_afs_GetDCache);
238     printf("\t%10u afs_SimpleVStat\n", cmp->callInfo.C_afs_SimpleVStat);
239     printf("\t%10u afs_ProcessFS\n", cmp->callInfo.C_afs_ProcessFS);
240     printf("\t%10u afs_InitCacheInfo\n", cmp->callInfo.C_afs_InitCacheInfo);
241     printf("\t%10u afs_InitVolumeInfo\n", cmp->callInfo.C_afs_InitVolumeInfo);
242     printf("\t%10u afs_InitCacheFile\n", cmp->callInfo.C_afs_InitCacheFile);
243     printf("\t%10u afs_CacheInit\n", cmp->callInfo.C_afs_CacheInit);
244     printf("\t%10u afs_GetDSlot\n", cmp->callInfo.C_afs_GetDSlot);
245     printf("\t%10u afs_WriteThroughDSlots\n",
246            cmp->callInfo.C_afs_WriteThroughDSlots);
247     printf("\t%10u afs_MemGetDSlot\n", cmp->callInfo.C_afs_MemGetDSlot);
248     printf("\t%10u afs_UFSGetDSlot\n", cmp->callInfo.C_afs_UFSGetDSlot);
249     printf("\t%10u afs_StoreDCache\n", cmp->callInfo.C_afs_StoreDCache);
250     printf("\t%10u shutdown_cache\n", cmp->callInfo.C_shutdown_cache);
251     printf("\t%10u afs_StoreMini\n", cmp->callInfo.C_afs_StoreMini);
252     printf("\t%10u afs_StoreAllSegments\n",
253            cmp->callInfo.C_afs_StoreAllSegments);
254     printf("\t%10u afs_InvalidateAllSegments\n",
255            cmp->callInfo.C_afs_InvalidateAllSegments);
256     printf("\t%10u afs_TruncateAllSegments\n",
257            cmp->callInfo.C_afs_TruncateAllSegments);
258     printf("\t%10u afs_CheckVolSync\n", cmp->callInfo.C_afs_CheckVolSync);
259     printf("\t%10u afs_wakeup\n", cmp->callInfo.C_afs_wakeup);
260     printf("\t%10u afs_CFileOpen\n", cmp->callInfo.C_afs_CFileOpen);
261     printf("\t%10u afs_CFileTruncate\n", cmp->callInfo.C_afs_CFileTruncate);
262     printf("\t%10u afs_GetDownD\n", cmp->callInfo.C_afs_GetDownD);
263     printf("\t%10u afs_WriteDCache\n", cmp->callInfo.C_afs_WriteDCache);
264     printf("\t%10u afs_FlushDCache\n", cmp->callInfo.C_afs_FlushDCache);
265     printf("\t%10u afs_GetDownDSlot\n", cmp->callInfo.C_afs_GetDownDSlot);
266     printf("\t%10u afs_FlushVCache\n", cmp->callInfo.C_afs_FlushVCache);
267     printf("\t%10u afs_GetDownV\n", cmp->callInfo.C_afs_GetDownV);
268     printf("\t%10u afs_QueueVCB\n", cmp->callInfo.C_afs_QueueVCB);
269     printf("\t%10u afs_call\n", cmp->callInfo.C_afs_call);
270     printf("\t%10u syscall\n", cmp->callInfo.C_syscall);
271     printf("\t%10u afs_syscall_call\n", cmp->callInfo.C_afs_syscall_call);
272     printf("\t%10u afs_syscall_icreate\n",
273            cmp->callInfo.C_afs_syscall_icreate);
274     printf("\t%10u afs_syscall_iopen\n", cmp->callInfo.C_afs_syscall_iopen);
275     printf("\t%10u afs_syscall_iincdec\n",
276            cmp->callInfo.C_afs_syscall_iincdec);
277     printf("\t%10u iincdec\n", cmp->callInfo.C_iincdec);
278     printf("\t%10u afs_syscall_ireadwrite\n",
279            cmp->callInfo.C_afs_syscall_ireadwrite);
280     printf("\t%10u afs_syscall\n", cmp->callInfo.C_afs_syscall);
281     printf("\t%10u lpioctl\n", cmp->callInfo.C_lpioctl);
282     printf("\t%10u lsetpag\n", cmp->callInfo.C_lsetpag);
283     printf("\t%10u afs_shutdown\n", cmp->callInfo.C_afs_shutdown);
284     printf("\t%10u shutdown_BKG\n", cmp->callInfo.C_shutdown_BKG);
285     printf("\t%10u shutdown_afstest\n", cmp->callInfo.C_shutdown_afstest);
286     printf("\t%10u afs_CheckInit\n", cmp->callInfo.C_afs_CheckInit);
287     printf("\t%10u ClearCallback\n", cmp->callInfo.C_ClearCallBack);
288     printf("\t%10u SRXAFSCB_GetCE\n", cmp->callInfo.C_SRXAFSCB_GetCE);
289     printf("\t%10u SRXAFSCB_GetLock\n", cmp->callInfo.C_SRXAFSCB_GetLock);
290     printf("\t%10u SRXAFSCB_CallBack\n", cmp->callInfo.C_SRXAFSCB_CallBack);
291     printf("\t%10u SRXAFSCB_InitCallBackState\n",
292            cmp->callInfo.C_SRXAFSCB_InitCallBackState);
293     printf("\t%10u afs_RXCallBackServer\n",
294            cmp->callInfo.C_afs_RXCallBackServer);
295     printf("\t%10u shutdown_CB\n", cmp->callInfo.C_shutdown_CB);
296     printf("\t%10u SRXAFSCB_Probe\n", cmp->callInfo.C_SRXAFSCB_Probe);
297     printf("\t%10u afs_Chunk\n", cmp->callInfo.C_afs_Chunk);
298     printf("\t%10u afs_ChunkBase\n", cmp->callInfo.C_afs_ChunkBase);
299     printf("\t%10u afs_ChunkOffset\n", cmp->callInfo.C_afs_ChunkOffset);
300     printf("\t%10u afs_ChunkSize\n", cmp->callInfo.C_afs_ChunkSize);
301     printf("\t%10u afs_ChunkToBase\n", cmp->callInfo.C_afs_ChunkToBase);
302     printf("\t%10u afs_ChunkToSize\n", cmp->callInfo.C_afs_ChunkToSize);
303     printf("\t%10u afs_SetChunkSize\n", cmp->callInfo.C_afs_SetChunkSize);
304     printf("\t%10u afs_config\n", cmp->callInfo.C_afs_config);
305     printf("\t%10u mem_freebytes\n", cmp->callInfo.C_mem_freebytes);
306     printf("\t%10u fpalloc\n", cmp->callInfo.C_fpalloc);
307     printf("\t%10u kluge_init\n", cmp->callInfo.C_kluge_init);
308     printf("\t%10u ufdalloc\n", cmp->callInfo.C_ufdalloc);
309     printf("\t%10u ufdfree\n", cmp->callInfo.C_ufdfree);
310     printf("\t%10u commit\n", cmp->callInfo.C_commit);
311     printf("\t%10u dev_ialloc\n", cmp->callInfo.C_dev_ialloc);
312     printf("\t%10u ffree\n", cmp->callInfo.C_ffree);
313     printf("\t%10u iget\n", cmp->callInfo.C_iget);
314     printf("\t%10u iptovp\n", cmp->callInfo.C_iptovp);
315     printf("\t%10u ilock\n", cmp->callInfo.C_ilock);
316     printf("\t%10u irele\n", cmp->callInfo.C_irele);
317     printf("\t%10u iput\n", cmp->callInfo.C_iput);
318     printf("\t%10u mem_getbytes\n", cmp->callInfo.C_mem_getbytes);
319     printf("\t%10u afs_Daemon\n", cmp->callInfo.C_afs_Daemon);
320     printf("\t%10u afs_CheckRootVolume\n",
321            cmp->callInfo.C_afs_CheckRootVolume);
322     printf("\t%10u BPath\n", cmp->callInfo.C_BPath);
323     printf("\t%10u BPrefetch\n", cmp->callInfo.C_BPrefetch);
324     printf("\t%10u BStore\n", cmp->callInfo.C_BStore);
325     printf("\t%10u afs_BBusy\n", cmp->callInfo.C_afs_BBusy);
326     printf("\t%10u afs_BQueue\n", cmp->callInfo.C_afs_BQueue);
327     printf("\t%10u afs_BRelease\n", cmp->callInfo.C_afs_BRelease);
328     printf("\t%10u shutdown_daemons\n", cmp->callInfo.C_shutdown_daemons);
329     printf("\t%10u afs_BackgroundDaemon\n",
330            cmp->callInfo.C_afs_BackgroundDaemon);
331     printf("\t%10u exporter_add\n", cmp->callInfo.C_exporter_add);
332     printf("\t%10u exporter_find\n", cmp->callInfo.C_exporter_find);
333     printf("\t%10u IsAfsVnode\n", cmp->callInfo.C_IsAfsVnode);
334     printf("\t%10u SetAfsVnode\n", cmp->callInfo.C_SetAfsVnode);
335     printf("\t%10u afs_gfs_kalloc\n", cmp->callInfo.C_afs_gfs_kalloc);
336     printf("\t%10u afs_gfs_kfree\n", cmp->callInfo.C_afs_gfs_kfree);
337     printf("\t%10u gfsvop_getattr\n", cmp->callInfo.C_gfsvop_getattr);
338     printf("\t%10u gfsvop_rdwr\n", cmp->callInfo.C_gfsvop_rdwr);
339     printf("\t%10u gop_lookupname\n", cmp->callInfo.C_gop_lookupname);
340     printf("\t%10u afs_uniqtime\n", cmp->callInfo.C_afs_uniqtime);
341     printf("\t%10u gfs_vattr_null\n", cmp->callInfo.C_gfs_vattr_null);
342     printf("\t%10u afs_lock\n", cmp->callInfo.C_afs_lock);
343     printf("\t%10u afs_unlock\n", cmp->callInfo.C_afs_unlock);
344     printf("\t%10u afs_update\n", cmp->callInfo.C_afs_update);
345     printf("\t%10u afs_gclose\n", cmp->callInfo.C_afs_gclose);
346     printf("\t%10u afs_gopen\n", cmp->callInfo.C_afs_gopen);
347     printf("\t%10u afs_greadlink\n", cmp->callInfo.C_afs_greadlink);
348     printf("\t%10u afs_select\n", cmp->callInfo.C_afs_select);
349     printf("\t%10u afs_gbmap\n", cmp->callInfo.C_afs_gbmap);
350     printf("\t%10u afs_getfsdata\n", cmp->callInfo.C_afs_getfsdata);
351     printf("\t%10u afs_gsymlink\n", cmp->callInfo.C_afs_gsymlink);
352     printf("\t%10u printgnode\n", cmp->callInfo.C_printgnode);
353     printf("\t%10u HaveGFSLock\n", cmp->callInfo.C_HaveGFSLock);
354     printf("\t%10u afs_namei\n", cmp->callInfo.C_afs_namei);
355     printf("\t%10u AddGFSLock\n", cmp->callInfo.C_AddGFSLock);
356     printf("\t%10u RemoveGFSLock\n", cmp->callInfo.C_RemoveGFSLock);
357     printf("\t%10u afs_grlock\n", cmp->callInfo.C_afs_grlock);
358     printf("\t%10u afs_gumount\n", cmp->callInfo.C_afs_gumount);
359     printf("\t%10u afs_gmount\n", cmp->callInfo.C_afs_gmount);
360     printf("\t%10u afs_gget\n", cmp->callInfo.C_afs_gget);
361     printf("\t%10u afs_glink\n", cmp->callInfo.C_afs_glink);
362     printf("\t%10u afs_sbupdate\n", cmp->callInfo.C_afs_sbupdate);
363     printf("\t%10u afs_gmkdir\n", cmp->callInfo.C_afs_gmkdir);
364     printf("\t%10u afs_unlink\n", cmp->callInfo.C_afs_unlink);
365     printf("\t%10u afs_grmdir\n", cmp->callInfo.C_afs_grmdir);
366     printf("\t%10u afs_makenode\n", cmp->callInfo.C_afs_makenode);
367     printf("\t%10u afs_grename\n", cmp->callInfo.C_afs_grename);
368     printf("\t%10u afs_rele\n", cmp->callInfo.C_afs_rele);
369     printf("\t%10u afs_syncgp\n", cmp->callInfo.C_afs_syncgp);
370     printf("\t%10u afs_gfshack\n", cmp->callInfo.C_afs_gfshack);
371     printf("\t%10u afs_getval\n", cmp->callInfo.C_afs_getval);
372     printf("\t%10u afs_trunc\n", cmp->callInfo.C_afs_trunc);
373     printf("\t%10u afs_rwgp\n", cmp->callInfo.C_afs_rwgp);
374     printf("\t%10u afs_stat\n", cmp->callInfo.C_afs_stat);
375     printf("\t%10u hpsobind\n", cmp->callInfo.C_hpsobind);
376     printf("\t%10u hpsoclose\n", cmp->callInfo.C_hpsoclose);
377     printf("\t%10u hpsocreate\n", cmp->callInfo.C_hpsocreate);
378     printf("\t%10u hpsoreserve\n", cmp->callInfo.C_hpsoreserve);
379     printf("\t%10u afsc_link\n", cmp->callInfo.C_afsc_link);
380     printf("\t%10u devtovfs\n", cmp->callInfo.C_devtovfs);
381     printf("\t%10u afs_vfs_mount\n", cmp->callInfo.C_afs_vfs_mount);
382     printf("\t%10u afs_uniqtime\n", cmp->callInfo.C_afs_uniqtime);
383     printf("\t%10u iopen\n", cmp->callInfo.C_iopen);
384     printf("\t%10u idec\n", cmp->callInfo.C_idec);
385     printf("\t%10u iinc\n", cmp->callInfo.C_iinc);
386     printf("\t%10u oiread\n", cmp->callInfo.C_oiread);
387     printf("\t%10u AHash\n", cmp->callInfo.C_AHash);
388     printf("\t%10u QTOA\n", cmp->callInfo.C_QTOA);
389     printf("\t%10u afs_FindPartByDev\n", cmp->callInfo.C_afs_FindPartByDev);
390     printf("\t%10u aux_init\n", cmp->callInfo.C_aux_init);
391     printf("\t%10u afs_GetNewPart\n", cmp->callInfo.C_afs_GetNewPart);
392     printf("\t%10u afs_InitAuxVolFile\n",
393            cmp->callInfo.C_afs_InitAuxVolFile);
394     printf("\t%10u afs_CreateAuxEntry\n",
395            cmp->callInfo.C_afs_CreateAuxEntry);
396     printf("\t%10u afs_GetAuxSlot\n", cmp->callInfo.C_afs_GetAuxSlot);
397     printf("\t%10u afs_GetDownAux\n", cmp->callInfo.C_afs_GetDownAux);
398     printf("\t%10u afs_FlushAuxCache\n", cmp->callInfo.C_afs_FlushAuxCache);
399     printf("\t%10u afs_GetAuxInode\n", cmp->callInfo.C_afs_GetAuxInode);
400     printf("\t%10u afs_PutAuxInode\n", cmp->callInfo.C_afs_PutAuxInode);
401     printf("\t%10u afs_ReadAuxInode\n", cmp->callInfo.C_afs_ReadAuxInode);
402     printf("\t%10u afs_WriteAuxInode\n", cmp->callInfo.C_afs_WriteAuxInode);
403     printf("\t%10u afs_auxcall\n", cmp->callInfo.C_afs_auxcall);
404     printf("\t%10u tmpdbg_auxtbl\n", cmp->callInfo.C_tmpdbg_auxtbl);
405     printf("\t%10u tmpdbg_parttbl\n", cmp->callInfo.C_tmpdbg_parttbl);
406     printf("\t%10u ireadwrite\n", cmp->callInfo.C_ireadwrite);
407     printf("\t%10u iread\n", cmp->callInfo.C_iread);
408     printf("\t%10u getinode\n", cmp->callInfo.C_getinode);
409     printf("\t%10u trygetfs\n", cmp->callInfo.C_trygetfs);
410     printf("\t%10u iwrite\n", cmp->callInfo.C_iwrite);
411     printf("\t%10u iforget\n", cmp->callInfo.C_iforget);
412     printf("\t%10u Lock_Init\n", cmp->callInfo.C_Lock_Init);
413     printf("\t%10u Lock_Obtain\n", cmp->callInfo.C_Lock_Obtain);
414     printf("\t%10u Lock_ReleaseR\n", cmp->callInfo.C_Lock_ReleaseR);
415     printf("\t%10u Lock_ReleaseW\n", cmp->callInfo.C_Lock_ReleaseW);
416     printf("\t%10u afs_BozonLock\n", cmp->callInfo.C_afs_BozonLock);
417     printf("\t%10u afs_BozonUnlock\n", cmp->callInfo.C_afs_BozonUnlock);
418     printf("\t%10u icreate\n", cmp->callInfo.C_icreate);
419     printf("\t%10u igetinode\n", cmp->callInfo.C_igetinode);
420     printf("\t%10u osi_SleepR\n", cmp->callInfo.C_osi_SleepR);
421     printf("\t%10u osi_SleepS\n", cmp->callInfo.C_osi_SleepS);
422     printf("\t%10u osi_SleepW\n", cmp->callInfo.C_osi_SleepW);
423     printf("\t%10u afs_BozonInit\n", cmp->callInfo.C_afs_BozonInit);
424     printf("\t%10u afs_CheckBozonLock\n",
425            cmp->callInfo.C_afs_CheckBozonLock);
426     printf("\t%10u afs_CheckBozonLockBlocking\n",
427            cmp->callInfo.C_afs_CheckBozonLockBlocking);
428     printf("\t%10u xxxinit\n", cmp->callInfo.C_xxxinit);
429     printf("\t%10u KernelEntry\n", cmp->callInfo.C_KernelEntry);
430     printf("\t%10u afs_InitMemCache\n", cmp->callInfo.C_afs_InitMemCache);
431     printf("\t%10u osi_Sleep\n", cmp->callInfo.C_osi_Sleep);
432     printf("\t%10u afs_LookupMCE\n", cmp->callInfo.C_afs_LookupMCE);
433     printf("\t%10u afs_MemReadBlk\n", cmp->callInfo.C_afs_MemReadBlk);
434     printf("\t%10u afs_MemReadUIO\n", cmp->callInfo.C_afs_MemReadUIO);
435     printf("\t%10u afs_MemWriteBlk\n", cmp->callInfo.C_afs_MemWriteBlk);
436     printf("\t%10u afs_MemWriteUIO\n", cmp->callInfo.C_afs_MemWriteUIO);
437     printf("\t%10u afs_MemCacheStoreProc\n",
438            cmp->callInfo.C_afs_MemCacheStoreProc);
439     printf("\t%10u afs_vnode_pager_create\n",
440            cmp->callInfo.C_afs_vnode_pager_create);
441     printf("\t%10u next_KernelEntry\n", cmp->callInfo.C_next_KernelEntry);
442     printf("\t%10u afs_MemCacheFetchProc\n",
443            cmp->callInfo.C_afs_MemCacheFetchProc);
444     printf("\t%10u afs_MemCacheTruncate\n",
445            cmp->callInfo.C_afs_MemCacheTruncate);
446     printf("\t%10u afs_MemCacheStoreProc\n",
447            cmp->callInfo.C_afs_MemCacheStoreProc);
448     printf("\t%10u afs_GetNfsClientPag\n",
449            cmp->callInfo.C_afs_GetNfsClientPag);
450     printf("\t%10u afs_FindNfsClientPag\n",
451            cmp->callInfo.C_afs_FindNfsClientPag);
452     printf("\t%10u afs_PutNfsClientPag\n",
453            cmp->callInfo.C_afs_PutNfsClientPag);
454     printf("\t%10u afs_nfsclient_reqhandler\n",
455            cmp->callInfo.C_afs_nfsclient_reqhandler);
456     printf("\t%10u afs_nfsclient_GC\n", cmp->callInfo.C_afs_nfsclient_GC);
457     printf("\t%10u afs_nfsclient_hold\n", cmp->callInfo.C_afs_nfsclient_hold);
458     printf("\t%10u afs_nfsclient_stats\n",
459            cmp->callInfo.C_afs_nfsclient_stats);
460     printf("\t%10u afs_nfsclient_shutdown\n",
461            cmp->callInfo.C_afs_nfsclient_shutdown);
462     printf("\t%10u afs_rfs_readdir_fixup\n",
463            cmp->callInfo.C_afs_rfs_readdir_fixup);
464     printf("\t%10u afs_nfsclient_sysname\n",
465            cmp->callInfo.C_afs_nfsclient_sysname);
466     printf("\t%10u afs_xnfs_svc\n", cmp->callInfo.C_afs_xnfs_svc);
467     printf("\t%10u afs_xdr_putrddirres\n",
468            cmp->callInfo.C_afs_xdr_putrddirres);
469     printf("\t%10u afs_rfs_readdir\n", cmp->callInfo.C_afs_rfs_readdir);
470     printf("\t%10u afs_rfs_rddirfree\n", cmp->callInfo.C_afs_rfs_rddirfree);
471     printf("\t%10u rfs_dupcreate\n", cmp->callInfo.C_rfs_dupcreate);
472     printf("\t%10u rfs_dupsetattr\n", cmp->callInfo.C_rfs_dupsetattr);
473     printf("\t%10u afs_rfs_dispatch\n", cmp->callInfo.C_afs_rfs_dispatch);
474     printf("\t%10u afs_nfs2afscall\n", cmp->callInfo.C_Nfs2AfsCall);
475     printf("\t%10u afs_sun_xuntext\n", cmp->callInfo.C_afs_sun_xuntext);
476     printf("\t%10u osi_Active\n", cmp->callInfo.C_osi_Active);
477     printf("\t%10u osi_FlushPages\n", cmp->callInfo.C_osi_FlushPages);
478     printf("\t%10u osi_FlushText\n", cmp->callInfo.C_osi_FlushText);
479     printf("\t%10u osi_CallProc\n", cmp->callInfo.C_osi_CallProc);
480     printf("\t%10u osi_CancelProc\n", cmp->callInfo.C_osi_CancelProc);
481     printf("\t%10u osi_Invisible\n", cmp->callInfo.C_osi_Invisible);
482     printf("\t%10u osi_Time\n", cmp->callInfo.C_osi_Time);
483     printf("\t%10u osi_Alloc\n", cmp->callInfo.C_osi_Alloc);
484     printf("\t%10u osi_SetTime\n", cmp->callInfo.C_osi_SetTime);
485     printf("\t%10u osi_Dump\n", cmp->callInfo.C_osi_Dump);
486     printf("\t%10u shutdown_osi\n", cmp->callInfo.C_shutdown_osi);
487     printf("\t%10u osi_Free\n", cmp->callInfo.C_osi_Free);
488     printf("\t%10u osi_UFSOpen\n", cmp->callInfo.C_osi_UFSOpen);
489     printf("\t%10u osi_Close\n", cmp->callInfo.C_osi_Close);
490     printf("\t%10u osi_Stat\n", cmp->callInfo.C_osi_Stat);
491     printf("\t%10u osi_Truncate\n", cmp->callInfo.C_osi_Truncate);
492     printf("\t%10u osi_Read\n", cmp->callInfo.C_osi_Read);
493     printf("\t%10u osi_Write\n", cmp->callInfo.C_osi_Write);
494     printf("\t%10u shutdown_osifile\n", cmp->callInfo.C_shutdown_osifile);
495     printf("\t%10u osi_MapStrategy\n", cmp->callInfo.C_osi_MapStrategy);
496     printf("\t%10u osi_AllocLargeSpace\n",
497            cmp->callInfo.C_osi_AllocLargeSpace);
498     printf("\t%10u osi_FreeLargeSpace\n", cmp->callInfo.C_osi_FreeLargeSpace);
499     printf("\t%10u osi_AllocSmallSpace\n",
500            cmp->callInfo.C_osi_AllocSmallSpace);
501     printf("\t%10u pkt_iodone\n", cmp->callInfo.C_pkt_iodone);
502     printf("\t%10u shutdown_osinet\n", cmp->callInfo.C_shutdown_osinet);
503     printf("\t%10u afs_cs\n", cmp->callInfo.C_afs_cs);
504     printf("\t%10u osi_FreeSmallSpace\n", cmp->callInfo.C_osi_FreeSmallSpace);
505     printf("\t%10u osi_CloseToTheEdge\n", cmp->callInfo.C_osi_CloseToTheEdge);
506     printf("\t%10u osi_xgreedy\n", cmp->callInfo.C_osi_xgreedy);
507     printf("\t%10u osi_FreeSocket\n", cmp->callInfo.C_osi_FreeSocket);
508     printf("\t%10u trysblock\n", cmp->callInfo.C_trysblock);
509     printf("\t%10u osi_NewSocket\n", cmp->callInfo.C_osi_NewSocket);
510     printf("\t%10u osi_NetSend\n", cmp->callInfo.C_osi_NetSend);
511     printf("\t%10u WaitHack\n", cmp->callInfo.C_WaitHack);
512     printf("\t%10u osi_InitWaitHandle\n",
513            cmp->callInfo.C_osi_InitWaitHandle);
514     printf("\t%10u osi_CancelWait\n", cmp->callInfo.C_osi_CancelWait);
515     printf("\t%10u osi_Wakeup\n", cmp->callInfo.C_osi_Wakeup);
516     printf("\t%10u osi_Wait\n", cmp->callInfo.C_osi_Wait);
517     printf("\t%10u dirp_SetCacheDev\n", cmp->callInfo.C_dirp_SetCacheDev);
518     printf("\t%10u Die\n", cmp->callInfo.C_Die);
519     printf("\t%10u dirp_Read\n", cmp->callInfo.C_dirp_Read);
520     printf("\t%10u dirp_Cpy\n", cmp->callInfo.C_dirp_Cpy);
521     printf("\t%10u dirp_Eq\n", cmp->callInfo.C_dirp_Eq);
522     printf("\t%10u dirp_Write\n", cmp->callInfo.C_dirp_Write);
523     printf("\t%10u dirp_Zap\n", cmp->callInfo.C_dirp_Zap);
524     printf("\t%10u afs_ioctl\n", cmp->callInfo.C_afs_ioctl);
525     printf("\t%10u _AFSIOCTL\n", cmp->callInfo.C__AFSIOCTL);
526     printf("\t%10u _VALIDAFSIOCTL\n", cmp->callInfo.C__VALIDAFSIOCTL);
527     printf("\t%10u handleIoctl\n", cmp->callInfo.C_HandleIoctl);
528     printf("\t%10u afs_xioctl\n", cmp->callInfo.C_afs_xioctl);
529     printf("\t%10u afs_syscall_pioctl\n",
530            cmp->callInfo.C_afs_syscall_pioctl);
531     printf("\t%10u afs_pioctl\n", cmp->callInfo.C_afs_pioctl);
532     printf("\t%10u HandlePioctl\n", cmp->callInfo.C_HandlePioctl);
533     printf("\t%10u PGetVolumeStatus\n", cmp->callInfo.C_PGetVolumeStatus);
534     printf("\t%10u PSetVolumeStatus\n", cmp->callInfo.C_PSetVolumeStatus);
535     printf("\t%10u PFlush\n", cmp->callInfo.C_PFlush);
536     printf("\t%10u PFlushVolumeData\n", cmp->callInfo.C_PFlushVolumeData);
537     printf("\t%10u PNewStatMount\n", cmp->callInfo.C_PNewStatMount);
538     printf("\t%10u PGetTokens\n", cmp->callInfo.C_PGetTokens);
539     printf("\t%10u PSetTokens\n", cmp->callInfo.C_PSetTokens);
540     printf("\t%10u PUnlog\n", cmp->callInfo.C_PUnlog);
541     printf("\t%10u PMariner\n", cmp->callInfo.C_PMariner);
542     printf("\t%10u PCheckServers\n", cmp->callInfo.C_PCheckServers);
543     printf("\t%10u PCheckAuth\n", cmp->callInfo.C_PCheckAuth);
544     printf("\t%10u PCheckVolNames\n", cmp->callInfo.C_PCheckVolNames);
545     printf("\t%10u PFindVolume\n", cmp->callInfo.C_PFindVolume);
546     printf("\t%10u Prefetch\n", cmp->callInfo.C_Prefetch);
547     printf("\t%10u PGetCacheSize\n", cmp->callInfo.C_PGetCacheSize);
548     printf("\t%10u PSetCacheSize\n", cmp->callInfo.C_PSetCacheSize);
549     printf("\t%10u PSetSysName\n", cmp->callInfo.C_PSetSysName);
550     printf("\t%10u PExportAfs\n", cmp->callInfo.C_PExportAfs);
551     printf("\t%10u HandleClientContext\n",
552            cmp->callInfo.C_HandleClientContext);
553     printf("\t%10u PViceAccess\n", cmp->callInfo.C_PViceAccess);
554     printf("\t%10u PRemoveCallBack\n", cmp->callInfo.C_PRemoveCallBack);
555     printf("\t%10u PRemoveMount\n", cmp->callInfo.C_PRemoveMount);
556     printf("\t%10u PSetVolumeStatus\n", cmp->callInfo.C_PSetVolumeStatus);
557     printf("\t%10u PListCells\n", cmp->callInfo.C_PListCells);
558     printf("\t%10u PNewCell\n", cmp->callInfo.C_PNewCell);
559     printf("\t%10u PGetUserCell\n", cmp->callInfo.C_PGetUserCell);
560     printf("\t%10u PGetCellStatus\n", cmp->callInfo.C_PGetCellStatus);
561     printf("\t%10u PSetCellStatus\n", cmp->callInfo.C_PSetCellStatus);
562     printf("\t%10u PVenusLogging\n", cmp->callInfo.C_PVenusLogging);
563     printf("\t%10u PGetAcl\n", cmp->callInfo.C_PGetAcl);
564     printf("\t%10u PGetFID\n", cmp->callInfo.C_PGetFID);
565     printf("\t%10u PBogus\n", cmp->callInfo.C_PBogus);
566     printf("\t%10u PSetAcl\n", cmp->callInfo.C_PSetAcl);
567     printf("\t%10u PGetFileCell\n", cmp->callInfo.C_PGetFileCell);
568     printf("\t%10u PNoop\n", cmp->callInfo.C_PNoop);
569     printf("\t%10u PGetWSCell\n", cmp->callInfo.C_PGetWSCell);
570     printf("\t%10u afs_warn\n", cmp->callInfo.C_afs_warn);
571     printf("\t%10u afs_warnuser\n", cmp->callInfo.C_afs_warnuser);
572     printf("\t%10u PGetSPrefs\n", cmp->callInfo.C_PGetSPrefs);
573     printf("\t%10u PSetSPrefs\n", cmp->callInfo.C_PSetSPrefs);
574     printf("\t%10u afs_ResetAccessCache\n",
575            cmp->callInfo.C_afs_ResetAccessCache);
576     printf("\t%10u afs_FindUser\n", cmp->callInfo.C_afs_FindUser);
577     printf("\t%10u afs_GetUser\n", cmp->callInfo.C_afs_GetUser);
578     printf("\t%10u VSleep\n", cmp->callInfo.C_VSleep);
579     printf("\t%10u afs_GCUserData\n", cmp->callInfo.C_afs_GCUserData);
580     printf("\t%10u afs_PutUser\n", cmp->callInfo.C_afs_PutUser);
581     printf("\t%10u afs_SetPrimary\n", cmp->callInfo.C_afs_SetPrimary);
582     printf("\t%10u afs_ResetUserConns\n", cmp->callInfo.C_afs_ResetUserConns);
583     printf("\t%10u afs_MarinerLog\n", cmp->callInfo.C_afs_MarinerLog);
584     printf("\t%10u afs_vtoi\n", cmp->callInfo.C_afs_vtoi);
585     printf("\t%10u afs_RemoveUserConns\n", cmp->callInfo.C_RemoveUserConns);
586     printf("\t%10u afs_ResourceInit\n", cmp->callInfo.C_afs_ResourceInit);
587     printf("\t%10u afs_GetCell\n", cmp->callInfo.C_afs_GetCell);
588     printf("\t%10u afs_GetCellByIndex\n", cmp->callInfo.C_afs_GetCellByIndex);
589     printf("\t%10u afs_GetCellByName\n", cmp->callInfo.C_afs_GetCellByName);
590     printf("\t%10u afs_GetRealCellByIndex\n",
591            cmp->callInfo.C_afs_GetRealCellByIndex);
592     printf("\t%10u afs_NewCell\n", cmp->callInfo.C_afs_NewCell);
593     printf("\t%10u CheckVLDB\n", cmp->callInfo.C_CheckVLDB);
594     printf("\t%10u afs_GetVolume\n", cmp->callInfo.C_afs_GetVolume);
595     printf("\t%10u afs_PutVolume\n", cmp->callInfo.C_afs_PutVolume);
596     printf("\t%10u afs_GetVolumeByName\n",
597            cmp->callInfo.C_afs_GetVolumeByName);
598     printf("\t%10u ranstage\n", cmp->callInfo.C_ranstage);
599     printf("\t%10u afs_random\n", cmp->callInfo.C_afs_random);
600     printf("\t%10u InstallVolumeEntry\n", cmp->callInfo.C_InstallVolumeEntry);
601     printf("\t%10u InstallVolumeInfo\n", cmp->callInfo.C_InstallVolumeInfo);
602     printf("\t%10u StartLogFile\n", cmp->callInfo.C_StartLogFile);
603     printf("\t%10u afs_SetLogFile\n", cmp->callInfo.C_afs_SetLogFile);
604     printf("\t%10u EndLogFile\n", cmp->callInfo.C_EndLogFile);
605     printf("\t%10u afs_dp\n", cmp->callInfo.C_afs_dp);
606     printf("\t%10u fprf\n", cmp->callInfo.C_fprf);
607     printf("\t%10u fprint\n", cmp->callInfo.C_fprint);
608     printf("\t%10u fprintn\n", cmp->callInfo.C_fprintn);
609     printf("\t%10u afs_ResetVolumeInfo\n",
610            cmp->callInfo.C_afs_ResetVolumeInfo);
611     printf("\t%10u afs_FindServer\n", cmp->callInfo.C_afs_FindServer);
612     printf("\t%10u afs_GetServer\n", cmp->callInfo.C_afs_GetServer);
613     printf("\t%10u afs_SortServers\n", cmp->callInfo.C_afs_SortServers);
614     printf("\t%10u afs_AddToMean\n", cmp->callInfo.C_afs_AddToMean);
615     printf("\t%10u afs_GetCMStat\n", cmp->callInfo.C_afs_GetCMStat);
616     printf("\t%10u afs_CheckServers\n", cmp->callInfo.C_afs_CheckServers);
617     printf("\t%10u ServerDown\n", cmp->callInfo.C_ServerDown);
618     printf("\t%10u afs_Conn\n", cmp->callInfo.C_afs_Conn);
619     printf("\t%10u afs_PutConn\n", cmp->callInfo.C_afs_PutConn);
620     printf("\t%10u afs_ConnByHost\n", cmp->callInfo.C_afs_ConnByHost);
621     printf("\t%10u afs_ConnByMHosts\n", cmp->callInfo.C_afs_ConnByMHosts);
622     printf("\t%10u afs_Analyze\n", cmp->callInfo.C_afs_Analyze);
623     printf("\t%10u puttofile\n", cmp->callInfo.C_puttofile);
624     printf("\t%10u shutdown_AFS\n", cmp->callInfo.C_shutdown_AFS);
625     printf("\t%10u afs_CheckLocks\n", cmp->callInfo.C_afs_CheckLocks);
626     printf("\t%10u haveCallBacksFrom\n", cmp->callInfo.C_HaveCallBacksFrom);
627     printf("\t%10u CheckVLServer\n", cmp->callInfo.C_CheckVLServer);
628     printf("\t%10u afs_CheckCacheResets\n",
629            cmp->callInfo.C_afs_CheckCacheResets);
630     printf("\t%10u afs_CheckVolumeNames\n",
631            cmp->callInfo.C_afs_CheckVolumeNames);
632     printf("\t%10u afs_CheckCode\n", cmp->callInfo.C_afs_CheckCode);
633     printf("\t%10u afs_CopyError\n", cmp->callInfo.C_afs_CopyError);
634     printf("\t%10u afs_cv2string\n", cmp->callInfo.C_afs_cv2string);
635     printf("\t%10u afs_FindVolCache\n", cmp->callInfo.C_afs_FindVolCache);
636     printf("\t%10u afs_FinalizeReq\n", cmp->callInfo.C_afs_FinalizeReq);
637     printf("\t%10u afs_GetVolCache\n", cmp->callInfo.C_afs_GetVolCache);
638     printf("\t%10u afs_GetVolSlot\n", cmp->callInfo.C_afs_GetVolSlot);
639     printf("\t%10u afs_UFSGetVolSlot\n", cmp->callInfo.C_afs_UFSGetVolSlot);
640     printf("\t%10u print_internet_address\n",
641            cmp->callInfo.C_print_internet_address);
642     printf("\t%10u afs_MemGetVolSlot\n", cmp->callInfo.C_afs_MemGetVolSlot);
643     printf("\t%10u afs_WriteVolCache\n", cmp->callInfo.C_afs_WriteVolCache);
644     printf("\t%10u haveCallbacksfrom\n", cmp->callInfo.C_HaveCallBacksFrom);
645     printf("\t%10u afs_getpage\n", cmp->callInfo.C_afs_getpage);
646     printf("\t%10u afs_putpage\n", cmp->callInfo.C_afs_putpage);
647     printf("\t%10u afs_nfsrdwr\n", cmp->callInfo.C_afs_nfsrdwr);
648     printf("\t%10u afs_map\n", cmp->callInfo.C_afs_map);
649     printf("\t%10u afs_cntl\n", cmp->callInfo.C_afs_cntl);
650     printf("\t%10u afs_dump\n", cmp->callInfo.C_afs_dump);
651     printf("\t%10u afs_realvp\n", cmp->callInfo.C_afs_realvp);
652     printf("\t%10u afs_cmp\n", cmp->callInfo.C_afs_cmp);
653     printf("\t%10u afsinit\n", cmp->callInfo.C_afsinit);
654     printf("\t%10u afs_PageLeft\n", cmp->callInfo.C_afs_PageLeft);
655     printf("\t%10u afs_mount\n", cmp->callInfo.C_afs_mount);
656     printf("\t%10u afs_unmount\n", cmp->callInfo.C_afs_unmount);
657     printf("\t%10u afs_root\n", cmp->callInfo.C_afs_root);
658     printf("\t%10u afs_statfs\n", cmp->callInfo.C_afs_statfs);
659     printf("\t%10u afs_sync\n", cmp->callInfo.C_afs_sync);
660     printf("\t%10u afs_mountroot\n", cmp->callInfo.C_afs_mountroot);
661     printf("\t%10u afs_swapvp\n", cmp->callInfo.C_afs_swapvp);
662     printf("\t%10u afs_vget\n", cmp->callInfo.C_afs_vget);
663     printf("\t%10u afs_noop\n", cmp->callInfo.C_afs_noop);
664     printf("\t%10u afs_index\n", cmp->callInfo.C_afs_index);
665     printf("\t%10u afs_setpag\n", cmp->callInfo.C_afs_setpag);
666     printf("\t%10u genpag\n", cmp->callInfo.C_genpag);
667     printf("\t%10u getpag\n", cmp->callInfo.C_getpag);
668     printf("\t%10u genpag\n", cmp->callInfo.C_genpag);
669     printf("\t%10u afs_badop\n", cmp->callInfo.C_afs_badop);
670     printf("\t%10u afs_GetMariner\n", cmp->callInfo.C_afs_GetMariner);
671     printf("\t%10u afs_AddMarinerName\n", cmp->callInfo.C_afs_AddMarinerName);
672     printf("\t%10u afs_open\n", cmp->callInfo.C_afs_open);
673     printf("\t%10u afs_close\n", cmp->callInfo.C_afs_close);
674     printf("\t%10u afs_closex\n", cmp->callInfo.C_afs_closex);
675     printf("\t%10u afs_write\n", cmp->callInfo.C_afs_write);
676     printf("\t%10u afs_UFSwrite\n", cmp->callInfo.C_afs_UFSWrite);
677     printf("\t%10u afs_Memwrite\n", cmp->callInfo.C_afs_MemWrite);
678     printf("\t%10u afs_rdwr\n", cmp->callInfo.C_afs_rdwr);
679     printf("\t%10u FIXUPSTUPIDINODE\n", cmp->callInfo.C_FIXUPSTUPIDINODE);
680     printf("\t%10u afs_read\n", cmp->callInfo.C_afs_read);
681     printf("\t%10u afs_UFSread\n", cmp->callInfo.C_afs_UFSRead);
682     printf("\t%10u afs_Memread\n", cmp->callInfo.C_afs_MemRead);
683     printf("\t%10u afs_CopyOutAttrs\n", cmp->callInfo.C_afs_CopyOutAttrs);
684     printf("\t%10u ENameOK\n", cmp->callInfo.C_ENameOK);
685     printf("\t%10u HandleAtName\n", cmp->callInfo.C_HandleAtName);
686     printf("\t%10u getsysname\n", cmp->callInfo.C_getsysname);
687     printf("\t%10u strcat\n", cmp->callInfo.C_strcat);
688     printf("\t%10u afs_access\n", cmp->callInfo.C_afs_access);
689     printf("\t%10u afs_getattr\n", cmp->callInfo.C_afs_getattr);
690     printf("\t%10u afs_setattr\n", cmp->callInfo.C_afs_setattr);
691     printf("\t%10u afs_VAttrToAS\n", cmp->callInfo.C_afs_VAttrToAS);
692     printf("\t%10u EvalMountPoint\n", cmp->callInfo.C_EvalMountPoint);
693     printf("\t%10u afs_lookup\n", cmp->callInfo.C_afs_lookup);
694     printf("\t%10u afs_create\n", cmp->callInfo.C_afs_create);
695     printf("\t%10u FetchWholeEnchilada\n",
696            cmp->callInfo.C_FetchWholeEnchilada);
697     printf("\t%10u afs_LocalHero\n", cmp->callInfo.C_afs_LocalHero);
698     printf("\t%10u afs_remove\n", cmp->callInfo.C_afs_remove);
699     printf("\t%10u afs_link\n", cmp->callInfo.C_afs_link);
700     printf("\t%10u afs_rename\n", cmp->callInfo.C_afs_rename);
701     printf("\t%10u afs_InitReq\n", cmp->callInfo.C_afs_InitReq);
702     printf("\t%10u BlobScan\n", cmp->callInfo.C_BlobScan);
703     printf("\t%10u afs_mkdir\n", cmp->callInfo.C_afs_mkdir);
704     printf("\t%10u RecLen\n", cmp->callInfo.C_RecLen);
705     printf("\t%10u RoundToInt\n", cmp->callInfo.C_RoundToInt);
706     printf("\t%10u afs_readdir_with_offlist\n",
707            cmp->callInfo.C_afs_readdir_with_offlist);
708     printf("\t%10u DIRSIZ_LEN\n", cmp->callInfo.C_DIRSIZ_LEN);
709     printf("\t%10u afs_rmdir\n", cmp->callInfo.C_afs_rmdir);
710     printf("\t%10u afs_readdir\n", cmp->callInfo.C_afs_readdir);
711     printf("\t%10u afs_read1dir\n", cmp->callInfo.C_afs_read1dir);
712     printf("\t%10u afs_readdir_move\n", cmp->callInfo.C_afs_readdir_move);
713     printf("\t%10u afs_readdir_iter\n", cmp->callInfo.C_afs_readdir_iter);
714     printf("\t%10u afs_symlink\n", cmp->callInfo.C_afs_symlink);
715     printf("\t%10u afs_HandleLink\n", cmp->callInfo.C_afs_HandleLink);
716     printf("\t%10u afs_MemHandleLink\n", cmp->callInfo.C_afs_MemHandleLink);
717     printf("\t%10u afs_UFSHandleLink\n", cmp->callInfo.C_afs_UFSHandleLink);
718     printf("\t%10u HandleFlock\n", cmp->callInfo.C_HandleFlock);
719     printf("\t%10u afs_readlink\n", cmp->callInfo.C_afs_readlink);
720     printf("\t%10u afs_fsync\n", cmp->callInfo.C_afs_fsync);
721     printf("\t%10u afs_inactive\n", cmp->callInfo.C_afs_inactive);
722     printf("\t%10u afs_ustrategy\n", cmp->callInfo.C_afs_ustrategy);
723     printf("\t%10u afs_strategy\n", cmp->callInfo.C_afs_strategy);
724     printf("\t%10u afs_bread\n", cmp->callInfo.C_afs_bread);
725     printf("\t%10u afs_brelse\n", cmp->callInfo.C_afs_brelse);
726     printf("\t%10u afs_bmap\n", cmp->callInfo.C_afs_bmap);
727     printf("\t%10u afs_fid\n", cmp->callInfo.C_afs_fid);
728     printf("\t%10u afs_FakeOpen\n", cmp->callInfo.C_afs_FakeOpen);
729     printf("\t%10u afs_FakeClose\n", cmp->callInfo.C_afs_FakeClose);
730     printf("\t%10u afs_StoreOnLastReference\n",
731            cmp->callInfo.C_afs_StoreOnLastReference);
732     printf("\t%10u shutdown_vnodeops\n", cmp->callInfo.C_shutdown_vnodeops);
733     printf("\t%10u afs_AccessOK\n", cmp->callInfo.C_afs_AccessOK);
734     printf("\t%10u afs_GetAccessBits\n", cmp->callInfo.C_afs_GetAccessBits);
735     printf("\t%10u afsio_copy\n", cmp->callInfo.C_afsio_copy);
736     printf("\t%10u afsio_trim\n", cmp->callInfo.C_afsio_trim);
737     printf("\t%10u afsio_skip\n", cmp->callInfo.C_afsio_skip);
738     printf("\t%10u afs_page_read\n", cmp->callInfo.C_afs_page_read);
739     printf("\t%10u afs_page_write\n", cmp->callInfo.C_afs_page_write);
740     printf("\t%10u afs_page_read\n", cmp->callInfo.C_afs_page_read);
741     printf("\t%10u afs_get_groups_from_pag\n",
742            cmp->callInfo.C_afs_get_groups_from_pag);
743     printf("\t%10u afs_get_pag_from_groups\n",
744            cmp->callInfo.C_afs_get_pag_from_groups);
745     printf("\t%10u AddPag\n", cmp->callInfo.C_AddPag);
746     printf("\t%10u PagInCred\n", cmp->callInfo.C_PagInCred);
747     printf("\t%10u setpag\n", cmp->callInfo.C_setpag);
748     printf("\t%10u afs_setgroups\n", cmp->callInfo.C_afs_setgroups);
749     printf("\t%10u afs_getgroups\n", cmp->callInfo.C_afs_getgroups);
750     printf("\t%10u afs_page_in\n", cmp->callInfo.C_afs_page_in);
751     printf("\t%10u afs_page_out\n", cmp->callInfo.C_afs_page_out);
752     printf("\t%10u afs_AdvanceFD\n", cmp->callInfo.C_afs_AdvanceFD);
753     printf("\t%10u afs_lockf\n", cmp->callInfo.C_afs_lockf);
754     printf("\t%10u afs_xsetgroups\n", cmp->callInfo.C_afs_xsetgroups);
755     printf("\t%10u DoLockWarning\n", cmp->callInfo.C_DoLockWarning);
756     printf("\t%10u afs_nlinks\n", cmp->callInfo.C_afs_nlinks);
757     printf("\t%10u afs_lockctl\n", cmp->callInfo.C_afs_lockctl);
758     printf("\t%10u afs_xflock\n", cmp->callInfo.C_afs_xflock);
759     printf("\t%10u PGetCPrefs\n", cmp->callInfo.C_PGetCPrefs);
760     printf("\t%10u SRXAFSCB_WhoAreYou\n",
761            cmp->callInfo.C_SRXAFSCB_WhoAreYou);
762     printf("\t%10u afs_DiscardDCache\n", cmp->callInfo.C_afs_DiscardDCache);
763     printf("\t%10u afs_FreeDiscardedDCache\n",
764            cmp->callInfo.C_afs_FreeDiscardedDCache);
765     printf("\t%10u afs_MaybeFreeDiscardedDCache\n",
766            cmp->callInfo.C_afs_MaybeFreeDiscardedDCache);
767     printf("\t%10u PSetCPrefs\n", cmp->callInfo.C_PSetCPrefs);
768     printf("\t%10u afs_pagein\n", cmp->callInfo.C_afs_pagein);
769     printf("\t%10u afs_pageout\n", cmp->callInfo.C_afs_pageout);
770     printf("\t%10u afs_hp_strategy\n", cmp->callInfo.C_afs_hp_strategy);
771     printf("\t%10u PFlushMount\n", cmp->callInfo.C_PFlushMount);
772     printf("\t%10u SRXAFSCB_GetServerPrefs\n",
773            cmp->callInfo.C_SRXAFSCB_GetServerPrefs);
774     printf("\t%10u SRXAFSCB_GetCellServDB\n",
775            cmp->callInfo.C_SRXAFSCB_GetCellServDB);
776     printf("\t%10u SRXAFSCB_GetLocalCell\n",
777            cmp->callInfo.C_SRXAFSCB_GetLocalCell);
778     printf("\t%10u afs_MarshallCacheConfig\n",
779            cmp->callInfo.C_afs_MarshallCacheConfig);
780     printf("\t%10u SRXAFSCB_GetCacheConfig\n",
781            cmp->callInfo.C_SRXAFSCB_GetCacheConfig);
782     printf("\t%10u SRXAFSCB_GetCE64\n", cmp->callInfo.C_SRXAFSCB_GetCE64);
783     printf("\t%10u SRXAFSCB_GetCellByNum\n",
784            cmp->callInfo.C_SRXAFSCB_GetCellByNum);
785     printf("\t%10u BPrefetchNoCache\n", cmp->callInfo.C_BPrefetchNoCache);
786     printf("\t%10u PSetTokens2\n", cmp->callInfo.C_PSetTokens2);
787     printf("\t%10u PPrefetchFromTape\n", cmp->callInfo.C_PPrefetchFromTape);
788     printf("\t%10u afs_ReadNoCache\n", cmp->callInfo.C_afs_ReadNoCache);
789 }
790
791
792 /*------------------------------------------------------------------------
793  * PrintUpDownStats
794  *
795  * Description:
796  *      Print the up/downtime stats for the given class of server records
797  *      provided.
798  *
799  * Arguments:
800  *      a_upDownP : Ptr to the server up/down info.
801  *
802  * Returns:
803  *      Nothing.
804  *
805  * Environment:
806  *      Nothing interesting.
807  *
808  * Side Effects:
809  *      As advertised.
810  *------------------------------------------------------------------------*/
811
812 void
813 PrintUpDownStats(struct afs_stats_SrvUpDownInfo *a_upDownP)
814 {                               /*PrintUpDownStats */
815
816     /*
817      * First, print the simple values.
818      */
819     printf("\t\t%10u numTtlRecords\n", a_upDownP->numTtlRecords);
820     printf("\t\t%10u numUpRecords\n", a_upDownP->numUpRecords);
821     printf("\t\t%10u numDownRecords\n", a_upDownP->numDownRecords);
822     printf("\t\t%10u sumOfRecordAges\n", a_upDownP->sumOfRecordAges);
823     printf("\t\t%10u ageOfYoungestRecord\n", a_upDownP->ageOfYoungestRecord);
824     printf("\t\t%10u ageOfOldestRecord\n", a_upDownP->ageOfOldestRecord);
825     printf("\t\t%10u numDowntimeIncidents\n",
826            a_upDownP->numDowntimeIncidents);
827     printf("\t\t%10u numRecordsNeverDown\n", a_upDownP->numRecordsNeverDown);
828     printf("\t\t%10u maxDowntimesInARecord\n",
829            a_upDownP->maxDowntimesInARecord);
830     printf("\t\t%10u sumOfDowntimes\n", a_upDownP->sumOfDowntimes);
831     printf("\t\t%10u shortestDowntime\n", a_upDownP->shortestDowntime);
832     printf("\t\t%10u longestDowntime\n", a_upDownP->longestDowntime);
833
834     /*
835      * Now, print the array values.
836      */
837     printf("\t\tDowntime duration distribution:\n");
838     printf("\t\t\t%8u: 0 min .. 10 min\n", a_upDownP->downDurations[0]);
839     printf("\t\t\t%8u: 10 min .. 30 min\n", a_upDownP->downDurations[1]);
840     printf("\t\t\t%8u: 30 min .. 1 hr\n", a_upDownP->downDurations[2]);
841     printf("\t\t\t%8u: 1 hr .. 2 hr\n", a_upDownP->downDurations[3]);
842     printf("\t\t\t%8u: 2 hr .. 4 hr\n", a_upDownP->downDurations[4]);
843     printf("\t\t\t%8u: 4 hr .. 8 hr\n", a_upDownP->downDurations[5]);
844     printf("\t\t\t%8u: > 8 hr\n", a_upDownP->downDurations[6]);
845
846     printf("\t\tDowntime incident distribution:\n");
847     printf("\t\t\t%8u: 0 times\n", a_upDownP->downIncidents[0]);
848     printf("\t\t\t%8u: 1 time\n", a_upDownP->downIncidents[1]);
849     printf("\t\t\t%8u: 2 .. 5 times\n", a_upDownP->downIncidents[2]);
850     printf("\t\t\t%8u: 6 .. 10 times\n", a_upDownP->downIncidents[3]);
851     printf("\t\t\t%8u: 10 .. 50 times\n", a_upDownP->downIncidents[4]);
852     printf("\t\t\t%8u: > 50 times\n", a_upDownP->downIncidents[5]);
853
854 }                               /*PrintUpDownStats */
855
856
857 /*------------------------------------------------------------------------
858  * PrintOverallPerfInfo
859  *
860  * Description:
861  *      Print out overall performance numbers.
862  *
863  * Arguments:
864  *      a_ovP : Ptr to the overall performance numbers.
865  *
866  * Returns:
867  *      Nothing.
868  *
869  * Environment:
870  *      All the info we need is nestled into xstat_cm_Results.
871  *
872  * Side Effects:
873  *      As advertised.
874  *------------------------------------------------------------------------*/
875
876 void
877 PrintOverallPerfInfo(struct afs_stats_CMPerf *a_ovP)
878 {                               /*PrintOverallPerfInfo */
879
880     printf("\t%10u numPerfCalls\n", a_ovP->numPerfCalls);
881
882     printf("\t%10u epoch\n", a_ovP->epoch);
883     printf("\t%10u numCellsVisible\n", a_ovP->numCellsVisible);
884     printf("\t%10u numCellsContacted\n", a_ovP->numCellsContacted);
885     printf("\t%10u dlocalAccesses\n", a_ovP->dlocalAccesses);
886     printf("\t%10u vlocalAccesses\n", a_ovP->vlocalAccesses);
887     printf("\t%10u dremoteAccesses\n", a_ovP->dremoteAccesses);
888     printf("\t%10u vremoteAccesses\n", a_ovP->vremoteAccesses);
889     printf("\t%10u cacheNumEntries\n", a_ovP->cacheNumEntries);
890     printf("\t%10u cacheBlocksTotal\n", a_ovP->cacheBlocksTotal);
891     printf("\t%10u cacheBlocksInUse\n", a_ovP->cacheBlocksInUse);
892     printf("\t%10u cacheBlocksOrig\n", a_ovP->cacheBlocksOrig);
893     printf("\t%10u cacheMaxDirtyChunks\n", a_ovP->cacheMaxDirtyChunks);
894     printf("\t%10u cacheCurrDirtyChunks\n", a_ovP->cacheCurrDirtyChunks);
895     printf("\t%10u dcacheHits\n", a_ovP->dcacheHits);
896     printf("\t%10u vcacheHits\n", a_ovP->vcacheHits);
897     printf("\t%10u dcacheMisses\n", a_ovP->dcacheMisses);
898     printf("\t%10u vcacheMisses\n", a_ovP->vcacheMisses);
899     printf("\t%10u cacheFilesReused\n", a_ovP->cacheFilesReused);
900     printf("\t%10u vcacheXAllocs\n", a_ovP->vcacheXAllocs);
901     printf("\t%10u dcacheXAllocs\n", a_ovP->dcacheXAllocs);
902
903     printf("\t%10u bufAlloced\n", a_ovP->bufAlloced);
904     printf("\t%10u bufHits\n", a_ovP->bufHits);
905     printf("\t%10u bufMisses\n", a_ovP->bufMisses);
906     printf("\t%10u bufFlushDirty\n", a_ovP->bufFlushDirty);
907
908     printf("\t%10u LargeBlocksActive\n", a_ovP->LargeBlocksActive);
909     printf("\t%10u LargeBlocksAlloced\n", a_ovP->LargeBlocksAlloced);
910     printf("\t%10u SmallBlocksActive\n", a_ovP->SmallBlocksActive);
911     printf("\t%10u SmallBlocksAlloced\n", a_ovP->SmallBlocksAlloced);
912     printf("\t%10u OutStandingMemUsage\n", a_ovP->OutStandingMemUsage);
913     printf("\t%10u OutStandingAllocs\n", a_ovP->OutStandingAllocs);
914     printf("\t%10u CallBackAlloced\n", a_ovP->CallBackAlloced);
915     printf("\t%10u CallBackFlushes\n", a_ovP->CallBackFlushes);
916     printf("\t%10u CallBackLoops\n", a_ovP->cbloops);
917
918     printf("\t%10u srvRecords\n", a_ovP->srvRecords);
919     printf("\t%10u srvNumBuckets\n", a_ovP->srvNumBuckets);
920     printf("\t%10u srvMaxChainLength\n", a_ovP->srvMaxChainLength);
921     printf("\t%10u srvMaxChainLengthHWM\n", a_ovP->srvMaxChainLengthHWM);
922     printf("\t%10u srvRecordsHWM\n", a_ovP->srvRecordsHWM);
923
924     printf("\t%10u cacheBucket0_Discarded\n",  a_ovP->cacheBucket0_Discarded);
925     printf("\t%10u cacheBucket1_Discarded\n",  a_ovP->cacheBucket1_Discarded);
926     printf("\t%10u cacheBucket2_Discarded\n",  a_ovP->cacheBucket2_Discarded);
927
928     printf("\t%10u sysName_ID\n", a_ovP->sysName_ID);
929
930     printf("\tFile Server up/downtimes, same cell:\n");
931     PrintUpDownStats(&(a_ovP->fs_UpDown[0]));
932
933     printf("\tFile Server up/downtimes, diff cell:\n");
934     PrintUpDownStats(&(a_ovP->fs_UpDown[1]));
935
936     printf("\tVL Server up/downtimes, same cell:\n");
937     PrintUpDownStats(&(a_ovP->vl_UpDown[0]));
938
939     printf("\tVL Server up/downtimes, diff cell:\n");
940     PrintUpDownStats(&(a_ovP->vl_UpDown[1]));
941
942 }                               /*PrintOverallPerfInfo */
943
944
945 /*------------------------------------------------------------------------
946  * PrintPerfInfo
947  *
948  * Description:
949  *      Print out the AFSCB_XSTATSCOLL_PERF_INFO collection we just
950  *      received.
951  *
952  * Arguments:
953  *      None.
954  *
955  * Returns:
956  *      Nothing.
957  *
958  * Environment:
959  *      All the info we need is nestled into xstat_cm_Results.
960  *
961  * Side Effects:
962  *      As advertised.
963  *------------------------------------------------------------------------*/
964
965 void
966 PrintPerfInfo(void)
967 {                               /*PrintPerfInfo */
968
969     static afs_int32 perfInt32s = (sizeof(struct afs_stats_CMPerf) >> 2);       /*Correct # int32s to rcv */
970     afs_int32 numInt32s;        /*# int32words received */
971     struct afs_stats_CMPerf *perfP;     /*Ptr to performance stats */
972     char *printableTime;        /*Ptr to printable time string */
973     time_t probeTime = xstat_cm_Results.probeTime;
974
975     numInt32s = xstat_cm_Results.data.AFSCB_CollData_len;
976     if (numInt32s != perfInt32s) {
977         printf("** Data size mismatch in performance collection!");
978         printf("** Expecting %u, got %u\n", perfInt32s, numInt32s);
979         printf("** Version mismatch with Cache Manager\n");
980         return;
981     }
982
983     printableTime = ctime(&probeTime);
984     printableTime[strlen(printableTime) - 1] = '\0';
985     perfP = (struct afs_stats_CMPerf *)
986         (xstat_cm_Results.data.AFSCB_CollData_val);
987
988     printf
989         ("AFSCB_XSTATSCOLL_PERF_INFO (coll %d) for CM %s\n[Probe %u, %s]\n\n",
990          xstat_cm_Results.collectionNumber, xstat_cm_Results.connP->hostName,
991          xstat_cm_Results.probeNum, printableTime);
992
993     PrintOverallPerfInfo(perfP);
994
995 }                               /*PrintPerfInfo */
996
997
998 /*------------------------------------------------------------------------
999  * PrintOpTiming
1000  *
1001  * Description:
1002  *      Print out the contents of an FS RPC op timing structure.
1003  *
1004  * Arguments:
1005  *      a_opIdx   : Index of the AFS operation we're printing number on.
1006  *      a_opNames : Ptr to table of operaton names.
1007  *      a_opTimeP : Ptr to the op timing structure to print.
1008  *
1009  * Returns:
1010  *      Nothing.
1011  *
1012  * Environment:
1013  *      Nothing interesting.
1014  *
1015  * Side Effects:
1016  *      As advertised.
1017  *------------------------------------------------------------------------*/
1018
1019 void
1020 PrintOpTiming(int a_opIdx, char *a_opNames[],
1021               struct afs_stats_opTimingData *a_opTimeP)
1022 {                               /*PrintOpTiming */
1023
1024     printf
1025         ("%15s: %u ops (%u OK); sum=%lu.%06lu, sqr=%lu.%06lu, min=%lu.%06lu, max=%lu.%06lu\n",
1026          a_opNames[a_opIdx], a_opTimeP->numOps, a_opTimeP->numSuccesses,
1027          (long)a_opTimeP->sumTime.tv_sec, (long)a_opTimeP->sumTime.tv_usec,
1028          (long)a_opTimeP->sqrTime.tv_sec, (long)a_opTimeP->sqrTime.tv_usec,
1029          (long)a_opTimeP->minTime.tv_sec, (long)a_opTimeP->minTime.tv_usec,
1030          (long)a_opTimeP->maxTime.tv_sec, (long)a_opTimeP->maxTime.tv_usec);
1031
1032 }                               /*PrintOpTiming */
1033
1034
1035 /*------------------------------------------------------------------------
1036  * PrintXferTiming
1037  *
1038  * Description:
1039  *      Print out the contents of a data transfer structure.
1040  *
1041  * Arguments:
1042  *      a_opIdx : Index of the AFS operation we're printing number on.
1043  *      a_opNames : Ptr to table of operation names.
1044  *      a_xferP : Ptr to the data transfer structure to print.
1045  *
1046  * Returns:
1047  *      Nothing.
1048  *
1049  * Environment:
1050  *      Nothing interesting.
1051  *
1052  * Side Effects:
1053  *      As advertised.
1054  *------------------------------------------------------------------------*/
1055
1056 void
1057 PrintXferTiming(int a_opIdx, char *a_opNames[],
1058                 struct afs_stats_xferData *a_xferP)
1059 {                               /*PrintXferTiming */
1060
1061     printf
1062         ("%s: %u xfers (%u OK), time sum=%lu.%06lu, sqr=%lu.%06lu, min=%lu.%06lu, max=%lu.%06lu\n",
1063          a_opNames[a_opIdx], a_xferP->numXfers, a_xferP->numSuccesses,
1064          (long)a_xferP->sumTime.tv_sec, (long)a_xferP->sumTime.tv_usec,
1065          (long)a_xferP->sqrTime.tv_sec, (long)a_xferP->sqrTime.tv_usec,
1066          (long)a_xferP->minTime.tv_sec, (long)a_xferP->minTime.tv_usec,
1067          (long)a_xferP->maxTime.tv_sec, (long)a_xferP->maxTime.tv_usec);
1068     printf("\t[bytes: sum=%u, min=%u, max=%u]\n", a_xferP->sumBytes,
1069            a_xferP->minBytes, a_xferP->maxBytes);
1070     printf
1071         ("\t[buckets: 0: %u, 1: %u, 2: %u, 3: %u, 4: %u, 5: %u, 6: %u, 7: %u, 8: %u]\n",
1072          a_xferP->count[0], a_xferP->count[1], a_xferP->count[2],
1073          a_xferP->count[3], a_xferP->count[4], a_xferP->count[5],
1074          a_xferP->count[6], a_xferP->count[7], a_xferP->count[8]);
1075
1076
1077 }                               /*PrintXferTiming */
1078
1079
1080 /*------------------------------------------------------------------------
1081  * PrintErrInfo
1082  *
1083  * Description:
1084  *      Print out the contents of an FS RPC error info structure.
1085  *
1086  * Arguments:
1087  *      a_opIdx   : Index of the AFS operation we're printing.
1088  *      a_opNames : Ptr to table of operation names.
1089  *      a_opErrP  : Ptr to the op timing structure to print.
1090  *
1091  * Returns:
1092  *      Nothing.
1093  *
1094  * Environment:
1095  *      Nothing interesting.
1096  *
1097  * Side Effects:
1098  *      As advertised.
1099  *------------------------------------------------------------------------*/
1100
1101 void
1102 PrintErrInfo(int a_opIdx, char *a_opNames[],
1103              struct afs_stats_RPCErrors *a_opErrP)
1104 {                               /*PrintErrInfo */
1105
1106     printf
1107         ("%15s: %u server, %u network, %u prot, %u vol, %u busies, %u other\n",
1108          a_opNames[a_opIdx], a_opErrP->err_Server, a_opErrP->err_Network,
1109          a_opErrP->err_Protection, a_opErrP->err_Volume,
1110          a_opErrP->err_VolumeBusies, a_opErrP->err_Other);
1111
1112 }                               /*PrintErrInfo */
1113
1114
1115 /*------------------------------------------------------------------------
1116  * PrintRPCPerfInfo
1117  *
1118  * Description:
1119  *      Print out a set of RPC performance numbers.
1120  *
1121  * Arguments:
1122  *      a_rpcP : Ptr to RPC perf numbers to print.
1123  *
1124  * Returns:
1125  *      Nothing.
1126  *
1127  * Environment:
1128  *      Nothing interesting.
1129  *
1130  * Side Effects:
1131  *      As advertised.
1132  *------------------------------------------------------------------------*/
1133
1134 void
1135 PrintRPCPerfInfo(struct afs_stats_RPCOpInfo *a_rpcP)
1136 {                               /*PrintRPCPerfInfo */
1137
1138     int currIdx;                /*Loop variable */
1139
1140     /*
1141      * Print the contents of each of the opcode-related arrays.
1142      */
1143     printf("FS Operation Timings:\n---------------------\n");
1144     for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++)
1145         PrintOpTiming(currIdx, fsOpNames, &(a_rpcP->fsRPCTimes[currIdx]));
1146
1147     printf("\nError Info:\n-----------\n");
1148     for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++)
1149         PrintErrInfo(currIdx, fsOpNames, &(a_rpcP->fsRPCErrors[currIdx]));
1150
1151     printf("\nTransfer timings:\n-----------------\n");
1152     for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_XFER_OPS; currIdx++)
1153         PrintXferTiming(currIdx, xferOpNames,
1154                         &(a_rpcP->fsXferTimes[currIdx]));
1155
1156     printf("\nCM Operation Timings:\n---------------------\n");
1157     for (currIdx = 0; currIdx < AFS_STATS_NUM_CM_RPC_OPS; currIdx++)
1158         PrintOpTiming(currIdx, cmOpNames, &(a_rpcP->cmRPCTimes[currIdx]));
1159
1160 }                               /*PrintRPCPerfInfo */
1161
1162
1163 /*------------------------------------------------------------------------
1164  * PrintFullPerfInfo
1165  *
1166  * Description:
1167  *      Print out a set of full performance numbers.
1168  *
1169  * Arguments:
1170  *      None.
1171  *
1172  * Returns:
1173  *      Nothing.
1174  *
1175  * Environment:
1176  *      Nothing interesting.
1177  *
1178  * Side Effects:
1179  *      As advertised.
1180  *------------------------------------------------------------------------*/
1181
1182 void
1183 PrintFullPerfInfo(void)
1184 {                               /*PrintFullPerfInfo */
1185
1186     struct afs_stats_AuthentInfo *authentP;     /*Ptr to authentication stats */
1187     struct afs_stats_AccessInfo *accessinfP;    /*Ptr to access stats */
1188     static afs_int32 fullPerfInt32s = (sizeof(struct afs_stats_CMFullPerf) >> 2);       /*Correct #int32s */
1189     afs_int32 numInt32s;        /*# int32s actually received */
1190     struct afs_stats_CMFullPerf *fullP; /*Ptr to full perf info */
1191
1192     char *printableTime;        /*Ptr to printable time string */
1193     time_t probeTime = xstat_cm_Results.probeTime;
1194
1195     numInt32s = xstat_cm_Results.data.AFSCB_CollData_len;
1196     if (numInt32s != fullPerfInt32s) {
1197         printf("** Data size mismatch in performance collection!");
1198         printf("** Expecting %u, got %u\n", fullPerfInt32s, numInt32s);
1199         printf("** Version mismatch with Cache Manager\n");
1200         return;
1201     }
1202
1203     printableTime = ctime(&probeTime);
1204     printableTime[strlen(printableTime) - 1] = '\0';
1205     fullP = (struct afs_stats_CMFullPerf *)
1206         (xstat_cm_Results.data.AFSCB_CollData_val);
1207
1208     printf
1209         ("AFSCB_XSTATSCOLL_FULL_PERF_INFO (coll %d) for CM %s\n[Probe %u, %s]\n\n",
1210          xstat_cm_Results.collectionNumber, xstat_cm_Results.connP->hostName,
1211          xstat_cm_Results.probeNum, printableTime);
1212
1213     /*
1214      * Print the overall numbers first, followed by all of the RPC numbers,
1215      * then each of the other groupings.
1216      */
1217     printf("Overall Performance Info:\n-------------------------\n");
1218     PrintOverallPerfInfo(&(fullP->perf));
1219     printf("\n");
1220     PrintRPCPerfInfo(&(fullP->rpc));
1221
1222     authentP = &(fullP->authent);
1223     printf("\nAuthentication info:\n--------------------\n");
1224     printf
1225         ("\t%u PAGS, %u records (%u auth, %u unauth), %u max in PAG, chain max: %u\n",
1226          authentP->curr_PAGs, authentP->curr_Records,
1227          authentP->curr_AuthRecords, authentP->curr_UnauthRecords,
1228          authentP->curr_MaxRecordsInPAG, authentP->curr_LongestChain);
1229     printf("\t%u PAG creations, %u tkt updates\n", authentP->PAGCreations,
1230            authentP->TicketUpdates);
1231     printf("\t[HWMs: %u PAGS, %u records, %u max in PAG, chain max: %u]\n",
1232            authentP->HWM_PAGs, authentP->HWM_Records,
1233            authentP->HWM_MaxRecordsInPAG, authentP->HWM_LongestChain);
1234
1235     accessinfP = &(fullP->accessinf);
1236     printf("\n[Un]replicated accesses:\n------------------------\n");
1237     printf
1238         ("\t%u unrep, %u rep, %u reps accessed, %u max reps/ref, %u first OK\n\n",
1239          accessinfP->unreplicatedRefs, accessinfP->replicatedRefs,
1240          accessinfP->numReplicasAccessed, accessinfP->maxReplicasPerRef,
1241          accessinfP->refFirstReplicaOK);
1242
1243     /* There really isn't any authorship info
1244      * authorP = &(fullP->author); */
1245
1246 }                               /*PrintFullPerfInfo */
1247
1248
1249 /*------------------------------------------------------------------------
1250  * CM_Handler
1251  *
1252  * Description:
1253  *      Handler routine passed to the xstat_cm module.  This handler is
1254  *      called immediately after a poll of one of the Cache Managers has
1255  *      taken place.  All it needs to know is exported by the xstat_cm
1256  *      module, namely the data structure where the probe results are
1257  *      stored.
1258  *
1259  * Arguments:
1260  *      None.
1261  *
1262  * Returns:
1263  *      0 on success,
1264  *      -1 otherwise.
1265  *
1266  * Environment:
1267  *      See above.  All we do now is print out what we got.
1268  *
1269  * Side Effects:
1270  *      As advertised.
1271  *------------------------------------------------------------------------*/
1272
1273 int
1274 CM_Handler(void)
1275 {                               /*CM_Handler */
1276
1277     static char rn[] = "CM_Handler";    /*Routine name */
1278
1279     printf("\n-----------------------------------------------------------\n");
1280
1281     /*
1282      * If the probe failed, there isn't much we can do except gripe.
1283      */
1284     if (xstat_cm_Results.probeOK) {
1285         printf("%s: Probe %u, collection %d to CM on '%s' failed, code=%d\n",
1286                rn, xstat_cm_Results.probeNum,
1287                xstat_cm_Results.collectionNumber,
1288                xstat_cm_Results.connP->hostName, xstat_cm_Results.probeOK);
1289         return (0);
1290     }
1291
1292     if (debugging_on) {
1293         int i;
1294         int numInt32s = xstat_cm_Results.data.AFSCB_CollData_len;
1295         afs_int32 *entry = xstat_cm_Results.data.AFSCB_CollData_val;
1296
1297         printf("debug: got collection number %d\n", xstat_cm_Results.collectionNumber);
1298         printf("debug: collection data length is %d\n", numInt32s);
1299         for (i = 0; i < numInt32s; i++) {
1300             printf("debug: entry %d %u\n", i, entry[i]);
1301         }
1302         printf("\n");
1303     }
1304
1305     switch (xstat_cm_Results.collectionNumber) {
1306     case AFSCB_XSTATSCOLL_CALL_INFO:
1307         /* Why was this commented out in 3.3 ? */
1308         /* PrintCallInfo();  */
1309         print_cmCallStats();
1310         break;
1311
1312     case AFSCB_XSTATSCOLL_PERF_INFO:
1313         /* we will do nothing here */
1314         /* PrintPerfInfo(); */
1315         break;
1316
1317     case AFSCB_XSTATSCOLL_FULL_PERF_INFO:
1318         PrintFullPerfInfo();
1319         break;
1320
1321     default:
1322         printf("** Unknown collection: %d\n",
1323                xstat_cm_Results.collectionNumber);
1324     }
1325
1326     /*
1327      * Return the happy news.
1328      */
1329     return (0);
1330
1331 }                               /*CM_Handler */
1332
1333
1334 /*------------------------------------------------------------------------
1335  * CountListItems
1336  *
1337  * Description:
1338  *      Given a pointer to the list of Cache Managers we'll be polling
1339  *      (or, in fact, any list at all), compute the length of the list.
1340  *
1341  * Arguments:
1342  *      struct cmd_item *a_firstItem : Ptr to first item in list.
1343  *
1344  * Returns:
1345  *      Length of the above list.
1346  *
1347  * Environment:
1348  *      Nothing interesting.
1349  *
1350  * Side Effects:
1351  *      As advertised.
1352  *------------------------------------------------------------------------*/
1353
1354 static int
1355 CountListItems(struct cmd_item *a_firstItem)
1356 {                               /*CountListItems */
1357
1358     int list_len;               /*List length */
1359     struct cmd_item *curr_item; /*Ptr to current item */
1360
1361     list_len = 0;
1362     curr_item = a_firstItem;
1363
1364     /*
1365      * Count 'em up.
1366      */
1367     while (curr_item) {
1368         list_len++;
1369         curr_item = curr_item->next;
1370     }
1371
1372     /*
1373      * Return our tally.
1374      */
1375     return (list_len);
1376
1377 }                               /*CountListItems */
1378
1379
1380 /*------------------------------------------------------------------------
1381  * RunTheTest
1382  *
1383  * Description:
1384  *      Routine called by the command line interpreter to execute the
1385  *      meat of the program.  We count the number of Cache Managers
1386  *      to watch, allocate enough space to remember all the connection
1387  *      info for them, then go for it.
1388  *
1389  *
1390  * Arguments:
1391  *      a_s : Ptr to the command line syntax descriptor.
1392  *
1393  * Returns:
1394  *      0, but may exit the whole program on an error!
1395  *
1396  * Environment:
1397  *      Nothing interesting.
1398  *
1399  * Side Effects:
1400  *      As advertised.
1401  *------------------------------------------------------------------------*/
1402
1403 int
1404 RunTheTest(struct cmd_syndesc *a_s, void *arock)
1405 {                               /*RunTheTest */
1406
1407     static char rn[] = "RunTheTest";    /*Routine name */
1408     int code;                   /*Return code */
1409     int numCMs;                 /*# Cache Managers to monitor */
1410     int numCollIDs;             /*# collections to fetch */
1411     int currCM;                 /*Loop index */
1412     int currCollIDIdx;          /*Index of current collection ID */
1413     afs_int32 *collIDP;         /*Ptr to array of collection IDs */
1414     afs_int32 *currCollIDP;     /*Ptr to current collection ID */
1415     struct cmd_item *curr_item; /*Current CM cmd line record */
1416     struct sockaddr_in *CMSktArray;     /*Cache Manager socket array */
1417     struct hostent *he;         /*Host entry */
1418     struct timeval tv;          /*Time structure */
1419     int sleep_secs;             /*Number of seconds to sleep */
1420     int initFlags;              /*Flags passed to the init fcn */
1421     int waitCode;               /*Result of LWP_WaitProcess() */
1422     int freq;                   /*Frequency of polls */
1423     int period;                 /*Time in minutes of data collection */
1424
1425     /*
1426      * Are we doing one-shot measurements?
1427      */
1428     if (a_s->parms[P_ONESHOT].items != 0)
1429         one_shot = 1;
1430
1431     /*
1432      * Are we doing debugging output?
1433      */
1434     if (a_s->parms[P_DEBUG].items != 0)
1435         debugging_on = 1;
1436
1437     /*
1438      * Pull out the number of Cache Managers to watch and the number of
1439      * collections to get.
1440      */
1441     numCMs = CountListItems(a_s->parms[P_CM_NAMES].items);
1442     numCollIDs = CountListItems(a_s->parms[P_COLL_IDS].items);
1443
1444     /* Get the polling frequency */
1445     if (a_s->parms[P_FREQUENCY].items != 0)
1446         freq = atoi(a_s->parms[P_FREQUENCY].items->data);
1447     else
1448         freq = 30;              /* default to 30 seconds */
1449
1450     /* Get the time duration to run the tests */
1451     if (a_s->parms[P_PERIOD].items != 0)
1452         period = atoi(a_s->parms[P_PERIOD].items->data);
1453     else
1454         period = 10;            /* default to 10 minutes */
1455
1456     /*
1457      * Allocate the socket array.
1458      */
1459     if (debugging_on)
1460         printf("%s: Allocating socket array for %d Cache Manager(s)\n", rn,
1461                numCMs);
1462     CMSktArray = (struct sockaddr_in *)
1463         malloc(numCMs * sizeof(struct sockaddr_in));
1464     if (CMSktArray == (struct sockaddr_in *)0) {
1465         printf("%s: Can't allocate socket array for %d Cache Managers\n", rn,
1466                numCMs);
1467         exit(1);
1468     }
1469
1470     /*
1471      * Fill in the socket array for each of the Cache Managers listed.
1472      */
1473     curr_item = a_s->parms[P_CM_NAMES].items;
1474     for (currCM = 0; currCM < numCMs; currCM++) {
1475         CMSktArray[currCM].sin_family = AF_INET;
1476         CMSktArray[currCM].sin_port = htons(7001);      /* Cache Manager port */
1477         he = hostutil_GetHostByName(curr_item->data);
1478         if (he == NULL) {
1479             fprintf(stderr, "[%s] Can't get host info for '%s'\n", rn,
1480                     curr_item->data);
1481             exit(-1);
1482         }
1483         memcpy(&(CMSktArray[currCM].sin_addr.s_addr), he->h_addr, 4);
1484
1485         /*
1486          * Move to the next CM name.
1487          */
1488         curr_item = curr_item->next;
1489
1490     }                           /*Get socket info for each Cache Manager */
1491
1492     /*
1493      * Create and fill up the array of desired collection IDs.
1494      */
1495     if (debugging_on)
1496         printf("Allocating %d long(s) for coll ID\n", numCollIDs);
1497     collIDP = (afs_int32 *) (malloc(numCollIDs * sizeof(afs_int32)));
1498     currCollIDP = collIDP;
1499     curr_item = a_s->parms[P_COLL_IDS].items;
1500     for (currCollIDIdx = 0; currCollIDIdx < numCollIDs; currCollIDIdx++) {
1501         *currCollIDP = (afs_int32) (atoi(curr_item->data));
1502         if (debugging_on)
1503             printf("CollID at index %d is %d\n", currCollIDIdx, *currCollIDP);
1504         curr_item = curr_item->next;
1505         currCollIDP++;
1506     };
1507
1508     /*
1509      * Crank up the Cache Manager prober, then sit back and have fun.
1510      */
1511     printf("\nStarting up the xstat_cm service, ");
1512     initFlags = 0;
1513     if (debugging_on) {
1514         initFlags |= XSTAT_CM_INITFLAG_DEBUGGING;
1515         printf("debugging enabled, ");
1516     } else
1517         printf("no debugging, ");
1518     if (one_shot) {
1519         initFlags |= XSTAT_CM_INITFLAG_ONE_SHOT;
1520         printf("one-shot operation\n");
1521     } else
1522         printf("continuous operation\n");
1523
1524     code = xstat_cm_Init(numCMs,        /*Num CMs */
1525                          CMSktArray,    /*File Server socket array */
1526                          freq,  /*Probe every 30 seconds */
1527                          CM_Handler,    /*Handler routine */
1528                          initFlags,     /*Initialization flags */
1529                          numCollIDs,    /*Number of collection IDs */
1530                          collIDP);      /*Ptr to collection ID array */
1531     if (code) {
1532         fprintf(stderr, "[%s] Error returned by xstat_cm_Init: %d\n", rn,
1533                 code);
1534         xstat_cm_Cleanup(1);    /*Get rid of malloc'ed structures */
1535         exit(-1);
1536     }
1537
1538     if (one_shot) {
1539         /*
1540          * One-shot operation; just wait for the collection to be done.
1541          */
1542         if (debugging_on)
1543             printf("[%s] Calling LWP_WaitProcess() on event %" AFS_PTR_FMT
1544                    "\n", rn, &terminationEvent);
1545         waitCode = LWP_WaitProcess(&terminationEvent);
1546         if (debugging_on)
1547             printf("[%s] Returned from LWP_WaitProcess()\n", rn);
1548         if (waitCode) {
1549             if (debugging_on)
1550                 fprintf(stderr,
1551                         "[%s] Error %d encountered by LWP_WaitProcess()\n",
1552                         rn, waitCode);
1553         }
1554     } else {
1555         /*
1556          * Continuous operation.
1557          */
1558         sleep_secs = 60 * period;       /*length of data collection */
1559         printf
1560             ("xstat_cm service started, main thread sleeping for %d secs.\n",
1561              sleep_secs);
1562
1563         /*
1564          * Let's just fall asleep for a while, then we'll clean up.
1565          */
1566         tv.tv_sec = sleep_secs;
1567         tv.tv_usec = 0;
1568         code = IOMGR_Select(0,  /*Num fds */
1569                             0,  /*Descriptors ready for reading */
1570                             0,  /*Descriptors ready for writing */
1571                             0,  /*Descriptors with exceptional conditions */
1572                             &tv);       /*Timeout structure */
1573         if (code) {
1574             fprintf(stderr,
1575                     "[%s] IOMGR_Select() returned non-zero value: %d\n", rn,
1576                     code);
1577         }
1578     }
1579
1580     /*
1581      * We're all done.  Clean up, put the last nail in Rx, then
1582      * exit happily.
1583      */
1584     if (debugging_on)
1585         printf("\nYawn, main thread just woke up.  Cleaning things out...\n");
1586     code = xstat_cm_Cleanup(1); /*Get rid of malloc'ed data */
1587     rx_Finalize();
1588     return (0);
1589
1590 }                               /*RunTheTest */
1591
1592
1593 #include "AFS_component_version_number.c"
1594 int
1595 main(int argc, char **argv)
1596 {                               /*Main routine */
1597
1598     static char rn[] = "xstat_cm_test"; /*Routine name */
1599     afs_int32 code;     /*Return code */
1600     struct cmd_syndesc *ts;     /*Ptr to cmd line syntax desc */
1601
1602     /*
1603      * Set up the commands we understand.
1604      */
1605     ts = cmd_CreateSyntax("initcmd", RunTheTest, NULL, "initialize the program");
1606     cmd_AddParm(ts, "-cmname", CMD_LIST, CMD_REQUIRED,
1607                 "Cache Manager name(s) to monitor");
1608     cmd_AddParm(ts, "-collID", CMD_LIST, CMD_REQUIRED,
1609                 "Collection(s) to fetch");
1610     cmd_AddParm(ts, "-onceonly", CMD_FLAG, CMD_OPTIONAL,
1611                 "Collect results exactly once, then quit");
1612     cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,
1613                 "poll frequency, in seconds");
1614     cmd_AddParm(ts, "-period", CMD_SINGLE, CMD_OPTIONAL,
1615                 "data collection time, in minutes");
1616     cmd_AddParm(ts, "-debug", CMD_FLAG, CMD_OPTIONAL,
1617                 "turn on debugging output");
1618
1619     /*
1620      * Parse command-line switches & execute the test, then get the
1621      * heck out of here.
1622      */
1623     code = cmd_Dispatch(argc, argv);
1624     if (code) {
1625         fprintf(stderr, "[%s] Call to cmd_Dispatch() failed; code is %d\n",
1626                 rn, code);
1627     }
1628
1629     exit(code);
1630
1631 }                               /*Main routine */