mirror of https://github.com/acidanthera/audk.git
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:
parent
efef6ad6d7
commit
3e9de670ec
|
@ -14,7 +14,7 @@
|
||||||
timer information to calculate elapsed time for each measurement.
|
timer information to calculate elapsed time for each measurement.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
|
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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] ImageHandle The image handle.
|
||||||
@param[in] SystemTable The system table.
|
@param[in] SystemTable The system table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Command completed successfully.
|
@retval EFI_SUCCESS Command completed successfully.
|
||||||
@retval EFI_INVALID_PARAMETER Command usage error.
|
@retval EFI_INVALID_PARAMETER Command usage error.
|
||||||
|
@retval EFI_ABORTED The user aborts the operation.
|
||||||
@retval value Unknown error.
|
@retval value Unknown error.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
|
@ -443,7 +443,10 @@ InitializeDp (
|
||||||
ProcessCumulative (CustomCumulativeData);
|
ProcessCumulative (CustomCumulativeData);
|
||||||
} else if (AllMode) {
|
} else if (AllMode) {
|
||||||
if (TraceMode) {
|
if (TraceMode) {
|
||||||
DumpAllTrace( Number2Display, ExcludeMode);
|
Status = DumpAllTrace( Number2Display, ExcludeMode);
|
||||||
|
if (Status == EFI_ABORTED) {
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ProfileMode) {
|
if (ProfileMode) {
|
||||||
DumpAllProfile( Number2Display, ExcludeMode);
|
DumpAllProfile( Number2Display, ExcludeMode);
|
||||||
|
@ -451,7 +454,10 @@ InitializeDp (
|
||||||
}
|
}
|
||||||
else if (RawMode) {
|
else if (RawMode) {
|
||||||
if (TraceMode) {
|
if (TraceMode) {
|
||||||
DumpRawTrace( Number2Display, ExcludeMode);
|
Status = DumpRawTrace( Number2Display, ExcludeMode);
|
||||||
|
if (Status == EFI_ABORTED) {
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ProfileMode) {
|
if (ProfileMode) {
|
||||||
DumpRawProfile( Number2Display, ExcludeMode);
|
DumpRawProfile( Number2Display, ExcludeMode);
|
||||||
|
@ -463,11 +469,21 @@ InitializeDp (
|
||||||
ProcessPhases ( Ticker );
|
ProcessPhases ( Ticker );
|
||||||
if ( ! SummaryMode) {
|
if ( ! SummaryMode) {
|
||||||
Status = ProcessHandles ( ExcludeMode);
|
Status = ProcessHandles ( ExcludeMode);
|
||||||
if ( ! EFI_ERROR( Status)) {
|
if (Status == EFI_ABORTED) {
|
||||||
ProcessPeims ( );
|
goto Done;
|
||||||
ProcessGlobal ( );
|
|
||||||
ProcessCumulative (NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status = ProcessPeims ();
|
||||||
|
if (Status == EFI_ABORTED) {
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = ProcessGlobal ();
|
||||||
|
if (Status == EFI_ABORTED) {
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessCumulative (NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ProfileMode) {
|
if (ProfileMode) {
|
||||||
|
@ -480,6 +496,8 @@ InitializeDp (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Done:
|
||||||
|
|
||||||
//
|
//
|
||||||
// Free the memory allocate from HiiGetString
|
// Free the memory allocate from HiiGetString
|
||||||
//
|
//
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
DpUtilities.c, DpTrace.c, and DpProfile.c are included here.
|
DpUtilities.c, DpTrace.c, and DpProfile.c are included here.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
|
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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] Limit The number of records to print. Zero is ALL.
|
||||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
@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(
|
DumpAllTrace(
|
||||||
IN UINTN Limit,
|
IN UINTN Limit,
|
||||||
IN BOOLEAN ExcludeFlag
|
IN BOOLEAN ExcludeFlag
|
||||||
|
@ -238,9 +241,11 @@ DumpAllTrace(
|
||||||
|
|
||||||
@param[in] Limit The number of records to print. Zero is ALL.
|
@param[in] Limit The number of records to print. Zero is ALL.
|
||||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
@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(
|
DumpRawTrace(
|
||||||
IN UINTN Limit,
|
IN UINTN Limit,
|
||||||
IN BOOLEAN ExcludeFlag
|
IN BOOLEAN ExcludeFlag
|
||||||
|
@ -262,8 +267,10 @@ ProcessPhases(
|
||||||
Gather and print Handle data.
|
Gather and print Handle data.
|
||||||
|
|
||||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
@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
|
EFI_STATUS
|
||||||
ProcessHandles(
|
ProcessHandles(
|
||||||
|
@ -276,8 +283,10 @@ ProcessHandles(
|
||||||
|
|
||||||
Only prints complete PEIM records
|
Only prints complete PEIM records
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The operation was successful.
|
||||||
|
@retval EFI_ABORTED The user aborts the operation.
|
||||||
**/
|
**/
|
||||||
VOID
|
EFI_STATUS
|
||||||
ProcessPeims(
|
ProcessPeims(
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
@ -290,8 +299,10 @@ ProcessPeims(
|
||||||
Increment TIndex for every record, even skipped ones, so that we have an
|
Increment TIndex for every record, even skipped ones, so that we have an
|
||||||
indication of every measurement record taken.
|
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(
|
ProcessGlobal(
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
|
@ -136,8 +136,11 @@ GatherStatistics(
|
||||||
@param[in] Limit The number of records to print. Zero is ALL.
|
@param[in] Limit The number of records to print. Zero is ALL.
|
||||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
@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(
|
DumpAllTrace(
|
||||||
IN UINTN Limit,
|
IN UINTN Limit,
|
||||||
IN BOOLEAN ExcludeFlag
|
IN BOOLEAN ExcludeFlag
|
||||||
|
@ -257,12 +260,17 @@ DumpAllTrace(
|
||||||
ElapsedTime
|
ElapsedTime
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (ShellGetExecutionBreakFlag ()) {
|
||||||
|
Status = EFI_ABORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (HandleBuffer != NULL) {
|
if (HandleBuffer != NULL) {
|
||||||
FreePool (HandleBuffer);
|
FreePool (HandleBuffer);
|
||||||
}
|
}
|
||||||
SafeFreePool ((VOID *) IncFlag);
|
SafeFreePool ((VOID *) IncFlag);
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -281,9 +289,11 @@ DumpAllTrace(
|
||||||
|
|
||||||
@param[in] Limit The number of records to print. Zero is ALL.
|
@param[in] Limit The number of records to print. Zero is ALL.
|
||||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
@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(
|
DumpRawTrace(
|
||||||
IN UINTN Limit,
|
IN UINTN Limit,
|
||||||
IN BOOLEAN ExcludeFlag
|
IN BOOLEAN ExcludeFlag
|
||||||
|
@ -298,6 +308,9 @@ DumpRawTrace(
|
||||||
|
|
||||||
EFI_STRING StringPtr;
|
EFI_STRING StringPtr;
|
||||||
EFI_STRING StringPtrUnknown;
|
EFI_STRING StringPtrUnknown;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
|
|
||||||
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
|
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
|
||||||
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_RAWTRACE), NULL);
|
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_RAWTRACE), NULL);
|
||||||
|
@ -361,7 +374,12 @@ DumpRawTrace(
|
||||||
Measurement.Module
|
Measurement.Module
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (ShellGetExecutionBreakFlag ()) {
|
||||||
|
Status = EFI_ABORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -509,8 +527,10 @@ ProcessPhases(
|
||||||
Gather and print Handle data.
|
Gather and print Handle data.
|
||||||
|
|
||||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
@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
|
EFI_STATUS
|
||||||
ProcessHandles(
|
ProcessHandles(
|
||||||
|
@ -608,6 +628,10 @@ ProcessHandles(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ShellGetExecutionBreakFlag ()) {
|
||||||
|
Status = EFI_ABORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (HandleBuffer != NULL) {
|
if (HandleBuffer != NULL) {
|
||||||
|
@ -620,9 +644,11 @@ ProcessHandles(
|
||||||
Gather and print PEIM data.
|
Gather and print PEIM data.
|
||||||
|
|
||||||
Only prints complete PEIM records
|
Only prints complete PEIM records
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The operation was successful.
|
||||||
|
@retval EFI_ABORTED The user aborts the operation.
|
||||||
**/
|
**/
|
||||||
VOID
|
EFI_STATUS
|
||||||
ProcessPeims(
|
ProcessPeims(
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
|
@ -634,6 +660,9 @@ ProcessPeims(
|
||||||
UINTN LogEntryKey;
|
UINTN LogEntryKey;
|
||||||
UINTN TIndex;
|
UINTN TIndex;
|
||||||
EFI_STRING StringPtrUnknown;
|
EFI_STRING StringPtrUnknown;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
|
|
||||||
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
|
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
|
||||||
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_PEIMS), 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
|
Only prints records where Handle is NULL
|
||||||
Increment TIndex for every record, even skipped ones, so that we have an
|
Increment TIndex for every record, even skipped ones, so that we have an
|
||||||
indication of every measurement record taken.
|
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(
|
ProcessGlobal(
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
|
@ -711,6 +747,9 @@ ProcessGlobal(
|
||||||
UINTN LogEntryKey;
|
UINTN LogEntryKey;
|
||||||
UINTN Index; // Index, or number, of the measurement record being processed
|
UINTN Index; // Index, or number, of the measurement record being processed
|
||||||
EFI_STRING StringPtrUnknown;
|
EFI_STRING StringPtrUnknown;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
|
|
||||||
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
|
StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);
|
||||||
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_GENERAL), NULL);
|
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_GENERAL), NULL);
|
||||||
|
@ -770,8 +809,13 @@ ProcessGlobal(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ShellGetExecutionBreakFlag ()) {
|
||||||
|
Status = EFI_ABORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue