PerformancePkg Dp_App: Remove TimerLib dependency

Current Dp_App implementation depends on TimerLib,
as different platforms may implement and use their
own TimerLib, it makes the dp application needs to
be built by platform. The TimerLib dependency can
be removed by using performance property configuration
table to make Dp_App to be generic.

Cc: Andrew Fish <afish@apple.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Cinnamon Shia <cinnamon.shia@hpe.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Star Zeng
2016-06-08 00:30:22 -07:00
committed by Michael Kinney
parent cfb0aba793
commit 139351093d
8 changed files with 34 additions and 57 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Trace reporting for the Dp utility.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -17,7 +17,6 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/TimerLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
#include <Library/PerformanceLib.h>
#include <Library/PrintLib.h>
@@ -385,12 +384,10 @@ DumpRawTrace(
/**
Gather and print Major Phase metrics.
@param[in] Ticker The timer value for the END of Shell phase
**/
VOID
ProcessPhases(
IN UINT64 Ticker
VOID
)
{
MEASUREMENT_RECORD Measurement;
@@ -399,7 +396,6 @@ ProcessPhases(
UINT64 PeiTime;
UINT64 DxeTime;
UINT64 BdsTime;
UINT64 ShellTime;
UINT64 ElapsedTime;
UINT64 Duration;
UINT64 Total;
@@ -412,7 +408,6 @@ ProcessPhases(
PeiTime = 0;
DxeTime = 0;
BdsTime = 0;
ShellTime = 0;
//
// Get Execution Phase Statistics
//
@@ -433,9 +428,6 @@ ProcessPhases(
&Measurement.EndTimeStamp,
&Measurement.Identifier)) != 0)
{
if (AsciiStrnCmp (Measurement.Token, ALit_SHELL, PERF_TOKEN_LENGTH) == 0) {
Measurement.EndTimeStamp = Ticker;
}
if (Measurement.EndTimeStamp == 0) { // Skip "incomplete" records
continue;
}
@@ -453,8 +445,6 @@ ProcessPhases(
DxeTime = Duration;
} else if (AsciiStrnCmp (Measurement.Token, ALit_BDS, PERF_TOKEN_LENGTH) == 0) {
BdsTime = Duration;
} else if (AsciiStrnCmp (Measurement.Token, ALit_SHELL, PERF_TOKEN_LENGTH) == 0) {
ShellTime = Duration;
}
}
@@ -509,17 +499,6 @@ ProcessPhases(
PrintToken (STRING_TOKEN (STR_DP_PHASE_BDSTO), ALit_BdsTO, ElapsedTime);
}
// print SHELL phase duration time
//
if (ShellTime > 0) {
ElapsedTime = DivU64x32 (
ShellTime,
(UINT32)TimerInfo.Frequency
);
Total += ElapsedTime;
PrintToken (STRING_TOKEN (STR_DP_PHASE_DURATION), ALit_SHELL, ElapsedTime);
}
PrintToken (STRING_TOKEN (STR_DP_TOTAL_DURATION), Total);
}