MdeModulePkg[all]  0.98
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MemoryProfile.h File Reference

Data Structures

struct  MEMORY_PROFILE_COMMON_HEADER
 
struct  MEMORY_PROFILE_CONTEXT
 
struct  MEMORY_PROFILE_DRIVER_INFO
 
struct  MEMORY_PROFILE_ALLOC_INFO
 
struct  MEMORY_PROFILE_DESCRIPTOR
 
struct  MEMORY_PROFILE_FREE_MEMORY
 
struct  MEMORY_PROFILE_MEMORY_RANGE
 
struct  _EDKII_MEMORY_PROFILE_PROTOCOL
 
struct  SMRAM_PROFILE_PARAMETER_HEADER
 
struct  SMRAM_PROFILE_PARAMETER_GET_PROFILE_INFO
 
struct  SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA
 
struct  SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA_BY_OFFSET
 
struct  SMRAM_PROFILE_PARAMETER_RECORDING_STATE
 
struct  SMRAM_PROFILE_PARAMETER_REGISTER_IMAGE
 
struct  SMRAM_PROFILE_PARAMETER_UNREGISTER_IMAGE
 

Macros

#define MEMORY_PROFILE_CONTEXT_SIGNATURE   SIGNATURE_32 ('M','P','C','T')
 
#define MEMORY_PROFILE_CONTEXT_REVISION   0x0002
 
#define MEMORY_PROFILE_DRIVER_INFO_SIGNATURE   SIGNATURE_32 ('M','P','D','I')
 
#define MEMORY_PROFILE_DRIVER_INFO_REVISION   0x0003
 
#define MEMORY_PROFILE_ACTION_BASIC_MASK   0xF
 
#define MEMORY_PROFILE_ACTION_EXTENSION_MASK   0xFFF0
 
#define MEMORY_PROFILE_ACTION_EXTENSION_LIB_MASK   0x8000
 
#define MEMORY_PROFILE_ACTION_EXTENSION_REALLOC_MASK   0x0200
 
#define MEMORY_PROFILE_ACTION_EXTENSION_COPY_MASK   0x0100
 
#define MEMORY_PROFILE_ACTION_EXTENSION_ZERO_MASK   0x0080
 
#define MEMORY_PROFILE_ACTION_EXTENSION_ALIGN_MASK   0x0040
 
#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_MASK   0x0030
 
#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_BASIC   0x0000
 
#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RUNTIME   0x0010
 
#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RESERVED   0x0020
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES   0x8001
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES   0x8011
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES   0x8021
 
#define MEMORY_PROFILE_ACTION_LIB_FREE_PAGES   0x8002
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_PAGES   0x8041
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RUNTIME_PAGES   0x8051
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RESERVED_PAGES   0x8061
 
#define MEMORY_PROFILE_ACTION_LIB_FREE_ALIGNED_PAGES   0x8042
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_POOL   0x8003
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_POOL   0x8013
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_POOL   0x8023
 
#define MEMORY_PROFILE_ACTION_LIB_FREE_POOL   0x8004
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ZERO_POOL   0x8083
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_ZERO_POOL   0x8093
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_ZERO_POOL   0x80a3
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_COPY_POOL   0x8103
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_COPY_POOL   0x8113
 
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_COPY_POOL   0x8123
 
#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_POOL   0x8203
 
#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RUNTIME_POOL   0x8213
 
#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL   0x8223
 
#define MEMORY_PROFILE_ACTION_USER_DEFINED_MASK   0x80000000
 
#define MEMORY_PROFILE_ALLOC_INFO_SIGNATURE   SIGNATURE_32 ('M','P','A','I')
 
#define MEMORY_PROFILE_ALLOC_INFO_REVISION   0x0002
 
#define MEMORY_PROFILE_DESCRIPTOR_SIGNATURE   SIGNATURE_32 ('M','P','D','R')
 
#define MEMORY_PROFILE_DESCRIPTOR_REVISION   0x0001
 
#define MEMORY_PROFILE_FREE_MEMORY_SIGNATURE   SIGNATURE_32 ('M','P','R','M')
 
#define MEMORY_PROFILE_FREE_MEMORY_REVISION   0x0001
 
#define MEMORY_PROFILE_MEMORY_RANGE_SIGNATURE   SIGNATURE_32 ('M','P','M','R')
 
#define MEMORY_PROFILE_MEMORY_RANGE_REVISION   0x0001
 
#define MEMORY_PROFILE_RECORDING_ENABLE   TRUE
 
#define MEMORY_PROFILE_RECORDING_DISABLE   FALSE
 
#define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO   0x1
 
#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA   0x2
 
#define SMRAM_PROFILE_COMMAND_DEPRECATED1   0x3
 
#define SMRAM_PROFILE_COMMAND_DEPRECATED2   0x4
 
#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET   0x5
 
#define SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE   0x6
 
#define SMRAM_PROFILE_COMMAND_SET_RECORDING_STATE   0x7
 
#define EDKII_MEMORY_PROFILE_GUID
 
#define EDKII_SMM_MEMORY_PROFILE_GUID
 

Typedefs

typedef struct
_EDKII_MEMORY_PROFILE_PROTOCOL 
EDKII_MEMORY_PROFILE_PROTOCOL
 
typedef EFI_STATUS(EFIAPI * EDKII_MEMORY_PROFILE_GET_DATA )(IN EDKII_MEMORY_PROFILE_PROTOCOL *This, IN OUT UINT64 *ProfileSize, OUT VOID *ProfileBuffer)
 
typedef EFI_STATUS(EFIAPI * EDKII_MEMORY_PROFILE_REGISTER_IMAGE )(IN EDKII_MEMORY_PROFILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN PHYSICAL_ADDRESS ImageBase, IN UINT64 ImageSize, IN EFI_FV_FILETYPE FileType)
 
typedef EFI_STATUS(EFIAPI * EDKII_MEMORY_PROFILE_UNREGISTER_IMAGE )(IN EDKII_MEMORY_PROFILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN PHYSICAL_ADDRESS ImageBase, IN UINT64 ImageSize)
 
typedef OUT BOOLEANRecordingState
 
typedef IN PHYSICAL_ADDRESS CallerAddress
 
typedef IN PHYSICAL_ADDRESS IN
MEMORY_PROFILE_ACTION 
Action
 
typedef IN PHYSICAL_ADDRESS IN
MEMORY_PROFILE_ACTION IN
EFI_MEMORY_TYPE 
MemoryType
 
typedef IN PHYSICAL_ADDRESS IN
MEMORY_PROFILE_ACTION IN
EFI_MEMORY_TYPE IN VOID
Buffer
 
typedef IN PHYSICAL_ADDRESS IN
MEMORY_PROFILE_ACTION IN
EFI_MEMORY_TYPE IN VOID IN
UINTN 
Size
 
typedef IN PHYSICAL_ADDRESS IN
MEMORY_PROFILE_ACTION IN
EFI_MEMORY_TYPE IN VOID IN
UINTN IN CHAR8 * 
ActionString
 
typedef
EDKII_MEMORY_PROFILE_PROTOCOL 
EDKII_SMM_MEMORY_PROFILE_PROTOCOL
 

Enumerations

enum  MEMORY_PROFILE_ACTION { MemoryProfileActionAllocatePages = 1, MemoryProfileActionFreePages = 2, MemoryProfileActionAllocatePool = 3, MemoryProfileActionFreePool = 4 }
 

Functions

typedef EFI_STATUS (EFIAPI *EDKII_MEMORY_PROFILE_GET_RECORDING_STATE)(IN EDKII_MEMORY_PROFILE_PROTOCOL *This
 

Variables

EFI_GUID gEdkiiMemoryProfileGuid
 
EFI_GUID gEdkiiSmmMemoryProfileGuid
 

Detailed Description

Memory profile data structure.

Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Macro Definition Documentation

#define EDKII_MEMORY_PROFILE_GUID
Value:
{ \
0x821c9a09, 0x541a, 0x40f6, { 0x9f, 0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe } \
}
#define EDKII_SMM_MEMORY_PROFILE_GUID
Value:
{ \
0xe22bbcca, 0x516a, 0x46a8, { 0x80, 0xe2, 0x67, 0x45, 0xe8, 0x36, 0x93, 0xbd } \
}
#define MEMORY_PROFILE_ACTION_BASIC_MASK   0xF
#define MEMORY_PROFILE_ACTION_EXTENSION_ALIGN_MASK   0x0040
#define MEMORY_PROFILE_ACTION_EXTENSION_COPY_MASK   0x0100
#define MEMORY_PROFILE_ACTION_EXTENSION_LIB_MASK   0x8000
#define MEMORY_PROFILE_ACTION_EXTENSION_MASK   0xFFF0
#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_BASIC   0x0000
#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_MASK   0x0030
#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RESERVED   0x0020
#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RUNTIME   0x0010
#define MEMORY_PROFILE_ACTION_EXTENSION_REALLOC_MASK   0x0200
#define MEMORY_PROFILE_ACTION_EXTENSION_ZERO_MASK   0x0080
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_PAGES   0x8041
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RESERVED_PAGES   0x8061
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RUNTIME_PAGES   0x8051
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_COPY_POOL   0x8103
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES   0x8001
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_POOL   0x8003
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_COPY_POOL   0x8123
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES   0x8021
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_POOL   0x8023
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_ZERO_POOL   0x80a3
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_COPY_POOL   0x8113
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES   0x8011
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_POOL   0x8013
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_ZERO_POOL   0x8093
#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ZERO_POOL   0x8083
#define MEMORY_PROFILE_ACTION_LIB_FREE_ALIGNED_PAGES   0x8042
#define MEMORY_PROFILE_ACTION_LIB_FREE_PAGES   0x8002
#define MEMORY_PROFILE_ACTION_LIB_FREE_POOL   0x8004
#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_POOL   0x8203
#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL   0x8223
#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RUNTIME_POOL   0x8213
#define MEMORY_PROFILE_ACTION_USER_DEFINED_MASK   0x80000000
#define MEMORY_PROFILE_ALLOC_INFO_REVISION   0x0002
#define MEMORY_PROFILE_ALLOC_INFO_SIGNATURE   SIGNATURE_32 ('M','P','A','I')
#define MEMORY_PROFILE_CONTEXT_REVISION   0x0002
#define MEMORY_PROFILE_CONTEXT_SIGNATURE   SIGNATURE_32 ('M','P','C','T')
#define MEMORY_PROFILE_DESCRIPTOR_REVISION   0x0001
#define MEMORY_PROFILE_DESCRIPTOR_SIGNATURE   SIGNATURE_32 ('M','P','D','R')
#define MEMORY_PROFILE_DRIVER_INFO_REVISION   0x0003
#define MEMORY_PROFILE_DRIVER_INFO_SIGNATURE   SIGNATURE_32 ('M','P','D','I')
#define MEMORY_PROFILE_FREE_MEMORY_REVISION   0x0001
#define MEMORY_PROFILE_FREE_MEMORY_SIGNATURE   SIGNATURE_32 ('M','P','R','M')
#define MEMORY_PROFILE_MEMORY_RANGE_REVISION   0x0001
#define MEMORY_PROFILE_MEMORY_RANGE_SIGNATURE   SIGNATURE_32 ('M','P','M','R')
#define MEMORY_PROFILE_RECORDING_DISABLE   FALSE
#define MEMORY_PROFILE_RECORDING_ENABLE   TRUE
#define SMRAM_PROFILE_COMMAND_DEPRECATED1   0x3
#define SMRAM_PROFILE_COMMAND_DEPRECATED2   0x4
#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA   0x2
#define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET   0x5
#define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO   0x1
#define SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE   0x6
#define SMRAM_PROFILE_COMMAND_SET_RECORDING_STATE   0x7

Typedef Documentation

typedef IN PHYSICAL_ADDRESS IN MEMORY_PROFILE_ACTION Action
typedef IN PHYSICAL_ADDRESS IN MEMORY_PROFILE_ACTION IN EFI_MEMORY_TYPE IN VOID IN UINTN IN CHAR8* ActionString
typedef IN OUT CHAR16 IN OUT INT8 * Buffer
typedef IN PHYSICAL_ADDRESS CallerAddress
typedef EFI_STATUS(EFIAPI * EDKII_MEMORY_PROFILE_GET_DATA)(IN EDKII_MEMORY_PROFILE_PROTOCOL *This, IN OUT UINT64 *ProfileSize, OUT VOID *ProfileBuffer)

Get memory profile data.

Parameters
[in]ThisThe EDKII_MEMORY_PROFILE_PROTOCOL instance.
[in,out]ProfileSizeOn entry, points to the size in bytes of the ProfileBuffer. On return, points to the size of the data returned in ProfileBuffer.
[out]ProfileBufferProfile buffer.
Returns
EFI_SUCCESS Get the memory profile data successfully.
EFI_UNSUPPORTED Memory profile is unsupported.
EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data. ProfileSize is updated with the size required.
typedef EFI_STATUS(EFIAPI * EDKII_MEMORY_PROFILE_REGISTER_IMAGE)(IN EDKII_MEMORY_PROFILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN PHYSICAL_ADDRESS ImageBase, IN UINT64 ImageSize, IN EFI_FV_FILETYPE FileType)

Register image to memory profile.

Parameters
[in]ThisThe EDKII_MEMORY_PROFILE_PROTOCOL instance.
[in]FilePathFile path of the image.
[in]ImageBaseImage base address.
[in]ImageSizeImage size.
[in]FileTypeFile type of the image.
Returns
EFI_SUCCESS Register successfully.
EFI_UNSUPPORTED Memory profile is unsupported, or memory profile for the image is not required.
EFI_OUT_OF_RESOURCES No enough resource for this register.
typedef EFI_STATUS(EFIAPI * EDKII_MEMORY_PROFILE_UNREGISTER_IMAGE)(IN EDKII_MEMORY_PROFILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN PHYSICAL_ADDRESS ImageBase, IN UINT64 ImageSize)

Unregister image from memory profile.

Parameters
[in]ThisThe EDKII_MEMORY_PROFILE_PROTOCOL instance.
[in]FilePathFile path of the image.
[in]ImageBaseImage base address.
[in]ImageSizeImage size.
Returns
EFI_SUCCESS Unregister successfully.
EFI_UNSUPPORTED Memory profile is unsupported, or memory profile for the image is not required.
EFI_NOT_FOUND The image is not found.
typedef IN PHYSICAL_ADDRESS IN MEMORY_PROFILE_ACTION IN EFI_MEMORY_TYPE MemoryType
typedef IN BOOLEAN RecordingState
typedef IN PHYSICAL_ADDRESS IN MEMORY_PROFILE_ACTION IN EFI_MEMORY_TYPE IN VOID IN UINTN Size

Enumeration Type Documentation

Enumerator
MemoryProfileActionAllocatePages 
MemoryProfileActionFreePages 
MemoryProfileActionAllocatePool 
MemoryProfileActionFreePool 

Function Documentation

typedef EFI_STATUS ( EFIAPI *  EDKII_MEMORY_PROFILE_RECORD)

Get memory profile recording state.

Parameters
[in]ThisThe EDKII_MEMORY_PROFILE_PROTOCOL instance.
[out]RecordingStateRecording state.
Returns
EFI_SUCCESS Memory profile recording state is returned.
EFI_UNSUPPORTED Memory profile is unsupported.
EFI_INVALID_PARAMETER RecordingState is NULL.

Set memory profile recording state.

Parameters
[in]ThisThe EDKII_MEMORY_PROFILE_PROTOCOL instance.
[in]RecordingStateRecording state.
Returns
EFI_SUCCESS Set memory profile recording state successfully.
EFI_UNSUPPORTED Memory profile is unsupported.

Record memory profile of multilevel caller.

Parameters
[in]ThisThe EDKII_MEMORY_PROFILE_PROTOCOL instance.
[in]CallerAddressAddress of caller.
[in]ActionMemory profile action.
[in]MemoryTypeMemory type. EfiMaxMemoryType means the MemoryType is unknown.
[in]BufferBuffer address.
[in]SizeBuffer size.
[in]ActionStringString for memory profile action. Only needed for user defined allocate action.
Returns
EFI_SUCCESS Memory profile is updated.
EFI_UNSUPPORTED Memory profile is unsupported, or memory profile for the image is not required, or memory profile for the memory type is not required.
EFI_ACCESS_DENIED It is during memory profile data getting.
EFI_ABORTED Memory profile recording is not enabled.
EFI_OUT_OF_RESOURCES No enough resource to update memory profile for allocate action.
EFI_NOT_FOUND No matched allocate info found for free action.

Variable Documentation

EFI_GUID gEdkiiMemoryProfileGuid
EFI_GUID gEdkiiSmmMemoryProfileGuid