X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=PerformancePkg%2FDp_App%2FDpInternal.h;h=1ab36ba7ede9d3ad5c40a47e7dde25f9b232bae1;hp=d2454060bcbd8ddb5835a752c1e79f9d08636954;hb=1393510;hpb=cbdf19a53e502ed4824c587f6b19e8f138032875 diff --git a/PerformancePkg/Dp_App/DpInternal.h b/PerformancePkg/Dp_App/DpInternal.h index d2454060bc..1ab36ba7ed 100644 --- a/PerformancePkg/Dp_App/DpInternal.h +++ b/PerformancePkg/Dp_App/DpInternal.h @@ -1,30 +1,35 @@ /** @file - * Declarations of objects defined internally to the Dp Application. - * - * Declarations of data and functions which are private to the Dp application. - * This file should never be referenced by anything other than components of the - * Dp application. In addition to global data, function declarations for - * DpUtilities.c, DpTrace.c, and DpProfile.c are included here. - * - * Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
- * 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 - * http://opensource.org/licenses/bsd-license.php - * - * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Declarations of objects defined internally to the Dp Application. + + Declarations of data and functions which are private to the Dp application. + This file should never be referenced by anything other than components of the + Dp application. In addition to global data, function declarations for + DpUtilities.c, DpTrace.c, and DpProfile.c are included here. + + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ (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 + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _DP_INTELNAL_H_ #define _DP_INTELNAL_H_ + +#define DP_GAUGE_STRING_LENGTH 36 + // /// Module-Global Variables ///@{ extern EFI_HII_HANDLE gHiiHandle; extern CHAR16 *mPrintTokenBuffer; -extern CHAR16 mGaugeString[DXE_PERFORMANCE_STRING_SIZE]; -extern CHAR16 mUnicodeToken[PERF_TOKEN_LENGTH + 1]; +extern CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH + 1]; +extern CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE]; extern UINT64 mInterestThreshold; +extern BOOLEAN mShowId; extern PERF_SUMMARY_DATA SummaryData; ///< Create the SummaryData structure and init. to ZERO. @@ -100,6 +105,13 @@ GetShortPdbFileName ( /** Get a human readable name for an image handle. + The following methods will be tried orderly: + 1. Image PDB + 2. ComponentName2 protocol + 3. FFS UI section + 4. Image GUID + 5. Image DevicePath + 6. Unknown Driver Name @param[in] Handle @@ -140,6 +152,7 @@ DurationInMicroSeconds ( **/ UINTN +EFIAPI PrintToken ( IN UINT16 Token, ... @@ -176,10 +189,13 @@ GetCumulativeItem( @post The SummaryData and CumData structures contain statistics for the current performance logs. + + @param[in, out] CustomCumulativeData The pointer to the custom cumulative data. + **/ VOID GatherStatistics( - VOID + IN OUT PERF_CUM_DATA *CustomCumulativeData OPTIONAL ); /** @@ -199,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 Others from a call to gBS->LocateHandleBuffer(). **/ -VOID +EFI_STATUS DumpAllTrace( IN UINTN Limit, IN BOOLEAN ExcludeFlag @@ -222,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 BOOLEAN ExcludeFlag @@ -233,12 +254,10 @@ DumpRawTrace( /** Gather and print Major Phase metrics. - @param[in] Ticker The timer value for the END of Shell phase - **/ VOID ProcessPhases( - IN UINT64 Ticker + VOID ); @@ -246,8 +265,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( @@ -260,8 +281,10 @@ ProcessHandles( 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 ); @@ -274,8 +297,10 @@ ProcessPeims( 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 ); @@ -287,11 +312,13 @@ ProcessGlobal( For each record with a Token listed in the CumData array:
- Update the instance count and the total, minimum, and maximum durations. Finally, print the gathered cumulative statistics. + + @param[in] CustomCumulativeData The pointer to the custom cumulative data. **/ VOID ProcessCumulative( - VOID + IN PERF_CUM_DATA *CustomCumulativeData OPTIONAL ); /** @@ -341,4 +368,16 @@ DumpRawProfile( IN UINTN Limit, IN BOOLEAN ExcludeFlag ); + +/** + Wrap original FreePool to check NULL pointer first. + + @param[in] Buffer The pointer to the buffer to free. + +**/ +VOID +SafeFreePool ( + IN VOID *Buffer + ); + #endif