Re: [edk2] [PATCH v3 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data issue

2015-11-04 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Zeng, Star
> Sent: Tuesday, November 03, 2015 5:01 PM
> To: Cinnamon Shia ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH v3 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative
> data issue
> Importance: High
> 
> On 2015/11/4 0:55, Cinnamon Shia wrote:
> > The value of PERF_CUM_DATA.Count and PERF_CUM_DATA.Duration field
> > keep cumulating on every execution of dp.
> > Initialize the CumData at dp's entry point.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Cinnamon Shia 
> > ---
> >   ShellPkg/Library/UefiDpLib/Dp.c | 27 ++-
> >   1 file changed, 26 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Star Zeng 
> 
> >
> > diff --git a/ShellPkg/Library/UefiDpLib/Dp.c
> b/ShellPkg/Library/UefiDpLib/Dp.c
> > index 8270172..62a4e7b 100644
> > --- a/ShellPkg/Library/UefiDpLib/Dp.c
> > +++ b/ShellPkg/Library/UefiDpLib/Dp.c
> > @@ -14,6 +14,7 @@
> > timer information to calculate elapsed time for each measurement.
> >
> > Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
> > +  (C) Copyright 2015 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
> > which accompanies this distribution.  The full text of the license may 
> > be
> found at
> > @@ -110,7 +111,26 @@ DumpStatistics( void )
> > SHELL_FREE_NON_NULL (StringPtrUnknown);
> >   }
> >
> > -/**
> > +/**
> > +  Initialize the cumulative data.
> > +
> > +**/
> > +VOID
> > +InitCumulativeData (
> > +  VOID
> > +  )
> > +{
> > +  UINTN Index;
> > +
> > +  for (Index = 0; Index < NumCum; ++Index) {
> > +CumData[Index].Count = 0;
> > +CumData[Index].MinDur = PERF_MAXDUR;
> > +CumData[Index].MaxDur = 0;
> > +CumData[Index].Duration = 0;
> > +  }
> > +}
> > +
> > +/**
> > Dump performance data.
> >
> > @param[in]  ImageHandle The image handle.
> > @@ -219,6 +239,11 @@ ShellCommandRunDp (
> > }
> >
> > //
> > +  // Initialize the pre-defined cumulative data.
> > +  //
> > +  InitCumulativeData ();
> > +
> > +  //
> > // Timer specific processing
> > //
> > // Get the Performance counter characteristics:
> >
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data issue

2015-11-03 Thread Zeng, Star

On 2015/11/4 0:55, Cinnamon Shia wrote:

The value of PERF_CUM_DATA.Count and PERF_CUM_DATA.Duration field
keep cumulating on every execution of dp.
Initialize the CumData at dp's entry point.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia 
---
  ShellPkg/Library/UefiDpLib/Dp.c | 27 ++-
  1 file changed, 26 insertions(+), 1 deletion(-)


Reviewed-by: Star Zeng 



diff --git a/ShellPkg/Library/UefiDpLib/Dp.c b/ShellPkg/Library/UefiDpLib/Dp.c
index 8270172..62a4e7b 100644
--- a/ShellPkg/Library/UefiDpLib/Dp.c
+++ b/ShellPkg/Library/UefiDpLib/Dp.c
@@ -14,6 +14,7 @@
timer information to calculate elapsed time for each measurement.

Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+  (C) Copyright 2015 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
which accompanies this distribution.  The full text of the license may be 
found at
@@ -110,7 +111,26 @@ DumpStatistics( void )
SHELL_FREE_NON_NULL (StringPtrUnknown);
  }

-/**
+/**
+  Initialize the cumulative data.
+
+**/
+VOID
+InitCumulativeData (
+  VOID
+  )
+{
+  UINTN Index;
+
+  for (Index = 0; Index < NumCum; ++Index) {
+CumData[Index].Count = 0;
+CumData[Index].MinDur = PERF_MAXDUR;
+CumData[Index].MaxDur = 0;
+CumData[Index].Duration = 0;
+  }
+}
+
+/**
Dump performance data.

@param[in]  ImageHandle The image handle.
@@ -219,6 +239,11 @@ ShellCommandRunDp (
}

//
+  // Initialize the pre-defined cumulative data.
+  //
+  InitCumulativeData ();
+
+  //
// Timer specific processing
//
// Get the Performance counter characteristics:



___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v3 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data issue

2015-11-03 Thread Cinnamon Shia
The value of PERF_CUM_DATA.Count and PERF_CUM_DATA.Duration field
keep cumulating on every execution of dp.
Initialize the CumData at dp's entry point.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia 
---
 ShellPkg/Library/UefiDpLib/Dp.c | 27 ++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiDpLib/Dp.c b/ShellPkg/Library/UefiDpLib/Dp.c
index 8270172..62a4e7b 100644
--- a/ShellPkg/Library/UefiDpLib/Dp.c
+++ b/ShellPkg/Library/UefiDpLib/Dp.c
@@ -14,6 +14,7 @@
   timer information to calculate elapsed time for each measurement.
  
   Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+  (C) Copyright 2015 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
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -110,7 +111,26 @@ DumpStatistics( void )
   SHELL_FREE_NON_NULL (StringPtrUnknown);
 }
 
-/** 
+/**
+  Initialize the cumulative data.
+
+**/
+VOID
+InitCumulativeData (
+  VOID
+  )
+{
+  UINTN Index;
+
+  for (Index = 0; Index < NumCum; ++Index) {
+CumData[Index].Count = 0;
+CumData[Index].MinDur = PERF_MAXDUR;
+CumData[Index].MaxDur = 0;
+CumData[Index].Duration = 0;
+  }
+}
+
+/**
   Dump performance data.
   
   @param[in]  ImageHandle The image handle.
@@ -219,6 +239,11 @@ ShellCommandRunDp (
   }
 
   //
+  // Initialize the pre-defined cumulative data.
+  //
+  InitCumulativeData ();
+
+  //
   // Timer specific processing
   //
   // Get the Performance counter characteristics:
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel