TianoCore EDK2 master
Loading...
Searching...
No Matches
SmiHandlerProfileInfo.c File Reference

Go to the source code of this file.

Macros

#define PROFILE_NAME_STRING_LENGTH   64
 

Functions

VOID InternalDumpData (IN UINT8 *Data, IN UINTN Size)
 
VOID GetSmiHandlerProfileDatabase (VOID)
 
VOID GetShortPdbFileName (IN CHAR8 *PdbFileName, OUT CHAR8 *AsciiBuffer)
 
CHAR8 * GetDriverNameString (IN SMM_CORE_IMAGE_DATABASE_STRUCTURE *ImageStruct)
 
SMM_CORE_IMAGE_DATABASE_STRUCTUREGetImageFromRef (IN UINTN ImageRef)
 
VOID DumpSmmLoadedImage (VOID)
 
CHAR8 * SxTypeToString (IN EFI_SLEEP_TYPE Type)
 
CHAR8 * SxPhaseToString (IN EFI_SLEEP_PHASE Phase)
 
CHAR8 * PowerButtonPhaseToString (IN EFI_POWER_BUTTON_PHASE Phase)
 
CHAR8 * StandbyButtonPhaseToString (IN EFI_STANDBY_BUTTON_PHASE Phase)
 
CHAR8 * IoTrapTypeToString (IN EFI_SMM_IO_TRAP_DISPATCH_TYPE Type)
 
CHAR8 * UsbTypeToString (IN EFI_USB_SMI_TYPE Type)
 
VOID DumpSmiChildContext (IN EFI_GUID *HandlerType, IN VOID *Context, IN UINTN ContextSize)
 
VOID DumpSmiHandler (IN UINT32 HandlerCategory)
 
EFI_STATUS EFIAPI SmiHandlerProfileInfoEntrypoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

CHAR8 mNameString [PROFILE_NAME_STRING_LENGTH+1]
 
VOID * mSmiHandlerProfileDatabase
 
UINTN mSmiHandlerProfileDatabaseSize
 
CHAR8 * mSxTypeString []
 
CHAR8 * mSxPhaseString []
 
CHAR8 * mPowerButtonPhaseString []
 
CHAR8 * mStandbyButtonPhaseString []
 
CHAR8 * mIoTrapTypeString []
 
CHAR8 * mUsbTypeString []
 

Detailed Description

Shell application to dump SMI handler profile information.

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

Definition in file SmiHandlerProfileInfo.c.

Macro Definition Documentation

◆ PROFILE_NAME_STRING_LENGTH

#define PROFILE_NAME_STRING_LENGTH   64

Definition at line 25 of file SmiHandlerProfileInfo.c.

Function Documentation

◆ DumpSmiChildContext()

VOID DumpSmiChildContext ( IN EFI_GUID HandlerType,
IN VOID *  Context,
IN UINTN  ContextSize 
)

Dump SMI child context.

Parameters
HandlerTypethe handler type
Contextthe handler context
ContextSizethe handler context size

Definition at line 539 of file SmiHandlerProfileInfo.c.

◆ DumpSmiHandler()

VOID DumpSmiHandler ( IN UINT32  HandlerCategory)

Dump SMI handler in HandlerCategory.

Parameters
HandlerCategorySMI handler category

Definition at line 585 of file SmiHandlerProfileInfo.c.

◆ DumpSmmLoadedImage()

VOID DumpSmmLoadedImage ( VOID  )

Dump SMM loaded image information.

Definition at line 341 of file SmiHandlerProfileInfo.c.

◆ GetDriverNameString()

CHAR8 * GetDriverNameString ( IN SMM_CORE_IMAGE_DATABASE_STRUCTURE ImageStruct)

Get a human readable name for an image. The following methods will be tried orderly:

  1. Image PDB
  2. FFS UI section
  3. Image GUID
Parameters
[in]ImageStructPoint to the image structure.
Returns
The resulting Ascii name string is stored in the mNameString global array.

Definition at line 255 of file SmiHandlerProfileInfo.c.

◆ GetImageFromRef()

SMM_CORE_IMAGE_DATABASE_STRUCTURE * GetImageFromRef ( IN UINTN  ImageRef)

Get image structure from reference index.

Parameters
ImageRefthe image reference index
Returns
image structure

Definition at line 317 of file SmiHandlerProfileInfo.c.

◆ GetShortPdbFileName()

VOID GetShortPdbFileName ( IN CHAR8 *  PdbFileName,
OUT CHAR8 *  AsciiBuffer 
)

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.

Parameters
[in]PdbFileNamePdb file name.
[out]AsciiBufferThe resultant Ascii File Name.

Definition at line 201 of file SmiHandlerProfileInfo.c.

