ProcessCumulative() function always calculates the average performance by dividing the count of performance record.

When the count is zero, it will report exception, so it needs to be enhanced to check the dividend.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11260 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lzeng14 2011-01-20 11:18:14 +00:00
parent 2e7120cd37
commit 0d70a7090f
1 changed files with 15 additions and 13 deletions

View File

@ -723,19 +723,21 @@ ProcessCumulative(
PrintToken (STRING_TOKEN (STR_DP_DASHES));
for ( TIndex = 0; TIndex < NumCum; ++TIndex) {
AvgDur = DivU64x32 (CumData[TIndex].Duration, CumData[TIndex].Count);
AvgDur = DurationInMicroSeconds(AvgDur);
Dur = DurationInMicroSeconds(CumData[TIndex].Duration);
MaxDur = DurationInMicroSeconds(CumData[TIndex].MaxDur);
MinDur = DurationInMicroSeconds(CumData[TIndex].MinDur);
if (CumData[TIndex].Count != 0) {
AvgDur = DivU64x32 (CumData[TIndex].Duration, CumData[TIndex].Count);
AvgDur = DurationInMicroSeconds(AvgDur);
Dur = DurationInMicroSeconds(CumData[TIndex].Duration);
MaxDur = DurationInMicroSeconds(CumData[TIndex].MaxDur);
MinDur = DurationInMicroSeconds(CumData[TIndex].MinDur);
PrintToken (STRING_TOKEN (STR_DP_CUMULATIVE_STATS),
CumData[TIndex].Name,
CumData[TIndex].Count,
Dur,
AvgDur,
MinDur,
MaxDur
);
PrintToken (STRING_TOKEN (STR_DP_CUMULATIVE_STATS),
CumData[TIndex].Name,
CumData[TIndex].Count,
Dur,
AvgDur,
MinDur,
MaxDur
);
}
}
}