/** @file\r
Trace reporting for the Dp utility.\r
\r
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.\r
- (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.\r
+ (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
@param[in] Limit The number of records to print. Zero is ALL.\r
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
\r
+ @retval EFI_SUCCESS The operation was successful.\r
+ @retval EFI_ABORTED The user aborts the operation.\r
+ @return Others from a call to gBS->LocateHandleBuffer().\r
**/\r
-VOID\r
+EFI_STATUS\r
DumpAllTrace(\r
IN UINTN Limit,\r
IN BOOLEAN ExcludeFlag\r
UINTN TIndex;\r
\r
EFI_HANDLE *HandleBuffer;\r
- UINTN Size;\r
- EFI_HANDLE TempHandle;\r
+ UINTN HandleCount;\r
EFI_STATUS Status;\r
EFI_STRING StringPtrUnknown;\r
\r
\r
// Get Handle information\r
//\r
- Size = 0;\r
- HandleBuffer = &TempHandle;\r
- Status = gBS->LocateHandle (AllHandles, NULL, NULL, &Size, &TempHandle);\r
- if (Status == EFI_BUFFER_TOO_SMALL) {\r
- HandleBuffer = AllocatePool (Size);\r
- ASSERT (HandleBuffer != NULL);\r
- if (HandleBuffer == NULL) {\r
- return;\r
- }\r
- Status = gBS->LocateHandle (AllHandles, NULL, NULL, &Size, HandleBuffer);\r
- }\r
+ Status = gBS->LocateHandleBuffer (AllHandles, NULL, NULL, &HandleCount, &HandleBuffer);\r
if (EFI_ERROR (Status)) {\r
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_HANDLES_ERROR), gDpHiiHandle, Status);\r
}\r
AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);\r
if (Measurement.Handle != NULL) {\r
// See if the Handle is in the HandleBuffer\r
- for (TIndex = 0; TIndex < (Size / sizeof(HandleBuffer[0])); TIndex++) {\r
+ for (TIndex = 0; TIndex < HandleCount; TIndex++) {\r
if (Measurement.Handle == HandleBuffer[TIndex]) {\r
DpGetNameFromHandle (HandleBuffer[TIndex]);\r
break;\r
ElapsedTime\r
);\r
}\r
+ if (ShellGetExecutionBreakFlag ()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
}\r
}\r
- if (HandleBuffer != &TempHandle) {\r
+ if (HandleBuffer != NULL) {\r
FreePool (HandleBuffer);\r
}\r
SHELL_FREE_NON_NULL (IncFlag);\r
+\r
+ return Status;\r
}\r
\r
/** \r
\r
@param[in] Limit The number of records to print. Zero is ALL.\r
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
- \r
+\r
+ @retval EFI_SUCCESS The operation was successful.\r
+ @retval EFI_ABORTED The user aborts the operation.\r
**/\r
-VOID\r
+EFI_STATUS\r
DumpRawTrace(\r
IN UINTN Limit,\r
IN BOOLEAN ExcludeFlag\r
\r
EFI_STRING StringPtr;\r
EFI_STRING StringPtrUnknown;\r
+ EFI_STATUS Status;\r
+\r
+ Status = EFI_SUCCESS;\r
\r
StringPtrUnknown = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL); \r
StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_SECTION_RAWTRACE), NULL);\r
Measurement.Module\r
);\r
}\r
+ if (ShellGetExecutionBreakFlag ()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
}\r
+ return Status;\r
}\r
\r
/** \r
\r
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
\r
- @return Status from a call to gBS->LocateHandle().\r
+ @retval EFI_SUCCESS The operation was successful.\r
+ @retval EFI_ABORTED The user aborts the operation.\r
+ @return Others from a call to gBS->LocateHandleBuffer().\r
**/\r
EFI_STATUS\r
ProcessHandles(\r
UINTN Index;\r
UINTN LogEntryKey;\r
UINTN Count;\r
- UINTN Size;\r
- EFI_HANDLE TempHandle;\r
+ UINTN HandleCount;\r
EFI_STATUS Status;\r
EFI_STRING StringPtrUnknown;\r
\r
FreePool (StringPtr);\r
FreePool (StringPtrUnknown);\r
\r
- Size = 0;\r
- HandleBuffer = &TempHandle;\r
- Status = gBS->LocateHandle (AllHandles, NULL, NULL, &Size, &TempHandle);\r
- if (Status == EFI_BUFFER_TOO_SMALL) {\r
- HandleBuffer = AllocatePool (Size);\r
- ASSERT (HandleBuffer != NULL);\r
- if (HandleBuffer == NULL) {\r
- return Status;\r
- }\r
- Status = gBS->LocateHandle (AllHandles, NULL, NULL, &Size, HandleBuffer);\r
- }\r
+ Status = gBS->LocateHandleBuffer (AllHandles, NULL, NULL, &HandleCount, &HandleBuffer);\r
if (EFI_ERROR (Status)) {\r
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_HANDLES_ERROR), gDpHiiHandle, Status);\r
}\r
mGaugeString[0] = 0; // Empty driver name by default\r
AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);\r
// See if the Handle is in the HandleBuffer\r
- for (Index = 0; Index < (Size / sizeof(HandleBuffer[0])); Index++) {\r
+ for (Index = 0; Index < HandleCount; Index++) {\r
if (Measurement.Handle == HandleBuffer[Index]) {\r
DpGetNameFromHandle (HandleBuffer[Index]); // Name is put into mGaugeString\r
break;\r
);\r
}\r
}\r
+ if (ShellGetExecutionBreakFlag ()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
}\r
}\r
- if (HandleBuffer != &TempHandle) {\r
+ if (HandleBuffer != NULL) {\r
FreePool (HandleBuffer);\r
}\r
return Status;\r
\r
Only prints complete PEIM records\r
\r
+ @retval EFI_SUCCESS The operation was successful.\r
+ @retval EFI_ABORTED The user aborts the operation.\r
**/\r
-VOID\r
+EFI_STATUS\r
ProcessPeims(\r
VOID\r
)\r
UINTN LogEntryKey;\r
UINTN TIndex;\r
EFI_STRING StringPtrUnknown;\r
+ EFI_STATUS Status;\r
+\r
+ Status = EFI_SUCCESS;\r
\r
StringPtrUnknown = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL); \r
StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_SECTION_PEIMS), NULL);\r
);\r
}\r
}\r
+ if (ShellGetExecutionBreakFlag ()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
}\r
+ return Status;\r
}\r
\r
/** \r
Increment TIndex for every record, even skipped ones, so that we have an\r
indication of every measurement record taken.\r
\r
+ @retval EFI_SUCCESS The operation was successful.\r
+ @retval EFI_ABORTED The user aborts the operation.\r
**/\r
-VOID\r
+EFI_STATUS\r
ProcessGlobal(\r
VOID\r
)\r
UINTN LogEntryKey;\r
UINTN Index; // Index, or number, of the measurement record being processed\r
EFI_STRING StringPtrUnknown;\r
+ EFI_STATUS Status;\r
+\r
+ Status = EFI_SUCCESS;\r
\r
StringPtrUnknown = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL); \r
StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_SECTION_GENERAL), NULL);\r
}\r
}\r
}\r
+ if (ShellGetExecutionBreakFlag ()) {\r
+ Status = EFI_ABORTED;\r
+ break;\r
+ }\r
Index++;\r
}\r
+ return Status;\r
}\r
\r
/** \r