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*/
26 * External routines that don't have explicit include file definitions.
28 extern struct hostent *hostutil_GetHostByName();
31 * Command line parameter indices.
32 * P_FS_NAMES : List of FileServer names.
33 * P_COLL_IDS : List of collection IDs to pick up.
34 * P_ONESHOT : Are we gathering exactly one round of data?
35 * P_DEBUG : Enable debugging output?
47 static int debugging_on = 0; /*Are we debugging?*/
48 static int one_shot = 0; /*Single round of data collection?*/
50 static char *opNames[] = {
81 static char *xferOpNames[] = {
87 /*------------------------------------------------------------------------
91 * Print out the AFS_XSTATSCOLL_CALL_INFO collection we just
101 * All the info we need is nestled into xstat_fs_Results.
105 *------------------------------------------------------------------------*/
111 static char rn[] = "PrintCallInfo"; /*Routine name*/
112 register int i; /*Loop variable*/
113 int numInt32s; /*# int32words returned*/
114 afs_int32 *currInt32; /*Ptr to current afs_int32 value*/
115 char *printableTime; /*Ptr to printable time string*/
118 * Just print out the results of the particular probe.
120 numInt32s = xstat_fs_Results.data.AFS_CollData_len;
121 currInt32 = (afs_int32 *)(xstat_fs_Results.data.AFS_CollData_val);
122 printableTime = ctime((time_t *)&(xstat_fs_Results.probeTime));
123 printableTime[strlen(printableTime)-1] = '\0';
125 printf("AFS_XSTATSCOLL_CALL_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n",
126 xstat_fs_Results.collectionNumber,
127 xstat_fs_Results.connP->hostName,
128 xstat_fs_Results.probeNum,
132 printf("\n[%d entries returned at 0x%x]\n\n",
133 numInt32s, currInt32);
135 for (i = 0; i < numInt32s; i++)
136 printf("%d ", *currInt32++);
137 fprintf(stderr, "\n");
142 /*------------------------------------------------------------------------
143 * PrintOverallPerfInfo
146 * Print out overall performance numbers.
149 * a_ovP : Ptr to the overall performance numbers.
155 * Nothing interesting.
159 *------------------------------------------------------------------------*/
161 void PrintOverallPerfInfo(a_ovP)
162 struct afs_PerfStats *a_ovP;
164 { /*PrintOverallPerfInfo*/
166 printf("\t%10d numPerfCalls\n\n", a_ovP->numPerfCalls);
169 * Vnode cache section.
171 printf("\t%10d vcache_L_Entries\n", a_ovP->vcache_L_Entries);
172 printf("\t%10d vcache_L_Allocs\n", a_ovP->vcache_L_Allocs);
173 printf("\t%10d vcache_L_Gets\n", a_ovP->vcache_L_Gets);
174 printf("\t%10d vcache_L_Reads\n", a_ovP->vcache_L_Reads);
175 printf("\t%10d vcache_L_Writes\n\n", a_ovP->vcache_L_Writes);
177 printf("\t%10d vcache_S_Entries\n", a_ovP->vcache_S_Entries);
178 printf("\t%10d vcache_S_Allocs\n", a_ovP->vcache_S_Allocs);
179 printf("\t%10d vcache_S_Gets\n", a_ovP->vcache_S_Gets);
180 printf("\t%10d vcache_S_Reads\n", a_ovP->vcache_S_Reads);
181 printf("\t%10d vcache_S_Writes\n\n", a_ovP->vcache_S_Writes);
183 printf("\t%10d vcache_H_Entries\n", a_ovP->vcache_H_Entries);
184 printf("\t%10d vcache_H_Gets\n", a_ovP->vcache_H_Gets);
185 printf("\t%10d vcache_H_Replacements\n\n", a_ovP->vcache_H_Replacements);
188 * Directory package section.
190 printf("\t%10d dir_Buffers\n", a_ovP->dir_Buffers);
191 printf("\t%10d dir_Calls\n", a_ovP->dir_Calls);
192 printf("\t%10d dir_IOs\n\n", a_ovP->dir_IOs);
197 printf("\t%10d rx_packetRequests\n", a_ovP->rx_packetRequests);
198 printf("\t%10d rx_noPackets_RcvClass\n", a_ovP->rx_noPackets_RcvClass);
199 printf("\t%10d rx_noPackets_SendClass\n", a_ovP->rx_noPackets_SendClass);
200 printf("\t%10d rx_noPackets_SpecialClass\n", a_ovP->rx_noPackets_SpecialClass);
201 printf("\t%10d rx_socketGreedy\n", a_ovP->rx_socketGreedy);
202 printf("\t%10d rx_bogusPacketOnRead\n", a_ovP->rx_bogusPacketOnRead);
203 printf("\t%10d rx_bogusHost\n", a_ovP->rx_bogusHost);
204 printf("\t%10d rx_noPacketOnRead\n", a_ovP->rx_noPacketOnRead);
205 printf("\t%10d rx_noPacketBuffersOnRead\n", a_ovP->rx_noPacketBuffersOnRead);
206 printf("\t%10d rx_selects\n", a_ovP->rx_selects);
207 printf("\t%10d rx_sendSelects\n", a_ovP->rx_sendSelects);
208 printf("\t%10d rx_packetsRead_RcvClass\n", a_ovP->rx_packetsRead_RcvClass);
209 printf("\t%10d rx_packetsRead_SendClass\n", a_ovP->rx_packetsRead_SendClass);
210 printf("\t%10d rx_packetsRead_SpecialClass\n", a_ovP->rx_packetsRead_SpecialClass);
211 printf("\t%10d rx_dataPacketsRead\n", a_ovP->rx_dataPacketsRead);
212 printf("\t%10d rx_ackPacketsRead\n", a_ovP->rx_ackPacketsRead);
213 printf("\t%10d rx_dupPacketsRead\n", a_ovP->rx_dupPacketsRead);
214 printf("\t%10d rx_spuriousPacketsRead\n", a_ovP->rx_spuriousPacketsRead);
215 printf("\t%10d rx_packetsSent_RcvClass\n", a_ovP->rx_packetsSent_RcvClass);
216 printf("\t%10d rx_packetsSent_SendClass\n", a_ovP->rx_packetsSent_SendClass);
217 printf("\t%10d rx_packetsSent_SpecialClass\n", a_ovP->rx_packetsSent_SpecialClass);
218 printf("\t%10d rx_ackPacketsSent\n", a_ovP->rx_ackPacketsSent);
219 printf("\t%10d rx_pingPacketsSent\n", a_ovP->rx_pingPacketsSent);
220 printf("\t%10d rx_abortPacketsSent\n", a_ovP->rx_abortPacketsSent);
221 printf("\t%10d rx_busyPacketsSent\n", a_ovP->rx_busyPacketsSent);
222 printf("\t%10d rx_dataPacketsSent\n", a_ovP->rx_dataPacketsSent);
223 printf("\t%10d rx_dataPacketsReSent\n", a_ovP->rx_dataPacketsReSent);
224 printf("\t%10d rx_dataPacketsPushed\n", a_ovP->rx_dataPacketsPushed);
225 printf("\t%10d rx_ignoreAckedPacket\n", a_ovP->rx_ignoreAckedPacket);
226 printf("\t%10d rx_totalRtt_Sec\n", a_ovP->rx_totalRtt_Sec);
227 printf("\t%10d rx_totalRtt_Usec\n", a_ovP->rx_totalRtt_Usec);
228 printf("\t%10d rx_minRtt_Sec\n", a_ovP->rx_minRtt_Sec);
229 printf("\t%10d rx_minRtt_Usec\n", a_ovP->rx_minRtt_Usec);
230 printf("\t%10d rx_maxRtt_Sec\n", a_ovP->rx_maxRtt_Sec);
231 printf("\t%10d rx_maxRtt_Usec\n", a_ovP->rx_maxRtt_Usec);
232 printf("\t%10d rx_nRttSamples\n", a_ovP->rx_nRttSamples);
233 printf("\t%10d rx_nServerConns\n", a_ovP->rx_nServerConns);
234 printf("\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns);
235 printf("\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs);
236 printf("\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs);
237 printf("\t%10d rx_nFreeCallStructs\n\n", a_ovP->rx_nFreeCallStructs);
240 * Host module fields.
242 printf("\t%10d host_NumHostEntries\n", a_ovP->host_NumHostEntries);
243 printf("\t%10d host_HostBlocks\n", a_ovP->host_HostBlocks);
244 printf("\t%10d host_NonDeletedHosts\n", a_ovP->host_NonDeletedHosts);
245 printf("\t%10d host_HostsInSameNetOrSubnet\n", a_ovP->host_HostsInSameNetOrSubnet);
246 printf("\t%10d host_HostsInDiffSubnet\n", a_ovP->host_HostsInDiffSubnet);
247 printf("\t%10d host_HostsInDiffNetwork\n", a_ovP->host_HostsInDiffNetwork);
248 printf("\t%10d host_NumClients\n", a_ovP->host_NumClients);
249 printf("\t%10d host_ClientBlocks\n\n", a_ovP->host_ClientBlocks);
251 printf("\t%10d sysname_ID\n", a_ovP->sysname_ID);
253 } /*PrintOverallPerfInfo*/
256 /*------------------------------------------------------------------------
260 * Print out the contents of an RPC op timing structure.
263 * a_opIdx : Index of the AFS operation we're printing number on.
264 * a_opTimeP : Ptr to the op timing structure to print.
270 * Nothing interesting.
274 *------------------------------------------------------------------------*/
276 void PrintOpTiming(a_opIdx, a_opTimeP)
278 struct fs_stats_opTimingData *a_opTimeP;
282 double fSumTime, avg;
284 fSumTime = ((double)(a_opTimeP->sumTime.tv_sec)) +
285 (((double)(a_opTimeP->sumTime.tv_usec))/((double)(1000000)));
286 /* printf("Double sum time is %f\n", fSumTime);*/
287 avg = fSumTime/((double)(a_opTimeP->numSuccesses));
289 printf("%15s: %d ops (%d OK); sum=%d.%06d, sqr=%d.%06d, min=%d.%06d, max=%d.%06d\n",
291 a_opTimeP->numOps, a_opTimeP->numSuccesses,
292 a_opTimeP->sumTime.tv_sec, a_opTimeP->sumTime.tv_usec,
293 a_opTimeP->sqrTime.tv_sec, a_opTimeP->sqrTime.tv_usec,
294 a_opTimeP->minTime.tv_sec, a_opTimeP->minTime.tv_usec,
295 a_opTimeP->maxTime.tv_sec, a_opTimeP->maxTime.tv_usec);
300 /*------------------------------------------------------------------------
304 * Print out the contents of a data transfer structure.
307 * a_opIdx : Index of the AFS operation we're printing number on.
308 * a_xferP : Ptr to the data transfer structure to print.
314 * Nothing interesting.
318 *------------------------------------------------------------------------*/
320 void PrintXferTiming(a_opIdx, a_xferP)
322 struct fs_stats_xferData *a_xferP;
324 { /*PrintXferTiming*/
326 double fSumTime, avg;
328 fSumTime = ((double)(a_xferP->sumTime.tv_sec)) +
329 ((double)(a_xferP->sumTime.tv_usec))/((double)(1000000));
331 avg = fSumTime/((double)(a_xferP->numSuccesses));
333 printf("%s: %d xfers (%d OK), time sum=%d.%06d, sqr=%d.%06d, min=%d.%06d, max=%d.%06d\n",
334 xferOpNames[a_opIdx],
335 a_xferP->numXfers, a_xferP->numSuccesses,
336 a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec,
337 a_xferP->sqrTime.tv_sec, a_xferP->sqrTime.tv_usec,
338 a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec,
339 a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec);
340 printf("\t[bytes: sum=%lu, min=%d, max=%d]\n",
341 a_xferP->sumBytes, a_xferP->minBytes, a_xferP->maxBytes);
342 printf("\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d, 6: %d, 7: %d, 8: %d]\n",
354 } /*PrintXferTiming*/
357 /*------------------------------------------------------------------------
358 * PrintDetailedPerfInfo
361 * Print out a set of detailed performance numbers.
364 * a_detP : Ptr to detailed perf numbers to print.
370 * Nothing interesting.
374 *------------------------------------------------------------------------*/
376 void PrintDetailedPerfInfo(a_detP)
377 struct fs_stats_DetailedStats *a_detP;
379 { /*PrintDetailedPerfInfo*/
381 int currIdx; /*Loop variable*/
383 printf("\t%10d epoch\n", a_detP->epoch);
385 for (currIdx = 0; currIdx < FS_STATS_NUM_RPC_OPS; currIdx++)
386 PrintOpTiming(currIdx, &(a_detP->rpcOpTimes[currIdx]));
388 for (currIdx = 0; currIdx < FS_STATS_NUM_XFER_OPS; currIdx++)
389 PrintXferTiming(currIdx, &(a_detP->xferOpTimes[currIdx]));
391 } /*PrintDetailedPerfInfo*/
394 /*------------------------------------------------------------------------
398 * Print out the AFS_XSTATSCOLL_FULL_PERF_INFO collection we just
408 * All the info we need is nestled into xstat_fs_Results.
412 *------------------------------------------------------------------------*/
414 void PrintFullPerfInfo()
416 { /*PrintFullPerfInfo*/
418 static char rn[] = "PrintFullPerfInfo"; /*Routine name*/
419 static afs_int32 fullPerfInt32s =
420 (sizeof(struct fs_stats_FullPerfStats) >> 2); /*Correct # int32s to rcv*/
421 afs_int32 numInt32s; /*# int32words received*/
422 struct fs_stats_FullPerfStats *fullPerfP; /*Ptr to full perf stats*/
423 char *printableTime; /*Ptr to printable time
426 numInt32s = xstat_fs_Results.data.AFS_CollData_len;
427 if (numInt32s != fullPerfInt32s) {
428 printf("** Data size mismatch in full performance collection!");
429 printf("** Expecting %d, got %d\n", fullPerfInt32s, numInt32s);
433 printableTime = ctime((time_t *)&(xstat_fs_Results.probeTime));
434 printableTime[strlen(printableTime)-1] = '\0';
435 fullPerfP = (struct fs_stats_FullPerfStats *)
436 (xstat_fs_Results.data.AFS_CollData_val);
438 printf("AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n",
439 xstat_fs_Results.collectionNumber,
440 xstat_fs_Results.connP->hostName,
441 xstat_fs_Results.probeNum,
444 PrintOverallPerfInfo(&(fullPerfP->overall));
445 PrintDetailedPerfInfo(&(fullPerfP->det));
447 } /*PrintFullPerfInfo*/
450 /*------------------------------------------------------------------------
454 * Print out the AFS_XSTATSCOLL_PERF_INFO collection we just
464 * All the info we need is nestled into xstat_fs_Results.
468 *------------------------------------------------------------------------*/
474 static char rn[] = "PrintPerfInfo"; /*Routine name*/
475 static afs_int32 perfInt32s =
476 (sizeof(struct afs_PerfStats) >> 2); /*Correct # int32s to rcv*/
477 afs_int32 numInt32s; /*# int32words received*/
478 struct afs_PerfStats *perfP; /*Ptr to performance stats*/
479 char *printableTime; /*Ptr to printable time string*/
481 numInt32s = xstat_fs_Results.data.AFS_CollData_len;
482 if (numInt32s != perfInt32s) {
483 printf("** Data size mismatch in performance collection!");
484 printf("** Expecting %d, got %d\n", perfInt32s, numInt32s);
488 printableTime = ctime((time_t *)&(xstat_fs_Results.probeTime));
489 printableTime[strlen(printableTime)-1] = '\0';
490 perfP = (struct afs_PerfStats *)
491 (xstat_fs_Results.data.AFS_CollData_val);
493 printf("AFS_XSTATSCOLL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n",
494 xstat_fs_Results.collectionNumber,
495 xstat_fs_Results.connP->hostName,
496 xstat_fs_Results.probeNum,
499 PrintOverallPerfInfo(perfP);
504 /*------------------------------------------------------------------------
508 * Handler routine passed to the xstat_fs module. This handler is
509 * called immediately after a poll of one of the File Servers has
510 * taken place. All it needs to know is exported by the xstat_fs
511 * module, namely the data structure where the probe results are
522 * See above. All we do now is print out what we got.
526 *------------------------------------------------------------------------*/
532 static char rn[] = "FS_Handler"; /*Routine name*/
534 printf("\n------------------------------------------------------------\n");
537 * If the probe failed, there isn't much we can do except gripe.
539 if (xstat_fs_Results.probeOK) {
540 printf("%s: Probe %d to File Server '%s' failed, code=%d\n",
541 rn, xstat_fs_Results.probeNum,
542 xstat_fs_Results.connP->hostName,
543 xstat_fs_Results.probeOK);
547 switch(xstat_fs_Results.collectionNumber) {
548 case AFS_XSTATSCOLL_CALL_INFO:
552 case AFS_XSTATSCOLL_PERF_INFO:
556 case AFS_XSTATSCOLL_FULL_PERF_INFO:
561 printf("** Unknown collection: %d\n",
562 xstat_fs_Results.collectionNumber);
566 * Return the happy news.
573 /*------------------------------------------------------------------------
577 * Given a pointer to the list of File Servers we'll be polling
578 * (or, in fact, any list at all), compute the length of the list.
581 * struct cmd_item *a_firstItem : Ptr to first item in list.
584 * Length of the above list.
587 * Nothing interesting.
591 *------------------------------------------------------------------------*/
593 static int CountListItems(a_firstItem)
594 struct cmd_item *a_firstItem;
598 int list_len; /*List length*/
599 struct cmd_item *curr_item; /*Ptr to current item*/
602 curr_item = a_firstItem;
609 curr_item = curr_item->next;
620 /*------------------------------------------------------------------------
624 * Routine called by the command line interpreter to execute the
625 * meat of the program. We count the number of File Servers
626 * to watch, allocate enough space to remember all the connection
627 * info for them, then go for it.
631 * a_s : Ptr to the command line syntax descriptor.
634 * 0, but may exit the whole program on an error!
637 * Nothing interesting.
641 *------------------------------------------------------------------------*/
644 struct cmd_syndesc *a_s;
648 static char rn[] = "RunTheTest"; /*Routine name*/
649 int code; /*Return code*/
650 int numFSs; /*# File Servers to monitor*/
651 int numCollIDs; /*# collections to fetch*/
652 int currFS; /*Loop index*/
653 int currCollIDIdx; /*Index of current collection ID*/
654 afs_int32 *collIDP; /*Ptr to array of collection IDs*/
655 afs_int32 *currCollIDP; /*Ptr to current collection ID*/
656 struct cmd_item *curr_item; /*Current FS cmd line record*/
657 struct sockaddr_in FSSktArray[20]; /*File Server socket array - FIX!*/
658 struct hostent *he; /*Host entry*/
659 struct timeval tv; /*Time structure*/
660 int sleep_secs; /*Number of seconds to sleep*/
661 int initFlags; /*Flags passed to the init fcn*/
662 int waitCode; /*Result of LWP_WaitProcess()*/
663 int freq; /*Frequency of polls*/
664 int period; /*Time in minutes of data collection*/
667 * Are we doing one-shot measurements?
669 if (a_s->parms[P_ONESHOT].items != 0)
673 * Are we doing debugging output?
675 if (a_s->parms[P_DEBUG].items != 0)
679 * Pull out the number of File Servers to watch and the number of
680 * collections to get.
682 numFSs = CountListItems(a_s->parms[P_FS_NAMES].items);
683 numCollIDs = CountListItems(a_s->parms[P_COLL_IDS].items);
685 /* Get the polling frequency */
686 if (a_s->parms[P_FREQUENCY].items != 0)
687 freq = atoi(a_s->parms[P_FREQUENCY].items->data);
689 freq = 30; /* default to 30 seconds */
691 /* Get the time duration to run the tests */
692 if (a_s->parms[P_PERIOD].items != 0)
693 period = atoi(a_s->parms[P_PERIOD].items->data);
695 period = 10; /* default to 10 minutes */
699 * Fill in the socket array for each of the File Servers listed.
701 curr_item = a_s->parms[P_FS_NAMES].items;
702 for (currFS = 0; currFS < numFSs; currFS++) {
703 FSSktArray[currFS].sin_family = htons(AF_INET); /*Internet family*/
704 FSSktArray[currFS].sin_port = htons(7000); /*FileServer port*/
705 he = hostutil_GetHostByName(curr_item->data);
706 if (he == (struct hostent *)0) {
708 "[%s] Can't get host info for '%s'\n",
709 rn, curr_item->data);
712 memcpy(&(FSSktArray[currFS].sin_addr.s_addr), he->h_addr, 4);
715 * Move to the next File Server name.
717 curr_item = curr_item->next;
719 } /*Get socket info for each File Server*/
722 * Create and fill up the array of desired collection IDs.
725 printf("Allocating %d long(s) for coll ID\n", numCollIDs);
726 collIDP = (afs_int32 *)(malloc(numCollIDs * sizeof(afs_int32)));
727 currCollIDP = collIDP;
728 curr_item = a_s->parms[P_COLL_IDS].items;
729 for (currCollIDIdx = 0; currCollIDIdx < numCollIDs; currCollIDIdx++) {
730 *currCollIDP = (afs_int32)(atoi(curr_item->data));
732 printf("CollID at index %d is %d\n", currCollIDIdx, *currCollIDP);
733 curr_item = curr_item->next;
738 * Crank up the File Server prober, then sit back and have fun.
740 printf("\nStarting up the xstat_fs service, ");
743 initFlags |= XSTAT_FS_INITFLAG_DEBUGGING;
744 printf("debugging enabled, ");
747 printf("no debugging, ");
749 initFlags |= XSTAT_FS_INITFLAG_ONE_SHOT;
750 printf("one-shot operation\n");
753 printf("continuous operation\n");
755 code = xstat_fs_Init(numFSs, /*Num servers*/
756 FSSktArray, /*File Server socket array*/
757 freq, /*Probe frequency*/
758 FS_Handler, /*Handler routine*/
759 initFlags, /*Initialization flags*/
760 numCollIDs, /*Number of collection IDs*/
761 collIDP); /*Ptr to collection ID array*/
764 "[%s] Error returned by xstat_fs_Init: %d\n",
766 xstat_fs_Cleanup(1); /*Get rid of malloc'ed structures*/
772 * One-shot operation; just wait for the collection to be done.
775 printf("[%s] Calling LWP_WaitProcess() on event 0x%x\n",
776 rn, &terminationEvent);
777 waitCode = LWP_WaitProcess(&terminationEvent);
779 printf("[%s] Returned from LWP_WaitProcess()\n", rn);
783 "[%s] Error %d encountered by LWP_WaitProcess()\n",
789 * Continuous operation.
791 sleep_secs = 60*period; /*length of data collection*/
792 printf("xstat_fs service started, main thread sleeping for %d secs.\n",
796 * Let's just fall asleep for a while, then we'll clean up.
798 tv.tv_sec = sleep_secs;
800 code = IOMGR_Select(0, /*Num fds*/
801 0, /*Descriptors ready for reading*/
802 0, /*Descriptors ready for writing*/
803 0, /*Descriptors with exceptional conditions*/
804 &tv); /*Timeout structure*/
807 "[%s] IOMGR_Select() returned non-zero value: %d\n",
813 * We're all done. Clean up, put the last nail in Rx, then
817 printf("\nYawn, main thread just woke up. Cleaning things out...\n");
819 code = xstat_fs_Cleanup(1); /*Get rid of malloc'ed data*/
826 #include "AFS_component_version_number.c"
834 static char rn[] = "xstat_fs_test"; /*Routine name*/
835 register afs_int32 code; /*Return code*/
836 struct cmd_syndesc *ts; /*Ptr to cmd line syntax desc*/
839 * Set up the commands we understand.
841 ts = cmd_CreateSyntax("initcmd", RunTheTest, 0,
842 "initialize the program");
843 cmd_AddParm(ts, "-fsname", CMD_LIST, CMD_REQUIRED,
844 "File Server name(s) to monitor");
845 cmd_AddParm(ts, "-collID", CMD_LIST, CMD_REQUIRED,
846 "Collection(s) to fetch");
847 cmd_AddParm(ts, "-onceonly", CMD_FLAG, CMD_OPTIONAL,
848 "Collect results exactly once, then quit");
849 cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,
850 "poll frequency, in seconds");
851 cmd_AddParm(ts, "-period", CMD_SINGLE, CMD_OPTIONAL,
852 "data collection time, in minutes");
853 cmd_AddParm(ts, "-debug", CMD_FLAG, CMD_OPTIONAL,
854 "turn on debugging output");
857 * Parse command-line switches & execute the test, then get the
860 code = cmd_Dispatch(argc, argv);
863 "[%s] Call to cmd_Dispatch() failed; code is %d\n",