]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-xstat_fs-fix-20060407
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 10 Apr 2006 16:46:46 +0000 (16:46 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 10 Apr 2006 16:46:46 +0000 (16:46 +0000)
as pointed out by cg2v@andrew.cmu.edu the addition of performance
collection data for the GetCapabilities RPC broke backward compatibility
with previous builds because it altered the size of the data structure
sent on the wire.

Instead we count the number of GetCapabilties calls but do not gather
performance timing data as this can be done using spare fields.

(cherry picked from commit 78bb852509767ff32547c8dc90c385a4c503e0f9)

src/viced/afsfileprocs.c
src/viced/fs_stats.h
src/xstat/xstat_fs_test.c

index 561cab8ea8b4b3228536aa413c3ec0570181cee8..5d2b84bca628a12a497643d1b8dd1f2e5912d776 100644 (file)
@@ -6151,56 +6151,25 @@ SRXAFS_GetCapabilities(struct rx_call * acall, Capabilities * capabilities)
     struct host *thost;
     afs_int32 *dataBuffP;
     afs_int32 dataBytes;
-#if FS_STATS_DETAILED
-    struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
-    struct timeval opStartTime, opStopTime;    /* Start/stop times for RPC op */
-    struct timeval elapsedTime;        /* Transfer time */
 
-    /*
-     * Set our stats pointer, remember when the RPC operation started, and
-     * tally the operation.
-     */
-    opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GETCAPABILITIES]);
     FS_LOCK;
-    (opP->numOps)++;
+    AFSCallStats.GetCapabilities++, AFSCallStats.TotalCalls++;
+    afs_FullPerfStats.overall.fs_nGetCaps++;
     FS_UNLOCK;
-    TM_GetTimeOfDay(&opStartTime, 0);
-#endif /* FS_STATS_DETAILED */
+    ViceLog(2, ("SAFS_GetCapabilties\n"));
 
     if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon, &thost)))
        goto Bad_GetCaps;
 
-    FS_LOCK;
-    AFSCallStats.GetCapabilities++, AFSCallStats.TotalCalls++;
-    FS_UNLOCK;
     dataBytes = 1 * sizeof(afs_int32);
     dataBuffP = (afs_int32 *) malloc(dataBytes);
     dataBuffP[0] = CAPABILITY_ERRORTRANS;
     capabilities->Capabilities_len = dataBytes / sizeof(afs_int32);
     capabilities->Capabilities_val = dataBuffP;
 
-    ViceLog(2, ("SAFS_GetCapabilties\n"));
-
   Bad_GetCaps:
     code = CallPostamble(tcon, code, thost);
 
-#if FS_STATS_DETAILED
-    TM_GetTimeOfDay(&opStopTime, 0);
-    fs_stats_GetDiff(elapsedTime, opStartTime, opStopTime);
-    if (code == 0) {
-       FS_LOCK;
-       (opP->numSuccesses)++;
-       fs_stats_AddTo((opP->sumTime), elapsedTime);
-       fs_stats_SquareAddTo((opP->sqrTime), elapsedTime);
-       if (fs_stats_TimeLessThan(elapsedTime, (opP->minTime))) {
-           fs_stats_TimeAssign((opP->minTime), elapsedTime);
-       }
-       if (fs_stats_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
-           fs_stats_TimeAssign((opP->maxTime), elapsedTime);
-       }
-       FS_UNLOCK;
-    }
-#endif /* FS_STATS_DETAILED */
     return 0;
 }
 
index e69dd55a664b126ee52a9e4d1604689dcb871433..7f915a4cf5f8f453df480c91e19b5c812d227974 100644 (file)
@@ -126,10 +126,14 @@ struct afs_PerfStats {
     afs_int32 rx_nBusies;      /*Ttl VBUSYs sent to shed load */
     afs_int32 fs_nBusies;      /*Ttl VBUSYs sent during restart/vol clone */
 
+    /* 
+     * Can't count this as an RPC because it breaks the data structure
+     */
+    afs_int32 fs_nGetCaps;     /* Number of GetCapabilities calls */
     /*
      * Spares
      */
-    afs_int32 spare[29];
+    afs_int32 spare[28];
 };
 
 #if FS_STATS_DETAILED
@@ -164,9 +168,8 @@ struct afs_PerfStats {
 #define FS_STATS_RPCIDX_BULKSTATUS     25
 #define FS_STATS_RPCIDX_XSTATSVERSION  26
 #define FS_STATS_RPCIDX_GETXSTATS      27
-#define FS_STATS_RPCIDX_GETCAPABILITIES 28
 
-#define FS_STATS_NUM_RPC_OPS           29
+#define FS_STATS_NUM_RPC_OPS           28
 
 /*
  * Assign an index to each of the File Server's RPC interface routines
index b0f1119597263bc7aa3b600dfe31e8905d5b2336..80cdfed6390669a5eaf932c241f8fa3aecc1d203 100644 (file)
@@ -83,8 +83,7 @@ static char *opNames[] = {
     "NGetVolumeInfo",
     "BulkStatus",
     "XStatsVersion",
-    "GetXStats",
-    "GetCapabilities"
+    "GetXStats"
 };
 
 static char *xferOpNames[] = {
@@ -250,7 +249,8 @@ PrintOverallPerfInfo(struct afs_PerfStats *a_ovP)
     printf("\t%10d rx_nFreeCallStructs\n", a_ovP->rx_nFreeCallStructs);
     printf("\t%10d rx_nBusies\n\n", a_ovP->rx_nBusies);
 
-    printf("\t%10d fs_nBusies\n\n", a_ovP->fs_nBusies);
+    printf("\t%10d fs_nBusies\n", a_ovP->fs_nBusies);
+    printf("\t%10d fs_GetCapabilities\n\n", a_ovP->fs_nGetCaps);
     /*
      * Host module fields.
      */