X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=PerformancePkg%2FDp_App%2FDpTrace.c;h=9b4e0ed289ad19d9938eb07ad25e9c92ed672f36;hp=256f7462838c8b7dbae26b13890372089961a3d1;hb=02f6fd1d5f2e21dafc080721e7258bc2a2dc603c;hpb=23cfa2b9f0d08d744ec66b05140129464bf12ef9
diff --git a/PerformancePkg/Dp_App/DpTrace.c b/PerformancePkg/Dp_App/DpTrace.c
index 256f746283..9b4e0ed289 100644
--- a/PerformancePkg/Dp_App/DpTrace.c
+++ b/PerformancePkg/Dp_App/DpTrace.c
@@ -1,7 +1,7 @@
/** @file
Trace reporting for the Dp utility.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
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
#include
#include
-#include
#include
#include
#include
@@ -220,8 +219,8 @@ DumpAllTrace(
++Count; // Count the number of records printed
// If Handle is non-zero, see if we can determine a name for the driver
- AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); // Use Module by default
- AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));
+ AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); // Use Module by default
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken));
if (Measurement.Handle != NULL) {
// See if the Handle is in the HandleBuffer
for (TIndex = 0; TIndex < HandleCount; TIndex++) {
@@ -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);
}
@@ -594,7 +573,7 @@ ProcessHandles(
continue;
}
mGaugeString[0] = 0; // Empty driver name by default
- AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken));
// See if the Handle is in the HandleBuffer
for (Index = 0; Index < HandleCount; Index++) {
if (Measurement.Handle == HandleBuffer[Index]) {
@@ -777,8 +756,8 @@ ProcessGlobal(
&Measurement.EndTimeStamp,
&Measurement.Identifier)) != 0)
{
- AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0]));
- AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));
+ AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString));
+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken));
mGaugeString[25] = 0;
mUnicodeToken[31] = 0;
if ( ! ( IsPhase( &Measurement) ||