◆ GetSmiHandlerProfileDatabase()

VOID GetSmiHandlerProfileDatabase ( VOID  )

Get SMI handler profile database.

Definition at line 57 of file SmiHandlerProfileInfo.c.

◆ InternalDumpData()

VOID InternalDumpData ( IN UINT8 *  Data,
IN UINTN  Size 
)

This function dump raw data.

Parameters
Dataraw data
Sizeraw data size

Definition at line 38 of file SmiHandlerProfileInfo.c.

◆ IoTrapTypeToString()

CHAR8 * IoTrapTypeToString ( IN EFI_SMM_IO_TRAP_DISPATCH_TYPE  Type)

Convert IoTrapType to a string.

Parameters
TypeIoTrapType
Returns
IoTrapType string

Definition at line 494 of file SmiHandlerProfileInfo.c.

◆ PowerButtonPhaseToString()

CHAR8 * PowerButtonPhaseToString ( IN EFI_POWER_BUTTON_PHASE  Phase)

Convert PowerButtonPhase to a string.

Parameters
PhasePowerButtonPhase
Returns
PowerButtonPhase string

Definition at line 443 of file SmiHandlerProfileInfo.c.

◆ SmiHandlerProfileInfoEntrypoint()

EFI_STATUS EFIAPI SmiHandlerProfileInfoEntrypoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The Entry Point for SMI handler profile info application.

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
OtherSome error occurred when executing this entry point.

Definition at line 656 of file SmiHandlerProfileInfo.c.

◆ StandbyButtonPhaseToString()

CHAR8 * StandbyButtonPhaseToString ( IN EFI_STANDBY_BUTTON_PHASE  Phase)

Convert StandbyButtonPhase to a string.

Parameters
PhaseStandbyButtonPhase
Returns
StandbyButtonPhase string

Definition at line 468 of file SmiHandlerProfileInfo.c.

◆ SxPhaseToString()

CHAR8 * SxPhaseToString ( IN EFI_SLEEP_PHASE  Phase)

Convert SxPhase to a string.

Parameters
PhaseSxPhase
Returns
SxPhase string

Definition at line 418 of file SmiHandlerProfileInfo.c.

◆ SxTypeToString()

CHAR8 * SxTypeToString ( IN EFI_SLEEP_TYPE  Type)

Convert SxType to a string.

Parameters
TypeSxType
Returns
SxType string

Definition at line 393 of file SmiHandlerProfileInfo.c.

◆ UsbTypeToString()

CHAR8 * UsbTypeToString ( IN EFI_USB_SMI_TYPE  Type)

Convert UsbType to a string.

Parameters
TypeUsbType
Returns
UsbType string

Definition at line 519 of file SmiHandlerProfileInfo.c.

Variable Documentation

◆ mIoTrapTypeString

CHAR8* mIoTrapTypeString[]
Initial value:
= {
"WriteTrap",
"ReadTrap",
"ReadWriteTrap",
}

Definition at line 480 of file SmiHandlerProfileInfo.c.

◆ mNameString

CHAR8 mNameString[PROFILE_NAME_STRING_LENGTH+1]

Definition at line 26 of file SmiHandlerProfileInfo.c.

◆ mPowerButtonPhaseString

CHAR8* mPowerButtonPhaseString[]
Initial value:
= {
"PowerButtonEntry",
"PowerButtonExit",
}

Definition at line 430 of file SmiHandlerProfileInfo.c.

◆ mSmiHandlerProfileDatabase

VOID* mSmiHandlerProfileDatabase

Definition at line 28 of file SmiHandlerProfileInfo.c.

◆ mSmiHandlerProfileDatabaseSize

UINTN mSmiHandlerProfileDatabaseSize

Definition at line 29 of file SmiHandlerProfileInfo.c.

◆ mStandbyButtonPhaseString

CHAR8* mStandbyButtonPhaseString[]
Initial value:
= {
"StandbyButtonEntry",
"StandbyButtonExit",
}

Definition at line 455 of file SmiHandlerProfileInfo.c.

◆ mSxPhaseString

CHAR8* mSxPhaseString[]
Initial value:
= {
"SxEntry",
"SxExit",
}

Definition at line 405 of file SmiHandlerProfileInfo.c.

◆ mSxTypeString

CHAR8* mSxTypeString[]
Initial value:
= {
"SxS0",
"SxS1",
"SxS2",
"SxS3",
"SxS4",
"SxS5",
}

Definition at line 376 of file SmiHandlerProfileInfo.c.

◆ mUsbTypeString

CHAR8* mUsbTypeString[]
Initial value:
= {
"UsbLegacy",
"UsbWake",
}

Definition at line 506 of file SmiHandlerProfileInfo.c.