TianoCore EDK2 master
|
#include <Uefi.h>
#include <PiDxe.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/DebugLib.h>
#include <Library/DxeServicesLib.h>
#include <Library/PrintLib.h>
#include <Protocol/SmmCommunication.h>
#include <Protocol/SmmAccess2.h>
#include <Guid/MemoryProfile.h>
#include <Guid/PiSmmCommunicationRegionTable.h>
Go to the source code of this file.
Data Structures | |
struct | ACTION_STRING |
struct | MEMORY_PROFILE_ALLOC_SUMMARY_INFO |
struct | MEMORY_PROFILE_ALLOC_SUMMARY_INFO_DATA |
struct | MEMORY_PROFILE_DRIVER_SUMMARY_INFO_DATA |
struct | MEMORY_PROFILE_CONTEXT_SUMMARY_DATA |
Macros | |
#define | PROFILE_NAME_STRING_LENGTH 64 |
#define | MEMORY_PROFILE_ALLOC_SUMMARY_INFO_SIGNATURE SIGNATURE_32 ('M','P','A','S') |
#define | MEMORY_PROFILE_ALLOC_SUMMARY_INFO_REVISION 0x0001 |
Variables | |
CHAR8 * | mActionString [] |
CHAR8 * | mSmmActionString [] |
ACTION_STRING | mExtActionString [] |
CHAR8 | mUserDefinedActionString [] = { "UserDefined-0x80000000" } |
CHAR8 * | mMemoryTypeString [] |
CHAR8 * | mSubsystemString [] |
CHAR8 * | mFileTypeString [] |
CHAR8 | mNameString [PROFILE_NAME_STRING_LENGTH+1] |
LIST_ENTRY | mImageSummaryQueue = INITIALIZE_LIST_HEAD_VARIABLE (mImageSummaryQueue) |
MEMORY_PROFILE_CONTEXT_SUMMARY_DATA | mMemoryProfileContextSummary |
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MemoryProfileInfo.c.
#define MEMORY_PROFILE_ALLOC_SUMMARY_INFO_REVISION 0x0001 |
Definition at line 137 of file MemoryProfileInfo.c.
#define MEMORY_PROFILE_ALLOC_SUMMARY_INFO_SIGNATURE SIGNATURE_32 ('M','P','A','S') |
Definition at line 136 of file MemoryProfileInfo.c.
#define PROFILE_NAME_STRING_LENGTH 64 |
Definition at line 130 of file MemoryProfileInfo.c.
MEMORY_PROFILE_ALLOC_INFO * CreateAllocSummaryInfo | ( | IN OUT MEMORY_PROFILE_DRIVER_SUMMARY_INFO_DATA * | DriverSummaryInfoData, |
IN MEMORY_PROFILE_ALLOC_INFO * | AllocInfo | ||
) |
Create Allocate summary information structure and link to Driver summary information data structure.
[in,out] | DriverSummaryInfoData | Driver summary information data structure. |
[in] | AllocInfo | Pointer to memory profile alloc info. |
Definition at line 770 of file MemoryProfileInfo.c.
MEMORY_PROFILE_CONTEXT_SUMMARY_DATA * CreateContextSummaryData | ( | IN PHYSICAL_ADDRESS | ProfileBuffer, |
IN UINT64 | ProfileSize | ||
) |
Create Context summary information structure.
[in] | ProfileBuffer | Memory profile base address. |
[in] | ProfileSize | Memory profile size. |
Definition at line 870 of file MemoryProfileInfo.c.
MEMORY_PROFILE_DRIVER_INFO * CreateDriverSummaryInfo | ( | IN OUT MEMORY_PROFILE_CONTEXT_SUMMARY_DATA * | ContextSummaryData, |
IN MEMORY_PROFILE_DRIVER_INFO * | DriverInfo | ||
) |
Create Driver summary information structure and link to Context summary information data structure.
[in,out] | ContextSummaryData | Context summary information data structure. |
[in] | DriverInfo | Pointer to memory profile driver info. |
Definition at line 825 of file MemoryProfileInfo.c.
VOID DestroyContextSummaryData | ( | IN OUT MEMORY_PROFILE_CONTEXT_SUMMARY_DATA * | ContextSummaryData | ) |
Destroy Context summary information.
[in,out] | ContextSummaryData | Context summary information data. |
Definition at line 991 of file MemoryProfileInfo.c.
VOID DumpContextSummaryData | ( | IN MEMORY_PROFILE_CONTEXT_SUMMARY_DATA * | ContextSummaryData, |
IN BOOLEAN | IsForSmm | ||
) |
Dump Context summary information.
[in] | ContextSummaryData | Context summary information data. |
[in] | IsForSmm | TRUE - SMRAM profile. FALSE - UEFI memory profile. |
Definition at line 908 of file MemoryProfileInfo.c.
VOID DumpMemoryProfile | ( | IN PHYSICAL_ADDRESS | ProfileBuffer, |
IN UINT64 | ProfileSize, | ||
IN BOOLEAN | IsForSmm | ||
) |
Dump memory profile information.
[in] | ProfileBuffer | Memory profile base address. |
[in] | ProfileSize | Memory profile size. |
[in] | IsForSmm | TRUE - SMRAM profile. FALSE - UEFI memory profile. |
Definition at line 692 of file MemoryProfileInfo.c.
MEMORY_PROFILE_ALLOC_INFO * DumpMemoryProfileAllocInfo | ( | IN MEMORY_PROFILE_DRIVER_INFO * | DriverInfo, |
IN UINTN | AllocIndex, | ||
IN MEMORY_PROFILE_ALLOC_INFO * | AllocInfo, | ||
IN BOOLEAN | IsForSmm | ||
) |
Dump memory profile allocate information.
[in] | DriverInfo | Pointer to memory profile driver info. |
[in] | AllocIndex | Memory profile alloc info index. |
[in] | AllocInfo | Pointer to memory profile alloc info. |
[in] | IsForSmm | TRUE - SMRAM profile. FALSE - UEFI memory profile. |
Definition at line 384 of file MemoryProfileInfo.c.
VOID * DumpMemoryProfileContext | ( | IN MEMORY_PROFILE_CONTEXT * | Context, |
IN BOOLEAN | IsForSmm | ||
) |
Dump memory profile context information.
[in] | Context | Pointer to memory profile context. |
[in] | IsForSmm | TRUE - SMRAM profile. FALSE - UEFI memory profile. |
Definition at line 494 of file MemoryProfileInfo.c.
MEMORY_PROFILE_DESCRIPTOR * DumpMemoryProfileDescriptor | ( | IN UINTN | DescriptorIndex, |
IN MEMORY_PROFILE_DESCRIPTOR * | Descriptor | ||
) |
Dump memory profile descriptor information.
[in] | DescriptorIndex | Memory profile descriptor index. |
[in] | Descriptor | Pointer to memory profile descriptor. |
Definition at line 547 of file MemoryProfileInfo.c.
MEMORY_PROFILE_DRIVER_INFO * DumpMemoryProfileDriverInfo | ( | IN UINTN | DriverIndex, |
IN MEMORY_PROFILE_DRIVER_INFO * | DriverInfo, | ||
IN BOOLEAN | IsForSmm | ||
) |
Dump memory profile driver information.
[in] | DriverIndex | Memory profile driver info index. |
[in] | DriverInfo | Pointer to memory profile driver info. |
[in] | IsForSmm | TRUE - SMRAM profile. FALSE - UEFI memory profile. |
Definition at line 429 of file MemoryProfileInfo.c.
VOID * DumpMemoryProfileFreeMemory | ( | IN MEMORY_PROFILE_FREE_MEMORY * | FreeMemory | ) |
Dump memory profile free memory information.
[in] | FreeMemory | Pointer to memory profile free memory. |
Definition at line 575 of file MemoryProfileInfo.c.
VOID * DumpMemoryProfileMemoryRange | ( | IN MEMORY_PROFILE_MEMORY_RANGE * | MemoryRange | ) |
Dump memory profile memory range information.
[in] | MemoryRange | Pointer to memory profile memory range. |
Definition at line 613 of file MemoryProfileInfo.c.
MEMORY_PROFILE_ALLOC_SUMMARY_INFO_DATA * GetAllocSummaryInfoByCallerAddress | ( | IN PHYSICAL_ADDRESS | CallerAddress, |
IN MEMORY_PROFILE_DRIVER_SUMMARY_INFO_DATA * | DriverSummaryInfoData | ||
) |
Get Allocate summary information structure by caller address.
[in] | CallerAddress | Caller address. |
[in] | DriverSummaryInfoData | Driver summary information data structure. |
Definition at line 728 of file MemoryProfileInfo.c.
CHAR8 * GetDriverNameString | ( | IN MEMORY_PROFILE_DRIVER_INFO * | DriverInfo | ) |
Get a human readable name for an image. The following methods will be tried orderly:
[in] | DriverInfo | Pointer to memory profile driver info. |
Definition at line 237 of file MemoryProfileInfo.c.
Get the file name portion of the Pdb File Name.
The portion of the Pdb File Name between the last backslash and either a following period or the end of the string is copied into AsciiBuffer. The name is truncated, if necessary, to ensure that AsciiBuffer is not overrun.
[in] | PdbFileName | Pdb file name. |
[out] | AsciiBuffer | The resultant Ascii File Name. |
Definition at line 183 of file MemoryProfileInfo.c.
EFI_STATUS GetSmramProfileData | ( | VOID | ) |
Get and dump SMRAM profile data.
Definition at line 1144 of file MemoryProfileInfo.c.
EFI_STATUS GetUefiMemoryProfileData | ( | VOID | ) |
Get and dump UEFI memory profile data.
Definition at line 1051 of file MemoryProfileInfo.c.
CHAR8 * ProfileActionToStr | ( | IN MEMORY_PROFILE_ACTION | Action, |
IN CHAR8 * | UserDefinedActionString, | ||
IN BOOLEAN | IsForSmm | ||
) |
Action to string.
[in] | Action | Profile action. |
[in] | UserDefinedActionString | Pointer to user defined action string. |
[in] | IsForSmm | TRUE - SMRAM profile. FALSE - UEFI memory profile. |
Definition at line 331 of file MemoryProfileInfo.c.
CHAR8 * ProfileMemoryTypeToStr | ( | IN EFI_MEMORY_TYPE | MemoryType | ) |
Memory type to string.
[in] | MemoryType | Memory type. |
Definition at line 296 of file MemoryProfileInfo.c.
VOID * ScanMemoryProfileBySignature | ( | IN PHYSICAL_ADDRESS | ProfileBuffer, |
IN UINT64 | ProfileSize, | ||
IN UINT32 | Signature | ||
) |
Scan memory profile by Signature.
[in] | ProfileBuffer | Memory profile base address. |
[in] | ProfileSize | Memory profile size. |
[in] | Signature | Signature. |
Definition at line 652 of file MemoryProfileInfo.c.
EFI_STATUS EFIAPI UefiMain | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The user Entry Point for Application. The user code starts with this function as the real entry point for the image goes into a library that calls this function.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
other | Some error occurs when executing this entry point. |
Definition at line 1395 of file MemoryProfileInfo.c.
CHAR8* mActionString[] |
Definition at line 27 of file MemoryProfileInfo.c.
ACTION_STRING mExtActionString[] |
Definition at line 48 of file MemoryProfileInfo.c.
CHAR8* mFileTypeString[] |
Definition at line 113 of file MemoryProfileInfo.c.
LIST_ENTRY mImageSummaryQueue = INITIALIZE_LIST_HEAD_VARIABLE (mImageSummaryQueue) |
Definition at line 167 of file MemoryProfileInfo.c.
MEMORY_PROFILE_CONTEXT_SUMMARY_DATA mMemoryProfileContextSummary |
Definition at line 168 of file MemoryProfileInfo.c.
CHAR8* mMemoryTypeString[] |
Definition at line 74 of file MemoryProfileInfo.c.
CHAR8 mNameString[PROFILE_NAME_STRING_LENGTH+1] |
Definition at line 131 of file MemoryProfileInfo.c.
CHAR8* mSmmActionString[] |
Definition at line 35 of file MemoryProfileInfo.c.
CHAR8* mSubsystemString[] |
Definition at line 94 of file MemoryProfileInfo.c.
CHAR8 mUserDefinedActionString[] = { "UserDefined-0x80000000" } |
Definition at line 72 of file MemoryProfileInfo.c.