PerformancePkg/Dp_App: Support execution break

Support UEFI shell execution break.

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: Samer EL-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Cinnamon Shia
2016-03-07 11:23:07 +08:00
committed by Star Zeng
parent efef6ad6d7
commit 3e9de670ec
3 changed files with 99 additions and 26 deletions

View File

@ -136,8 +136,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 Others from a call to gBS->LocateHandleBuffer().
**/
VOID
EFI_STATUS
DumpAllTrace(
IN UINTN Limit,
IN BOOLEAN ExcludeFlag
@ -257,12 +260,17 @@ DumpAllTrace(
ElapsedTime
);
}
if (ShellGetExecutionBreakFlag ()) {
Status = EFI_ABORTED;
break;
}
}
}
if (HandleBuffer != NULL) {
FreePool (HandleBuffer);
}
SafeFreePool ((VOID *) IncFlag);
return Status;
}
/**
@ -281,9 +289,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 BOOLEAN ExcludeFlag
@ -298,6 +308,9 @@ DumpRawTrace(
EFI_STRING StringPtr;
EFI_STRING StringPtrUnknown;
EFI_STATUS Status;
Status = EFI_SUCCESS;
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_RAWTRACE), NULL);
@ -361,7 +374,12 @@ DumpRawTrace(
Measurement.Module
);
}
if (ShellGetExecutionBreakFlag ()) {
Status = EFI_ABORTED;
break;
}
}
return Status;
}
/**
@ -509,8 +527,10 @@ ProcessPhases(
Gather and print Handle data.
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
@return Status from a call to gBS->LocateHandle().
@retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The user aborts the operation.
@return Others from a call to gBS->LocateHandleBuffer().
**/
EFI_STATUS
ProcessHandles(
@ -608,6 +628,10 @@ ProcessHandles(
);
}
}
if (ShellGetExecutionBreakFlag ()) {
Status = EFI_ABORTED;
break;
}
}
}
if (HandleBuffer != NULL) {
@ -620,9 +644,11 @@ ProcessHandles(
Gather and print PEIM data.
Only prints complete PEIM records
@retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The user aborts the operation.
**/
VOID
EFI_STATUS
ProcessPeims(
VOID
)
@ -634,6 +660,9 @@ ProcessPeims(
UINTN LogEntryKey;
UINTN TIndex;
EFI_STRING StringPtrUnknown;
EFI_STATUS Status;
Status = EFI_SUCCESS;
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_PEIMS), NULL);
@ -687,7 +716,12 @@ ProcessPeims(
);
}
}
if (ShellGetExecutionBreakFlag ()) {
Status = EFI_ABORTED;
break;
}
}
return Status;
}
/**
@ -697,9 +731,11 @@ ProcessPeims(
Only prints records where Handle is NULL
Increment TIndex for every record, even skipped ones, so that we have an
indication of every measurement record taken.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The user aborts the operation.
**/
VOID
EFI_STATUS
ProcessGlobal(
VOID
)
@ -711,6 +747,9 @@ ProcessGlobal(
UINTN LogEntryKey;
UINTN Index; // Index, or number, of the measurement record being processed
EFI_STRING StringPtrUnknown;
EFI_STATUS Status;
Status = EFI_SUCCESS;
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_GENERAL), NULL);
@ -770,8 +809,13 @@ ProcessGlobal(
}
}
}
if (ShellGetExecutionBreakFlag ()) {
Status = EFI_ABORTED;
break;
}
Index++;
}
return Status;
}
/**