Dump Debug Timer's parameter only if TimerFrequency is not NULL.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff....@intel.com>
CC: Ruiyu Ni <ruiyu...@intel.com>
---
 .../Library/DebugAgent/DebugAgentCommon/DebugTimer.c      | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c 
b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
index 0a60e7d..366873d 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
@@ -17,7 +17,10 @@
 /**
   Initialize CPU local APIC timer.
 
-  @param[out] TimerFrequency  Local APIC timer frequency returned.
+  If TimerFrequency is not NULL, dump the Debug Timer's parameter and return
+  Local APIC timer's frequency.
+
+  @param[out] TimerFrequency  Local APIC timer frequency returned.
  
   @return   32-bit Local APIC timer init count.
 **/
@@ -45,12 +48,12 @@ InitializeDebugTimer (
 
   InitializeApicTimer (ApicTimerDivisor, InitialCount, TRUE, 
DEBUG_TIMER_VECTOR);
 
-  DEBUG ((EFI_D_INFO, "Debug Timer: FSB Clock    = %d\n", 
PcdGet32(PcdFSBClock))); 
-  DEBUG ((EFI_D_INFO, "Debug Timer: Divisor      = %d\n", ApicTimerDivisor)); 
-  DEBUG ((EFI_D_INFO, "Debug Timer: Frequency    = %d\n", 
ApicTimerFrequency)); 
-  DEBUG ((EFI_D_INFO, "Debug Timer: InitialCount = %d\n", InitialCount)); 
-
   if (TimerFrequency != NULL) {
+    DEBUG ((EFI_D_INFO, "Debug Timer: FSB Clock    = %d\n", 
PcdGet32(PcdFSBClock)));
+    DEBUG ((EFI_D_INFO, "Debug Timer: Divisor      = %d\n", ApicTimerDivisor));
+    DEBUG ((EFI_D_INFO, "Debug Timer: Frequency    = %d\n", 
ApicTimerFrequency));
+    DEBUG ((EFI_D_INFO, "Debug Timer: InitialCount = %d\n", InitialCount));
+
     *TimerFrequency = ApicTimerFrequency;
   }
   return InitialCount;
-- 
1.9.5.msysgit.0


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to