]> git.proxmox.com Git - mirror_edk2.git/commitdiff
PerformancePkg/Dp_App: Fix the error message "Timer library instance error!"
authorCinnamon Shia <cinnamon.shia@hpe.com>
Mon, 2 May 2016 04:34:09 +0000 (12:34 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 3 May 2016 04:37:57 +0000 (12:37 +0800)
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>
PerformancePkg/Dp_App/DpUtilities.c

index b49844a058b8a3efe8e7db45f1c791ed56223351..13d38979d3f696dec79e1d984569cac8c3edcacb 100644 (file)
@@ -2,6 +2,7 @@
   Utility functions used by the Dp application.\r
 \r
   Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -82,6 +83,10 @@ GetDuration (
   UINT64    Duration;\r
   BOOLEAN   Error;\r
 \r
+  if (Measurement->EndTimeStamp == 0) {\r
+    return 0;\r
+  }\r
+\r
   // PERF_START macros are called with a value of 1 to indicate\r
   // the beginning of time.  So, adjust the start ticker value\r
   // to the real beginning of time.\r