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
12 * Test of the xstat_fs module.
14 *------------------------------------------------------------------------*/
16 #include <afsconfig.h>
17 #include <afs/param.h>
21 #include "xstat_fs.h" /*Interface for xstat_fs module*/
22 #include <cmd.h> /*Command line interpreter*/
33 * External routines that don't have explicit include file definitions.
35 extern struct hostent *hostutil_GetHostByName();
38 * Command line parameter indices.
39 * P_FS_NAMES : List of FileServer names.
40 * P_COLL_IDS : List of collection IDs to pick up.
41 * P_ONESHOT : Are we gathering exactly one round of data?
42 * P_DEBUG : Enable debugging output?
54 static int debugging_on = 0; /*Are we debugging?*/
55 static int one_shot = 0; /*Single round of data collection?*/
57 static char *opNames[] = {
88 static char *xferOpNames[] = {
94 /*------------------------------------------------------------------------
98 * Print out the AFS_XSTATSCOLL_CALL_INFO collection we just
108 * All the info we need is nestled into xstat_fs_Results.
112 *------------------------------------------------------------------------*/
118 static char rn[] = "PrintCallInfo"; /*Routine name*/
119 register int i; /*Loop variable*/
120 int numInt32s; /*# int32words returned*/
121 afs_int32 *currInt32; /*Ptr to current afs_int32 value*/
122 char *printableTime; /*Ptr to printable time string*/
125 * Just print out the results of the particular probe.
127 numInt32s = xstat_fs_Results.data.AFS_CollData_len;
128 currInt32 = (afs_int32 *)(xstat_fs_Results.data.AFS_CollData_val);
129 printableTime = ctime((time_t *)&(xstat_fs_Results.probeTime));
130 printableTime[strlen(printableTime)-1] = '\0';
132 printf("AFS_XSTATSCOLL_CALL_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n",
133 xstat_fs_Results.collectionNumber,
134 xstat_fs_Results.connP->hostName,
135 xstat_fs_Results.probeNum,
139 printf("\n[%d entries returned at 0x%x]\n\n",
140 numInt32s, currInt32);
142 for (i = 0; i < numInt32s; i++)
143 printf("%d ", *currInt32++);
144 fprintf(stderr, "\n");
149 /*------------------------------------------------------------------------
150 * PrintOverallPerfInfo
153 * Print out overall performance numbers.
156 * a_ovP : Ptr to the overall performance numbers.
162 * Nothing interesting.
166 *------------------------------------------------------------------------*/
168 void PrintOverallPerfInfo(a_ovP)
169 struct afs_PerfStats *a_ovP;
171 { /*PrintOverallPerfInfo*/
173 printf("\t%10d numPerfCalls\n\n", a_ovP->numPerfCalls);
176 * Vnode cache section.
178 printf("\t%10d vcache_L_Entries\n", a_ovP->vcache_L_Entries);
179 printf("\t%10d vcache_L_Allocs\n", a_ovP->vcache_L_Allocs);
180 printf("\t%10d vcache_L_Gets\n", a_ovP->vcache_L_Gets);
181 printf("\t%10d vcache_L_Reads\n", a_ovP->vcache_L_Reads);
182 printf("\t%10d vcache_L_Writes\n\n", a_ovP->vcache_L_Writes);
184 printf("\t%10d vcache_S_Entries\n", a_ovP->vcache_S_Entries);
185 printf("\t%10d vcache_S_Allocs\n", a_ovP->vcache_S_Allocs);
186 printf("\t%10d vcache_S_Gets\n", a_ovP->vcache_S_Gets);
187 printf("\t%10d vcache_S_Reads\n", a_ovP->vcache_S_Reads);
188 printf("\t%10d vcache_S_Writes\n\n", a_ovP->vcache_S_Writes);
190 printf("\t%10d vcache_H_Entries\n", a_ovP->vcache_H_Entries);
191 printf("\t%10d vcache_H_Gets\n", a_ovP->vcache_H_Gets);
192 printf("\t%10d vcache_H_Replacements\n\n", a_ovP->vcache_H_Replacements);
195 * Directory package section.
197 printf("\t%10d dir_Buffers\n", a_ovP->dir_Buffers);
198 printf("\t%10d dir_Calls\n", a_ovP->dir_Calls);
199 printf("\t%10d dir_IOs\n\n", a_ovP->dir_IOs);
204 printf("\t%10d rx_packetRequests\n", a_ovP->rx_packetRequests);
205 printf("\t%10d rx_noPackets_RcvClass\n", a_ovP->rx_noPackets_RcvClass);
206 printf("\t%10d rx_noPackets_SendClass\n", a_ovP->rx_noPackets_SendClass);
207 printf("\t%10d rx_noPackets_SpecialClass\n", a_ovP->rx_noPackets_SpecialClass);
208 printf("\t%10d rx_socketGreedy\n", a_ovP->rx_socketGreedy);
209 printf("\t%10d rx_bogusPacketOnRead\n", a_ovP->rx_bogusPacketOnRead);
210 printf("\t%10d rx_bogusHost\n", a_ovP->rx_bogusHost);
211 printf("\t%10d rx_noPacketOnRead\n", a_ovP->rx_noPacketOnRead);
212 printf("\t%10d rx_noPacketBuffersOnRead\n", a_ovP->rx_noPacketBuffersOnRead);
213 printf("\t%10d rx_selects\n", a_ovP->rx_selects);
214 printf("\t%10d rx_sendSelects\n", a_ovP->rx_sendSelects);
215 printf("\t%10d rx_packetsRead_RcvClass\n", a_ovP->rx_packetsRead_RcvClass);
216 printf("\t%10d rx_packetsRead_SendClass\n", a_ovP->rx_packetsRead_SendClass);
217 printf("\t%10d rx_packetsRead_SpecialClass\n", a_ovP->rx_packetsRead_SpecialClass);
218 printf("\t%10d rx_dataPacketsRead\n", a_ovP->rx_dataPacketsRead);
219 printf("\t%10d rx_ackPacketsRead\n", a_ovP->rx_ackPacketsRead);
220 printf("\t%10d rx_dupPacketsRead\n", a_ovP->rx_dupPacketsRead);
221 printf("\t%10d rx_spuriousPacketsRead\n", a_ovP->rx_spuriousPacketsRead);
222 printf("\t%10d rx_packetsSent_RcvClass\n", a_ovP->rx_packetsSent_RcvClass);
223 printf("\t%10d rx_packetsSent_SendClass\n", a_ovP->rx_packetsSent_SendClass);
224 printf("\t%10d rx_packetsSent_SpecialClass\n", a_ovP->rx_packetsSent_SpecialClass);
225 printf("\t%10d rx_ackPacketsSent\n", a_ovP->rx_ackPacketsSent);
226 printf("\t%10d rx_pingPacketsSent\n", a_ovP->rx_pingPacketsSent);
227 printf("\t%10d rx_abortPacketsSent\n", a_ovP->rx_abortPacketsSent);
228 printf("\t%10d rx_busyPacketsSent\n", a_ovP->rx_busyPacketsSent);
229 printf("\t%10d rx_dataPacketsSent\n", a_ovP->rx_dataPacketsSent);
230 printf("\t%10d rx_dataPacketsReSent\n", a_ovP->rx_dataPacketsReSent);
231 printf("\t%10d rx_dataPacketsPushed\n", a_ovP->rx_dataPacketsPushed);
232 printf("\t%10d rx_ignoreAckedPacket\n", a_ovP->rx_ignoreAckedPacket);
233 printf("\t%10d rx_totalRtt_Sec\n", a_ovP->rx_totalRtt_Sec);
234 printf("\t%10d rx_totalRtt_Usec\n", a_ovP->rx_totalRtt_Usec);
235 printf("\t%10d rx_minRtt_Sec\n", a_ovP->rx_minRtt_Sec);
236 printf("\t%10d rx_minRtt_Usec\n", a_ovP->rx_minRtt_Usec);
237 printf("\t%10d rx_maxRtt_Sec\n", a_ovP->rx_maxRtt_Sec);
238 printf("\t%10d rx_maxRtt_Usec\n", a_ovP->rx_maxRtt_Usec);
239 printf("\t%10d rx_nRttSamples\n", a_ovP->rx_nRttSamples);
240 printf("\t%10d rx_nServerConns\n", a_ovP->rx_nServerConns);
241 printf("\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns);
242 printf("\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs);
243 printf("\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs);
244 printf("\t%10d rx_nFreeCallStructs\n\n", a_ovP->rx_nFreeCallStructs);
247 * Host module fields.
249 printf("\t%10d host_NumHostEntries\n", a_ovP->host_NumHostEntries);
250 printf("\t%10d host_HostBlocks\n", a_ovP->host_HostBlocks);
251 printf("\t%10d host_NonDeletedHosts\n", a_ovP->host_NonDeletedHosts);
252 printf("\t%10d host_HostsInSameNetOrSubnet\n", a_ovP->host_HostsInSameNetOrSubnet);
253 printf("\t%10d host_HostsInDiffSubnet\n", a_ovP->host_HostsInDiffSubnet);
254 printf("\t%10d host_HostsInDiffNetwork\n", a_ovP->host_HostsInDiffNetwork);
255 printf("\t%10d host_NumClients\n", a_ovP->host_NumClients);
256 printf("\t%10d host_ClientBlocks\n\n", a_ovP->host_ClientBlocks);
258 printf("\t%10d sysname_ID\n", a_ovP->sysname_ID);
260 } /*PrintOverallPerfInfo*/
263 /*------------------------------------------------------------------------
267 * Print out the contents of an RPC op timing structure.
270 * a_opIdx : Index of the AFS operation we're printing number on.
271 * a_opTimeP : Ptr to the op timing structure to print.
277 * Nothing interesting.
281 *------------------------------------------------------------------------*/
283 void PrintOpTiming(a_opIdx, a_opTimeP)
285 struct fs_stats_opTimingData *a_opTimeP;
289 double fSumTime, avg;
291 fSumTime = ((double)(a_opTimeP->sumTime.tv_sec)) +
292 (((double)(a_opTimeP->sumTime.tv_usec))/((double)(1000000)));
293 /* printf("Double sum time is %f\n", fSumTime);*/
294 avg = fSumTime/((double)(a_opTimeP->numSuccesses));
296 printf("%15s: %d ops (%d OK); sum=%d.%06d, sqr=%d.%06d, min=%d.%06d, max=%d.%06d\n",
298 a_opTimeP->numOps, a_opTimeP->numSuccesses,
299 a_opTimeP->sumTime.tv_sec, a_opTimeP->sumTime.tv_usec,
300 a_opTimeP->sqrTime.tv_sec, a_opTimeP->sqrTime.tv_usec,
301 a_opTimeP->minTime.tv_sec, a_opTimeP->minTime.tv_usec,
302 a_opTimeP->maxTime.tv_sec, a_opTimeP->maxTime.tv_usec);
307 /*------------------------------------------------------------------------
311 * Print out the contents of a data transfer structure.
314 * a_opIdx : Index of the AFS operation we're printing number on.
315 * a_xferP : Ptr to the data transfer structure to print.
321 * Nothing interesting.
325 *------------------------------------------------------------------------*/
327 void PrintXferTiming(a_opIdx, a_xferP)
329 struct fs_stats_xferData *a_xferP;
331 { /*PrintXferTiming*/
333 double fSumTime, avg;
335 fSumTime = ((double)(a_xferP->sumTime.tv_sec)) +
336 ((double)(a_xferP->sumTime.tv_usec))/((double)(1000000));
338 avg = fSumTime/((double)(a_xferP->numSuccesses));
340 printf("%s: %d xfers (%d OK), time sum=%d.%06d, sqr=%d.%06d, min=%d.%06d, max=%d.%06d\n",
341 xferOpNames[a_opIdx],
342 a_xferP->numXfers, a_xferP->numSuccesses,
343 a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec,
344 a_xferP->sqrTime.tv_sec, a_xferP->sqrTime.tv_usec,
345 a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec,
346 a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec);
347 printf("\t[bytes: sum=%lu, min=%d, max=%d]\n",
348 a_xferP->sumBytes, a_xferP->minBytes, a_xferP->maxBytes);
349 printf("\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d, 6: %d, 7: %d, 8: %d]\n",
361 } /*PrintXferTiming*/
364 /*------------------------------------------------------------------------
365 * PrintDetailedPerfInfo
368 * Print out a set of detailed performance numbers.
371 * a_detP : Ptr to detailed perf numbers to print.
377 * Nothing interesting.
381 *------------------------------------------------------------------------*/
383 void PrintDetailedPerfInfo(a_detP)
384 struct fs_stats_DetailedStats *a_detP;
386 { /*PrintDetailedPerfInfo*/
388 int currIdx; /*Loop variable*/
390 printf("\t%10d epoch\n", a_detP->epoch);
392 for (currIdx = 0; currIdx < FS_STATS_NUM_RPC_OPS; currIdx++)
393 PrintOpTiming(currIdx, &(a_detP->rpcOpTimes[currIdx]));
395 for (currIdx = 0; currIdx < FS_STATS_NUM_XFER_OPS; currIdx++)
396 PrintXferTiming(currIdx, &(a_detP->xferOpTimes[currIdx]));
398 } /*PrintDetailedPerfInfo*/
401 /*------------------------------------------------------------------------
405 * Print out the AFS_XSTATSCOLL_FULL_PERF_INFO collection we just
415 * All the info we need is nestled into xstat_fs_Results.
419 *------------------------------------------------------------------------*/
421 void PrintFullPerfInfo()
423 { /*PrintFullPerfInfo*/
425 static char rn[] = "PrintFullPerfInfo"; /*Routine name*/
426 static afs_int32 fullPerfInt32s =
427 (sizeof(struct fs_stats_FullPerfStats) >> 2); /*Correct # int32s to rcv*/
428 afs_int32 numInt32s; /*# int32words received*/
429 struct fs_stats_FullPerfStats *fullPerfP; /*Ptr to full perf stats*/
430 char *printableTime; /*Ptr to printable time
433 numInt32s = xstat_fs_Results.data.AFS_CollData_len;
434 if (numInt32s != fullPerfInt32s) {
435 printf("** Data size mismatch in full performance collection!");
436 printf("** Expecting %d, got %d\n", fullPerfInt32s, numInt32s);
440 printableTime = ctime((time_t *)&(xstat_fs_Results.probeTime));
441 printableTime[strlen(printableTime)-1] = '\0';
442 fullPerfP = (struct fs_stats_FullPerfStats *)
443 (xstat_fs_Results.data.AFS_CollData_val);
445 printf("AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n",
446 xstat_fs_Results.collectionNumber,
447 xstat_fs_Results.connP->hostName,
448 xstat_fs_Results.probeNum,
451 PrintOverallPerfInfo(&(fullPerfP->overall));
452 PrintDetailedPerfInfo(&(fullPerfP->det));
454 } /*PrintFullPerfInfo*/
457 /*------------------------------------------------------------------------
461 * Print out the AFS_XSTATSCOLL_PERF_INFO collection we just
471 * All the info we need is nestled into xstat_fs_Results.
475 *------------------------------------------------------------------------*/
481 static char rn[] = "PrintPerfInfo"; /*Routine name*/
482 static afs_int32 perfInt32s =
483 (sizeof(struct afs_PerfStats) >> 2); /*Correct # int32s to rcv*/
484 afs_int32 numInt32s; /*# int32words received*/
485 struct afs_PerfStats *perfP; /*Ptr to performance stats*/
486 char *printableTime; /*Ptr to printable time string*/
488 numInt32s = xstat_fs_Results.data.AFS_CollData_len;
489 if (numInt32s != perfInt32s) {
490 printf("** Data size mismatch in performance collection!");
491 printf("** Expecting %d, got %d\n", perfInt32s, numInt32s);
495 printableTime = ctime((time_t *)&(xstat_fs_Results.probeTime));
496 printableTime[strlen(printableTime)-1] = '\0';
497 perfP = (struct afs_PerfStats *)
498 (xstat_fs_Results.data.AFS_CollData_val);
500 printf("AFS_XSTATSCOLL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n",
501 xstat_fs_Results.collectionNumber,
502 xstat_fs_Results.connP->hostName,
503 xstat_fs_Results.probeNum,
506 PrintOverallPerfInfo(perfP);
511 /*------------------------------------------------------------------------
515 * Handler routine passed to the xstat_fs module. This handler is
516 * called immediately after a poll of one of the File Servers has
517 * taken place. All it needs to know is exported by the xstat_fs
518 * module, namely the data structure where the probe results are
529 * See above. All we do now is print out what we got.
533 *------------------------------------------------------------------------*/
539 static char rn[] = "FS_Handler"; /*Routine name*/
541 printf("\n------------------------------------------------------------\n");
544 * If the probe failed, there isn't much we can do except gripe.
546 if (xstat_fs_Results.probeOK) {
547 printf("%s: Probe %d to File Server '%s' failed, code=%d\n",
548 rn, xstat_fs_Results.probeNum,
549 xstat_fs_Results.connP->hostName,
550 xstat_fs_Results.probeOK);
554 switch(xstat_fs_Results.collectionNumber) {
555 case AFS_XSTATSCOLL_CALL_INFO:
559 case AFS_XSTATSCOLL_PERF_INFO:
563 case AFS_XSTATSCOLL_FULL_PERF_INFO:
568 printf("** Unknown collection: %d\n",
569 xstat_fs_Results.collectionNumber);
573 * Return the happy news.
580 /*------------------------------------------------------------------------
584 * Given a pointer to the list of File Servers we'll be polling
585 * (or, in fact, any list at all), compute the length of the list.
588 * struct cmd_item *a_firstItem : Ptr to first item in list.
591 * Length of the above list.
594 * Nothing interesting.
598 *------------------------------------------------------------------------*/
600 static int CountListItems(a_firstItem)
601 struct cmd_item *a_firstItem;
605 int list_len; /*List length*/
606 struct cmd_item *curr_item; /*Ptr to current item*/
609 curr_item = a_firstItem;
616 curr_item = curr_item->next;
627 /*------------------------------------------------------------------------
631 * Routine called by the command line interpreter to execute the
632 * meat of the program. We count the number of File Servers
633 * to watch, allocate enough space to remember all the connection
634 * info for them, then go for it.
638 * a_s : Ptr to the command line syntax descriptor.
641 * 0, but may exit the whole program on an error!
644 * Nothing interesting.
648 *------------------------------------------------------------------------*/
651 struct cmd_syndesc *a_s;
655 static char rn[] = "RunTheTest"; /*Routine name*/
656 int code; /*Return code*/
657 int numFSs; /*# File Servers to monitor*/
658 int numCollIDs; /*# collections to fetch*/
659 int currFS; /*Loop index*/
660 int currCollIDIdx; /*Index of current collection ID*/
661 afs_int32 *collIDP; /*Ptr to array of collection IDs*/
662 afs_int32 *currCollIDP; /*Ptr to current collection ID*/
663 struct cmd_item *curr_item; /*Current FS cmd line record*/
664 struct sockaddr_in FSSktArray[20]; /*File Server socket array - FIX!*/
665 struct hostent *he; /*Host entry*/
666 struct timeval tv; /*Time structure*/
667 int sleep_secs; /*Number of seconds to sleep*/
668 int initFlags; /*Flags passed to the init fcn*/
669 int waitCode; /*Result of LWP_WaitProcess()*/
670 int freq; /*Frequency of polls*/
671 int period; /*Time in minutes of data collection*/
674 * Are we doing one-shot measurements?
676 if (a_s->parms[P_ONESHOT].items != 0)
680 * Are we doing debugging output?
682 if (a_s->parms[P_DEBUG].items != 0)
686 * Pull out the number of File Servers to watch and the number of
687 * collections to get.
689 numFSs = CountListItems(a_s->parms[P_FS_NAMES].items);
690 numCollIDs = CountListItems(a_s->parms[P_COLL_IDS].items);
692 /* Get the polling frequency */
693 if (a_s->parms[P_FREQUENCY].items != 0)
694 freq = atoi(a_s->parms[P_FREQUENCY].items->data);
696 freq = 30; /* default to 30 seconds */
698 /* Get the time duration to run the tests */
699 if (a_s->parms[P_PERIOD].items != 0)
700 period = atoi(a_s->parms[P_PERIOD].items->data);
702 period = 10; /* default to 10 minutes */
706 * Fill in the socket array for each of the File Servers listed.
708 curr_item = a_s->parms[P_FS_NAMES].items;
709 for (currFS = 0; currFS < numFSs; currFS++) {
710 FSSktArray[currFS].sin_family = htons(AF_INET); /*Internet family*/
711 FSSktArray[currFS].sin_port = htons(7000); /*FileServer port*/
712 he = hostutil_GetHostByName(curr_item->data);
715 "[%s] Can't get host info for '%s'\n",
716 rn, curr_item->data);
719 memcpy(&(FSSktArray[currFS].sin_addr.s_addr), he->h_addr, 4);
722 * Move to the next File Server name.
724 curr_item = curr_item->next;
726 } /*Get socket info for each File Server*/
729 * Create and fill up the array of desired collection IDs.
732 printf("Allocating %d long(s) for coll ID\n", numCollIDs);
733 collIDP = (afs_int32 *)(malloc(numCollIDs * sizeof(afs_int32)));
734 currCollIDP = collIDP;
735 curr_item = a_s->parms[P_COLL_IDS].items;
736 for (currCollIDIdx = 0; currCollIDIdx < numCollIDs; currCollIDIdx++) {
737 *currCollIDP = (afs_int32)(atoi(curr_item->data));
739 printf("CollID at index %d is %d\n", currCollIDIdx, *currCollIDP);
740 curr_item = curr_item->next;
745 * Crank up the File Server prober, then sit back and have fun.
747 printf("\nStarting up the xstat_fs service, ");
750 initFlags |= XSTAT_FS_INITFLAG_DEBUGGING;
751 printf("debugging enabled, ");
754 printf("no debugging, ");
756 initFlags |= XSTAT_FS_INITFLAG_ONE_SHOT;
757 printf("one-shot operation\n");
760 printf("continuous operation\n");
762 code = xstat_fs_Init(numFSs, /*Num servers*/
763 FSSktArray, /*File Server socket array*/
764 freq, /*Probe frequency*/
765 FS_Handler, /*Handler routine*/
766 initFlags, /*Initialization flags*/
767 numCollIDs, /*Number of collection IDs*/
768 collIDP); /*Ptr to collection ID array*/
771 "[%s] Error returned by xstat_fs_Init: %d\n",
773 xstat_fs_Cleanup(1); /*Get rid of malloc'ed structures*/
779 * One-shot operation; just wait for the collection to be done.
782 printf("[%s] Calling LWP_WaitProcess() on event 0x%x\n",
783 rn, &terminationEvent);
784 waitCode = LWP_WaitProcess(&terminationEvent);
786 printf("[%s] Returned from LWP_WaitProcess()\n", rn);
790 "[%s] Error %d encountered by LWP_WaitProcess()\n",
796 * Continuous operation.
798 sleep_secs = 60*period; /*length of data collection*/
799 printf("xstat_fs service started, main thread sleeping for %d secs.\n",
803 * Let's just fall asleep for a while, then we'll clean up.
805 tv.tv_sec = sleep_secs;
807 code = IOMGR_Select(0, /*Num fds*/
808 0, /*Descriptors ready for reading*/
809 0, /*Descriptors ready for writing*/
810 0, /*Descriptors with exceptional conditions*/
811 &tv); /*Timeout structure*/
814 "[%s] IOMGR_Select() returned non-zero value: %d\n",
820 * We're all done. Clean up, put the last nail in Rx, then
824 printf("\nYawn, main thread just woke up. Cleaning things out...\n");
826 code = xstat_fs_Cleanup(1); /*Get rid of malloc'ed data*/
833 #include "AFS_component_version_number.c"
841 static char rn[] = "xstat_fs_test"; /*Routine name*/
842 register afs_int32 code; /*Return code*/
843 struct cmd_syndesc *ts; /*Ptr to cmd line syntax desc*/
846 * Set up the commands we understand.
848 ts = cmd_CreateSyntax("initcmd", RunTheTest, 0,
849 "initialize the program");
850 cmd_AddParm(ts, "-fsname", CMD_LIST, CMD_REQUIRED,
851 "File Server name(s) to monitor");
852 cmd_AddParm(ts, "-collID", CMD_LIST, CMD_REQUIRED,
853 "Collection(s) to fetch");
854 cmd_AddParm(ts, "-onceonly", CMD_FLAG, CMD_OPTIONAL,
855 "Collect results exactly once, then quit");
856 cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,
857 "poll frequency, in seconds");
858 cmd_AddParm(ts, "-period", CMD_SINGLE, CMD_OPTIONAL,
859 "data collection time, in minutes");
860 cmd_AddParm(ts, "-debug", CMD_FLAG, CMD_OPTIONAL,
861 "turn on debugging output");
864 * Parse command-line switches & execute the test, then get the
867 code = cmd_Dispatch(argc, argv);
870 "[%s] Call to cmd_Dispatch() failed; code is %d\n",