Re: [edk2] [PATCH v2 1/2] PerformancePkg/Dp_App: Support execution break

2016-03-08 Thread Zeng, Star
Series committed at 3e9de670ec3f18d0211a72d28fedb5dfce93442a and 
196ccda08fc481dae4fc97db8f2938df87801edb.


On 2016/3/7 15:09, Zeng, Star wrote:

Series: Reviewed-by: Star Zeng 

On 2016/3/7 11:23, Cinnamon Shia wrote:

Support UEFI shell execution break.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia 
---
  PerformancePkg/Dp_App/Dp.c | 36 --
  PerformancePkg/Dp_App/DpInternal.h | 27 -
  PerformancePkg/Dp_App/DpTrace.c| 62
--
  3 files changed, 99 insertions(+), 26 deletions(-)

diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c
index e052216..e36a032 100644
--- a/PerformancePkg/Dp_App/Dp.c
+++ b/PerformancePkg/Dp_App/Dp.c
@@ -14,7 +14,7 @@
timer information to calculate elapsed time for each measurement.

Copyright (c) 2009 - 2015, Intel Corporation. All rights
reserved.
-  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+  (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
which accompanies this distribution.  The full text of the license
may be found at
@@ -195,11 +195,11 @@ InitCumulativeData (

@param[in]  ImageHandle The image handle.
@param[in]  SystemTable The system table.
-
+
@retval EFI_SUCCESSCommand completed successfully.
@retval EFI_INVALID_PARAMETER  Command usage error.
+  @retval EFI_ABORTEDThe user aborts the operation.
@retval value  Unknown error.
-
  **/
  EFI_STATUS
  EFIAPI
@@ -443,7 +443,10 @@ InitializeDp (
  ProcessCumulative (CustomCumulativeData);
} else if (AllMode) {
  if (TraceMode) {
-  DumpAllTrace( Number2Display, ExcludeMode);
+  Status = DumpAllTrace( Number2Display, ExcludeMode);
+  if (Status == EFI_ABORTED) {
+goto Done;
+  }
  }
  if (ProfileMode) {
DumpAllProfile( Number2Display, ExcludeMode);
@@ -451,7 +454,10 @@ InitializeDp (
}
else if (RawMode) {
  if (TraceMode) {
-  DumpRawTrace( Number2Display, ExcludeMode);
+  Status = DumpRawTrace( Number2Display, ExcludeMode);
+  if (Status == EFI_ABORTED) {
+goto Done;
+  }
  }
  if (ProfileMode) {
DumpRawProfile( Number2Display, ExcludeMode);
@@ -463,11 +469,21 @@ InitializeDp (
ProcessPhases ( Ticker );
if ( ! SummaryMode) {
  Status = ProcessHandles ( ExcludeMode);
-if ( ! EFI_ERROR( Status)) {
-  ProcessPeims ( );
-  ProcessGlobal ();
-  ProcessCumulative (NULL);
+if (Status == EFI_ABORTED) {
+  goto Done;
  }
+
+Status = ProcessPeims ();
+if (Status == EFI_ABORTED) {
+  goto Done;
+}
+
+Status = ProcessGlobal ();
+if (Status == EFI_ABORTED) {
+  goto Done;
+}
+
+ProcessCumulative (NULL);
}
  }
  if (ProfileMode) {
@@ -480,6 +496,8 @@ InitializeDp (
  }
}

+Done:
+
//
// Free the memory allocate from HiiGetString
//
diff --git a/PerformancePkg/Dp_App/DpInternal.h
b/PerformancePkg/Dp_App/DpInternal.h
index 0e97e1e..53c5fb2 100644
--- a/PerformancePkg/Dp_App/DpInternal.h
+++ b/PerformancePkg/Dp_App/DpInternal.h
@@ -7,7 +7,7 @@
DpUtilities.c, DpTrace.c, and DpProfile.c are included here.

Copyright (c) 2009 - 2014, Intel Corporation. All rights
reserved.
-  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+  (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
which accompanies this distribution.  The full text of the license
may be found at
@@ -215,8 +215,11 @@ GatherStatistics(
@param[in]Limit   The number of records to print.  Zero is
ALL.
@param[in]ExcludeFlag TRUE to exclude individual Cumulative
items from display.

+  @retval EFI_SUCCESS   The operation was successful.
+  @retval EFI_ABORTED   The user aborts the operation.
+  @return Othersfrom a call to
gBS->LocateHandleBuffer().
  **/
-VOID
+EFI_STATUS
  DumpAllTrace(
IN UINTN Limit,
IN BOOLEAN   ExcludeFlag
@@ -238,9 +241,11 @@ DumpAllTrace(

@param[in]Limit   The number of records to print.  Zero is
ALL.
@param[in]ExcludeFlag TRUE to exclude individual Cumulative
items from display.
-
+
+  @retval EFI_SUCCESS   The operation was successful.
+  @retval EFI_ABORTED   The user aborts the 

Re: [edk2] [PATCH v2 1/2] PerformancePkg/Dp_App: Support execution break

2016-03-07 Thread Carsey, Jaben
Also for series.

Reviewed-by: Jaben Carsey <jaben.car...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of El-
> Haj-Mahmoud, Samer
> Sent: Monday, March 07, 2016 4:57 AM
> To: edk2-devel@lists.01.org; Shia, Cinnamon <cinnamon.s...@hpe.com>
> Subject: Re: [edk2] [PATCH v2 1/2] PerformancePkg/Dp_App: Support
> execution break
> Importance: High
> 
> Series Reviewed-by: Samer EL-Haj-Mahmoud <el...@hpe.com>
> 
> On 2016/3/7 11:23, Cinnamon Shia wrote:
> > Support UEFI shell execution break.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Cinnamon Shia <cinnamon.s...@hpe.com>
> > ---
> >   PerformancePkg/Dp_App/Dp.c | 36 --
> >   PerformancePkg/Dp_App/DpInternal.h | 27 -
> >   PerformancePkg/Dp_App/DpTrace.c| 62
> --
> >   3 files changed, 99 insertions(+), 26 deletions(-)
> >
> > diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c
> > index e052216..e36a032 100644
> > --- a/PerformancePkg/Dp_App/Dp.c
> > +++ b/PerformancePkg/Dp_App/Dp.c
> > @@ -14,7 +14,7 @@
> > timer information to calculate elapsed time for each measurement.
> >
> > Copyright (c) 2009 - 2015, Intel Corporation. All rights
> > reserved.
> > -  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> > +  (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
> > which accompanies this distribution.  The full text of the license
> > may be found at @@ -195,11 +195,11 @@ InitCumulativeData (
> >
> > @param[in]  ImageHandle The image handle.
> > @param[in]  SystemTable The system table.
> > -
> > +
> > @retval EFI_SUCCESSCommand completed successfully.
> > @retval EFI_INVALID_PARAMETER  Command usage error.
> > +  @retval EFI_ABORTEDThe user aborts the operation.
> > @retval value  Unknown error.
> > -
> >   **/
> >   EFI_STATUS
> >   EFIAPI
> > @@ -443,7 +443,10 @@ InitializeDp (
> >   ProcessCumulative (CustomCumulativeData);
> > } else if (AllMode) {
> >   if (TraceMode) {
> > -  DumpAllTrace( Number2Display, ExcludeMode);
> > +  Status = DumpAllTrace( Number2Display, ExcludeMode);
> > +  if (Status == EFI_ABORTED) {
> > +goto Done;
> > +  }
> >   }
> >   if (ProfileMode) {
> > DumpAllProfile( Number2Display, ExcludeMode); @@ -451,7
> > +454,10 @@ InitializeDp (
> > }
> > else if (RawMode) {
> >   if (TraceMode) {
> > -  DumpRawTrace( Number2Display, ExcludeMode);
> > +  Status = DumpRawTrace( Number2Display, ExcludeMode);
> > +  if (Status == EFI_ABORTED) {
> > +goto Done;
> > +  }
> >   }
> >   if (ProfileMode) {
> > DumpRawProfile( Number2Display, ExcludeMode); @@ -463,11
> > +469,21 @@ InitializeDp (
> > ProcessPhases ( Ticker );
> > if ( ! SummaryMode) {
> >   Status = ProcessHandles ( ExcludeMode);
> > -if ( ! EFI_ERROR( Status)) {
> > -  ProcessPeims ( );
> > -  ProcessGlobal ();
> > -  ProcessCumulative (NULL);
> > +if (Status == EFI_ABORTED) {
> > +  goto Done;
> >   }
> > +
> > +Status = ProcessPeims ();
> > +if (Status == EFI_ABORTED) {
> > +  goto Done;
> > +}
> > +
> > +Status = ProcessGlobal ();
> > +if (Status == EFI_ABORTED) {
> > +  goto Done;
> > +}
> > +
> > +ProcessCumulative (NULL);
> > }
> >   }
> >   if (ProfileMode) {
> > @@ -480,6 +496,8 @@ InitializeDp (
> >   }
> > }
> >
> > +Done:
> > +
> > //
> > // Free the memory allocate from HiiGetString
> > //
> > diff --git a/PerformancePkg/Dp_App/DpInternal.h
> > b/PerformancePkg/Dp_App/DpInternal.h
> > index 0e97e1e..53c5fb2 100644
> > --- a/PerformancePkg/Dp_App/DpInternal.h
> > +++ b/Per

Re: [edk2] [PATCH v2 1/2] PerformancePkg/Dp_App: Support execution break

2016-03-07 Thread El-Haj-Mahmoud, Samer
Series Reviewed-by: Samer EL-Haj-Mahmoud 

On 2016/3/7 11:23, Cinnamon Shia wrote:
> Support UEFI shell execution break.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cinnamon Shia 
> ---
>   PerformancePkg/Dp_App/Dp.c | 36 --
>   PerformancePkg/Dp_App/DpInternal.h | 27 -
>   PerformancePkg/Dp_App/DpTrace.c| 62 
> --
>   3 files changed, 99 insertions(+), 26 deletions(-)
>
> diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c 
> index e052216..e36a032 100644
> --- a/PerformancePkg/Dp_App/Dp.c
> +++ b/PerformancePkg/Dp_App/Dp.c
> @@ -14,7 +14,7 @@
> timer information to calculate elapsed time for each measurement.
>
> Copyright (c) 2009 - 2015, Intel Corporation. All rights 
> reserved.
> -  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> +  (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
> which accompanies this distribution.  The full text of the license 
> may be found at @@ -195,11 +195,11 @@ InitCumulativeData (
>
> @param[in]  ImageHandle The image handle.
> @param[in]  SystemTable The system table.
> -
> +
> @retval EFI_SUCCESSCommand completed successfully.
> @retval EFI_INVALID_PARAMETER  Command usage error.
> +  @retval EFI_ABORTEDThe user aborts the operation.
> @retval value  Unknown error.
> -
>   **/
>   EFI_STATUS
>   EFIAPI
> @@ -443,7 +443,10 @@ InitializeDp (
>   ProcessCumulative (CustomCumulativeData);
> } else if (AllMode) {
>   if (TraceMode) {
> -  DumpAllTrace( Number2Display, ExcludeMode);
> +  Status = DumpAllTrace( Number2Display, ExcludeMode);
> +  if (Status == EFI_ABORTED) {
> +goto Done;
> +  }
>   }
>   if (ProfileMode) {
> DumpAllProfile( Number2Display, ExcludeMode); @@ -451,7 
> +454,10 @@ InitializeDp (
> }
> else if (RawMode) {
>   if (TraceMode) {
> -  DumpRawTrace( Number2Display, ExcludeMode);
> +  Status = DumpRawTrace( Number2Display, ExcludeMode);
> +  if (Status == EFI_ABORTED) {
> +goto Done;
> +  }
>   }
>   if (ProfileMode) {
> DumpRawProfile( Number2Display, ExcludeMode); @@ -463,11 
> +469,21 @@ InitializeDp (
> ProcessPhases ( Ticker );
> if ( ! SummaryMode) {
>   Status = ProcessHandles ( ExcludeMode);
> -if ( ! EFI_ERROR( Status)) {
> -  ProcessPeims ( );
> -  ProcessGlobal ();
> -  ProcessCumulative (NULL);
> +if (Status == EFI_ABORTED) {
> +  goto Done;
>   }
> +
> +Status = ProcessPeims ();
> +if (Status == EFI_ABORTED) {
> +  goto Done;
> +}
> +
> +Status = ProcessGlobal ();
> +if (Status == EFI_ABORTED) {
> +  goto Done;
> +}
> +
> +ProcessCumulative (NULL);
> }
>   }
>   if (ProfileMode) {
> @@ -480,6 +496,8 @@ InitializeDp (
>   }
> }
>
> +Done:
> +
> //
> // Free the memory allocate from HiiGetString
> //
> diff --git a/PerformancePkg/Dp_App/DpInternal.h 
> b/PerformancePkg/Dp_App/DpInternal.h
> index 0e97e1e..53c5fb2 100644
> --- a/PerformancePkg/Dp_App/DpInternal.h
> +++ b/PerformancePkg/Dp_App/DpInternal.h
> @@ -7,7 +7,7 @@
> DpUtilities.c, DpTrace.c, and DpProfile.c are included here.
>
> Copyright (c) 2009 - 2014, Intel Corporation. All rights 
> reserved.
> -  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> +  (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
> which accompanies this distribution.  The full text of the license 
> may be found at @@ -215,8 +215,11 @@ GatherStatistics(
> @param[in]Limit   The number of records to print.  Zero is ALL.
> @param[in]ExcludeFlag TRUE to exclude individual Cumulative items 
> from display.
>
> +  @retval EFI_SUCCESS   The operation was successful.
> +  @retval EFI_ABORTED   The user aborts the operation.
> +  @return Othersfrom a call to gBS->LocateHandleBuffer().
>   **/
> -VOID
> +EFI_STATUS
>   DumpAllTrace(
> IN UINTN Limit,
> IN BOOLEAN   ExcludeFlag
> @@ -238,9 +241,11 @@ DumpAllTrace(
>
> @param[in]Limit   The number of records to print.  Zero is ALL.
> @param[in]ExcludeFlag TRUE to exclude individual Cumulative items 
> 

Re: [edk2] [PATCH v2 1/2] PerformancePkg/Dp_App: Support execution break

2016-03-06 Thread Zeng, Star

Series: Reviewed-by: Star Zeng 

On 2016/3/7 11:23, Cinnamon Shia wrote:

Support UEFI shell execution break.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia 
---
  PerformancePkg/Dp_App/Dp.c | 36 --
  PerformancePkg/Dp_App/DpInternal.h | 27 -
  PerformancePkg/Dp_App/DpTrace.c| 62 --
  3 files changed, 99 insertions(+), 26 deletions(-)

diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c
index e052216..e36a032 100644
--- a/PerformancePkg/Dp_App/Dp.c
+++ b/PerformancePkg/Dp_App/Dp.c
@@ -14,7 +14,7 @@
timer information to calculate elapsed time for each measurement.

Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
-  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+  (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
which accompanies this distribution.  The full text of the license may be 
found at
@@ -195,11 +195,11 @@ InitCumulativeData (

@param[in]  ImageHandle The image handle.
@param[in]  SystemTable The system table.
-
+
@retval EFI_SUCCESSCommand completed successfully.
@retval EFI_INVALID_PARAMETER  Command usage error.
+  @retval EFI_ABORTEDThe user aborts the operation.
@retval value  Unknown error.
-
  **/
  EFI_STATUS
  EFIAPI
@@ -443,7 +443,10 @@ InitializeDp (
  ProcessCumulative (CustomCumulativeData);
} else if (AllMode) {
  if (TraceMode) {
-  DumpAllTrace( Number2Display, ExcludeMode);
+  Status = DumpAllTrace( Number2Display, ExcludeMode);
+  if (Status == EFI_ABORTED) {
+goto Done;
+  }
  }
  if (ProfileMode) {
DumpAllProfile( Number2Display, ExcludeMode);
@@ -451,7 +454,10 @@ InitializeDp (
}
else if (RawMode) {
  if (TraceMode) {
-  DumpRawTrace( Number2Display, ExcludeMode);
+  Status = DumpRawTrace( Number2Display, ExcludeMode);
+  if (Status == EFI_ABORTED) {
+goto Done;
+  }
  }
  if (ProfileMode) {
DumpRawProfile( Number2Display, ExcludeMode);
@@ -463,11 +469,21 @@ InitializeDp (
ProcessPhases ( Ticker );
if ( ! SummaryMode) {
  Status = ProcessHandles ( ExcludeMode);
-if ( ! EFI_ERROR( Status)) {
-  ProcessPeims ( );
-  ProcessGlobal ();
-  ProcessCumulative (NULL);
+if (Status == EFI_ABORTED) {
+  goto Done;
  }
+
+Status = ProcessPeims ();
+if (Status == EFI_ABORTED) {
+  goto Done;
+}
+
+Status = ProcessGlobal ();
+if (Status == EFI_ABORTED) {
+  goto Done;
+}
+
+ProcessCumulative (NULL);
}
  }
  if (ProfileMode) {
@@ -480,6 +496,8 @@ InitializeDp (
  }
}

+Done:
+
//
// Free the memory allocate from HiiGetString
//
diff --git a/PerformancePkg/Dp_App/DpInternal.h 
b/PerformancePkg/Dp_App/DpInternal.h
index 0e97e1e..53c5fb2 100644
--- a/PerformancePkg/Dp_App/DpInternal.h
+++ b/PerformancePkg/Dp_App/DpInternal.h
@@ -7,7 +7,7 @@
DpUtilities.c, DpTrace.c, and DpProfile.c are included here.

Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
-  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+  (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
which accompanies this distribution.  The full text of the license may be 
found at
@@ -215,8 +215,11 @@ GatherStatistics(
@param[in]Limit   The number of records to print.  Zero is ALL.
@param[in]ExcludeFlag TRUE to exclude individual Cumulative items from 
display.

+  @retval EFI_SUCCESS   The operation was successful.
+  @retval EFI_ABORTED   The user aborts the operation.
+  @return Othersfrom a call to gBS->LocateHandleBuffer().
  **/
-VOID
+EFI_STATUS
  DumpAllTrace(
IN UINTN Limit,
IN BOOLEAN   ExcludeFlag
@@ -238,9 +241,11 @@ DumpAllTrace(

@param[in]Limit   The number of records to print.  Zero is ALL.
@param[in]ExcludeFlag TRUE to exclude individual Cumulative items from 
display.
-
+
+  @retval EFI_SUCCESS   The operation was successful.
+  @retval EFI_ABORTED   The user aborts the operation.
  **/
-VOID
+EFI_STATUS
  DumpRawTrace(
IN UINTN  Limit,
IN BOOLEANExcludeFlag
@@ -262,8 +267,10 @@