char *printableTime; /*Ptr to printable time string */
time_t probeTime;
- numLongs = a_fs_Results->data.AFS_CollData_len;
- if (numLongs != fullPerfLongs) {
- fprintf(fs_outFD,
- " ** Data size mismatch in full performance collection!\n");
- fprintf(fs_outFD, " ** Expecting %d, got %d\n", fullPerfLongs,
- numLongs);
- return;
- }
probeTime = a_fs_Results->probeTime;
printableTime = ctime(&probeTime);
a_fs_Results->collectionNumber, a_fs_Results->connP->hostName,
a_fs_Results->probeNum, printableTime);
- Print_fs_OverallPerfInfo(&(fullPerfP->overall));
- Print_fs_DetailedPerfInfo(&(fullPerfP->det));
+ numLongs = a_fs_Results->data.AFS_CollData_len;
+ if (numLongs != fullPerfLongs) {
+ fprintf(fs_outFD,
+ " ** Data size mismatch in full performance collection!\n");
+ fprintf(fs_outFD, " ** Expecting %d, got %d\n", fullPerfLongs,
+ numLongs);
+
+ /* Unfortunately, the full perf stats contain timeval structures which
+ * do not have the same size everywhere. At least try to print
+ * the overall stats.
+ */
+ if (numLongs >= (sizeof(struct afs_stats_CMPerf) / sizeof(afs_int32))) {
+ Print_fs_OverallPerfInfo(&(fullPerfP->overall));
+ }
+ } else {
+ Print_fs_OverallPerfInfo(&(fullPerfP->overall));
+ Print_fs_DetailedPerfInfo(&(fullPerfP->det));
+ }
} /*Print_fs_FullPerfInfo */
int idx;
int i, j;
afs_int32 *tmpbuf;
+ afs_int32 numInt32s;
if (afsmon_debug) {
fprintf(debugFD, "[ %s ] Called, a_fsData= %p, a_fsResults= %p\n", rn,
* - fullPerfP->det which gives detailed info about file server operation
* execution times */
+ /*
+ * Unfortunately, the full perf stats contain timeval structures which
+ * do not have the same size everywhere. Avoid displaying gargbage,
+ * but at least try to show the overall stats.
+ */
+ numInt32s = a_fsResults->data.AFS_CollData_len;
+ if (numInt32s !=
+ (sizeof(struct fs_stats_FullPerfStats) / sizeof(afs_int32))) {
+ srcbuf = a_fsResults->data.AFS_CollData_val;
+ for (i = 0; i < NUM_FS_STAT_ENTRIES; i++) {
+ if (i < numInt32s && i < NUM_XSTAT_FS_AFS_PERFSTATS_LONGS) {
+ sprintf(a_fsData->data[i], "%d", srcbuf[i]);
+ } else {
+ sprintf(a_fsData->data[i], "%s", "--");
+ }
+ }
+ return 0;
+ }
+
/* copy overall performance statistics */
srcbuf = (afs_int32 *) & (fullPerfP->overall);
idx = 0;