summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCinnamon Shia <cinnamon.shia@hpe.com>2016-05-02 12:34:08 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-13 20:43:17 +0800
commit3db22cc2990d7f512aa2da630108e7376ccf5a65 (patch)
tree2b8a992eb9ed0e2ea9503397670643c56c5d0ce3
parent1c29d8d5d9060708940f434bc1ecdb6a87db9b4b (diff)
downloadedk2-platforms-3db22cc2990d7f512aa2da630108e7376ccf5a65.tar.xz
ShellPkg/UefiDpLib: Fix the error message "Timer library instance error!"
When executing shell dp command, there is an error message "Timer library instance error!" The error message "Timer library instance error!" should be for the case about duration > EndTimeStamp if CountUp or duration > StartTimeStamp if CountDown. But if the EndTimeStamp of an entry is not added, it should not the case to catch. This change fixes the error message "Timer library instance error!" from the "BdsAttempt" entry which is logged when trying to boot a boot option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 69af847603ca1f6439031c4e1fee844fdb06ca6f)
-rw-r--r--ShellPkg/Library/UefiDpLib/DpUtilities.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiDpLib/DpUtilities.c b/ShellPkg/Library/UefiDpLib/DpUtilities.c
index 032e7b4ce1..fbdd938bc3 100644
--- a/ShellPkg/Library/UefiDpLib/DpUtilities.c
+++ b/ShellPkg/Library/UefiDpLib/DpUtilities.c
@@ -2,7 +2,7 @@
Utility functions used by the Dp application.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
- (C) Copyright 2015 Hewlett Packard Enterprise Development LP<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
which accompanies this distribution. The full text of the license may be found at
@@ -68,6 +68,10 @@ GetDuration (
UINT64 Duration;
BOOLEAN Error;
+ if (Measurement->EndTimeStamp == 0) {
+ return 0;
+ }
+
// PERF_START macros are called with a value of 1 to indicate
// the beginning of time. So, adjust the start ticker value
// to the real beginning of time.