mirror of
https://git.openafs.org/openafs.git
synced 2025-01-20 16:00:12 +00:00
xstat_fs-fix-20060407
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.
This commit is contained in:
parent
714df78689
commit
78bb852509
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user