FILE *debugFD; /* debugging file descriptor */
static int afsmon_output = 0; /* output to file ? */
static int afsmon_detOutput = 0; /* detailed output ? */
-static int afsmon_onceOnly = 0; /* probe once only ? (not implemented) */
int afsmon_probefreq; /* probe frequency */
static int wpkg_to_use; /* graphics package to use */
static char output_filename[80]; /* output filename */
int i, j;
afs_int32 *tmpbuf;
int code;
+ int large_time;
/* there are two parts to the xstat FS statistics
* - fullPerfP->overall which give the overall performance statistics, and
srcbuf = (afs_int32 *) (fullPerfP->det.rpcOpTimes);
+ /*
+ * For every time value below, we'll have to skip an additional
+ * 64 bits of input if struct timeval uses 64-bit values
+ */
+ if (sizeof(struct timeval) == 16)
+ large_time = 1;
+ else
+ large_time = 0;
+
for (i = 0; i < FS_STATS_NUM_RPC_OPS; i++) {
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numOps */
idx++;
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
+ if (large_time)
+ srcbuf += 2;
tmpbuf = srcbuf++; /* sqr time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
+ if (large_time)
+ srcbuf += 2;
tmpbuf = srcbuf++; /* min time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
+ if (large_time)
+ srcbuf += 2;
tmpbuf = srcbuf++; /* max time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
+ if (large_time)
+ srcbuf += 2;
}
/* copy fs transfer timings */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
+ if (large_time)
+ srcbuf += 2;
tmpbuf = srcbuf++; /* sqr time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
+ if (large_time)
+ srcbuf += 2;
tmpbuf = srcbuf++; /* min time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
+ if (large_time)
+ srcbuf += 2;
tmpbuf = srcbuf++; /* max time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
+ if (large_time)
+ srcbuf += 2;
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* sum bytes */
idx++;
srcbuf++;
}
FSinitFlags = 0;
- if (afsmon_onceOnly) /* option not provided at this time */
- FSinitFlags |= XSTAT_FS_INITFLAG_ONE_SHOT;
if (afsmon_debug) {
fprintf(debugFD, "[ %s ] Calling xstat_fs_Init \n", rn);
collIDs[num_cm_collections++] = AFSCB_XSTATSCOLL_FULL_PERF_INFO;
CMinitFlags = 0;
- if (afsmon_onceOnly) /* once only ? */
- CMinitFlags |= XSTAT_CM_INITFLAG_ONE_SHOT;
if (afsmon_debug) {
fprintf(debugFD, "[ %s ] Calling xstat_cm_Init \n", rn);
/* end of process cache manager entries */
- /* if only one probe was required setup a waiting process for the
- * termination signal */
- if (afsmon_onceOnly) {
- code = LWP_WaitProcess(&terminationEvent);
- if (code) {
- if (afsmon_debug) {
- fprintf(debugFD, "LWP_WaitProcess() returned error %d\n",
- code);
- fflush(debugFD);
- }
- afsmon_Exit(135);
- }
- }
/* start the gtx input server */
code = (intptr_t)gtx_InputServer(afsmon_win);
/*
* Set up the commands we understand.
*/
- ts = cmd_CreateSyntax("initcmd", afsmonInit, NULL, "initialize the program");
+ ts = cmd_CreateSyntax("initcmd", afsmonInit, NULL, 0, "initialize the program");
cmd_AddParm(ts, "-config", CMD_SINGLE, CMD_OPTIONAL,
"configuration file");
cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,