From 07341a33f2500cadd31ede356cac546c28e03ae5 Mon Sep 17 00:00:00 2001 From: jgong5 Date: Mon, 8 Feb 2010 02:12:47 +0000 Subject: =?UTF-8?q?Assume=20Tick=20value=201=20as=20the=20beginning=20time?= =?UTF-8?q?=20of=20boot.=20This=20is=20part=20of=20the=20fix=20of=20#20207?= =?UTF-8?q?5=20to=20make=20sure=20the=20usage=20model=20below=20doesn?= =?UTF-8?q?=E2=80=99t=20break:=20PERF=5FSTART=20(0,=20=E2=80=9CToken1?= =?UTF-8?q?=E2=80=9D,=20=E2=80=9CModule1=E2=80=9D,=201);=20PERF=5FEND=20(0?= =?UTF-8?q?,=20=E2=80=9CToken1=E2=80=9D,=20Module1=E2=80=9D,=200);?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9943 6f19259b-4bc3-4df7-8a09-765794883524 --- IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'IntelFrameworkModulePkg') diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c index 6bb60c1500..8f152a8e26 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c @@ -263,6 +263,12 @@ WriteBootToOsPerformanceData ( } EntryIndex++; if ((Handle == Handles[Index]) && (EndTicker != 0)) { + if (StartTicker == 1) { + StartTicker = StartValue; + } + if (EndTicker == 1) { + EndTicker = StartValue; + } Ticker += CountUp ? (EndTicker - StartTicker) : (StartTicker - EndTicker); } } @@ -303,6 +309,12 @@ WriteBootToOsPerformanceData ( ZeroMem (&mPerfData, sizeof (PERF_DATA)); AsciiStrnCpy (mPerfData.Token, Token, PERF_TOKEN_LENGTH); + if (StartTicker == 1) { + StartTicker = StartValue; + } + if (EndTicker == 1) { + EndTicker = StartValue; + } Ticker = CountUp ? (EndTicker - StartTicker) : (StartTicker - EndTicker); mPerfData.Duration = (UINT32) DivU64x32 (Ticker, (UINT32) Freq); -- cgit v1.2.3