mirror of https://github.com/acidanthera/audk.git
Assume Tick value 1 as the beginning time of boot.
This is part of the fix of #202075 to make sure the usage model below doesn’t break: PERF_START (0, “Token1”, “Module1”, 1); PERF_END (0, “Token1”, Module1”, 0); git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9943 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
85e385f42b
commit
07341a33f2
|
@ -263,6 +263,12 @@ WriteBootToOsPerformanceData (
|
||||||
}
|
}
|
||||||
EntryIndex++;
|
EntryIndex++;
|
||||||
if ((Handle == Handles[Index]) && (EndTicker != 0)) {
|
if ((Handle == Handles[Index]) && (EndTicker != 0)) {
|
||||||
|
if (StartTicker == 1) {
|
||||||
|
StartTicker = StartValue;
|
||||||
|
}
|
||||||
|
if (EndTicker == 1) {
|
||||||
|
EndTicker = StartValue;
|
||||||
|
}
|
||||||
Ticker += CountUp ? (EndTicker - StartTicker) : (StartTicker - EndTicker);
|
Ticker += CountUp ? (EndTicker - StartTicker) : (StartTicker - EndTicker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,6 +309,12 @@ WriteBootToOsPerformanceData (
|
||||||
ZeroMem (&mPerfData, sizeof (PERF_DATA));
|
ZeroMem (&mPerfData, sizeof (PERF_DATA));
|
||||||
|
|
||||||
AsciiStrnCpy (mPerfData.Token, Token, PERF_TOKEN_LENGTH);
|
AsciiStrnCpy (mPerfData.Token, Token, PERF_TOKEN_LENGTH);
|
||||||
|
if (StartTicker == 1) {
|
||||||
|
StartTicker = StartValue;
|
||||||
|
}
|
||||||
|
if (EndTicker == 1) {
|
||||||
|
EndTicker = StartValue;
|
||||||
|
}
|
||||||
Ticker = CountUp ? (EndTicker - StartTicker) : (StartTicker - EndTicker);
|
Ticker = CountUp ? (EndTicker - StartTicker) : (StartTicker - EndTicker);
|
||||||
|
|
||||||
mPerfData.Duration = (UINT32) DivU64x32 (Ticker, (UINT32) Freq);
|
mPerfData.Duration = (UINT32) DivU64x32 (Ticker, (UINT32) Freq);
|
||||||
|
|
Loading…
Reference in New Issue