]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
xstat_fs-fix-20060407
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 7 Apr 2006 06:34:26 +0000 (06:34 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 7 Apr 2006 06:34:26 +0000 (06:34 +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.

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

index 429a7de3a230c4a34f95c49f1a54111aade5f2ab..de38173a2cfaf7981cef7962e34671a661988a4b 100644 (file)
@@ -6025,28 +6025,16 @@ 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] = VICED_CAPABILITY_ERRORTRANS;
@@ -6057,28 +6045,10 @@ SRXAFS_GetCapabilities(struct rx_call * acall, Capabilities * capabilities)
     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 e5ac15a8691ed0bc8445829dde81ca9221c66b67..90c6cec3eed8f6bcc8343cb2255f993c31639297 100644 (file)
@@ -83,8 +83,7 @@ static char *opNames[] = {
     "NGetVolumeInfo",
     "BulkStatus",
     "XStatsVersion",
-    "GetXStats",
-    "GetCapabilities"
+    "GetXStats"
 };
 
 static char *xferOpNames[] = {
@@ -251,7 +250,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.
      */