mirror of https://github.com/acidanthera/audk.git
Change to a NEON compatible CPU Arch (ARMv7 is NEON optional) and add performance lib stuff to measure boot time. Also add an example performace lib dumper as an example EBL command.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10387 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2ed3c9ccf8
commit
d02b28d736
|
@ -28,7 +28,6 @@
|
||||||
BUILD_TARGETS = DEBUG|RELEASE
|
BUILD_TARGETS = DEBUG|RELEASE
|
||||||
SKUID_IDENTIFIER = DEFAULT
|
SKUID_IDENTIFIER = DEFAULT
|
||||||
FLASH_DEFINITION = BeagleBoardPkg/BeagleBoardPkg.fdf
|
FLASH_DEFINITION = BeagleBoardPkg/BeagleBoardPkg.fdf
|
||||||
DEFINE TARGET_HACK = DEBUG
|
|
||||||
|
|
||||||
|
|
||||||
[LibraryClasses.common]
|
[LibraryClasses.common]
|
||||||
|
@ -146,16 +145,19 @@
|
||||||
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
|
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
|
||||||
DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
|
DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
|
||||||
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
|
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
|
||||||
|
PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
|
||||||
|
|
||||||
|
|
||||||
[LibraryClasses.common.UEFI_APPLICATION]
|
[LibraryClasses.common.UEFI_APPLICATION]
|
||||||
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
|
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
|
||||||
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
|
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
|
||||||
|
PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
|
||||||
|
|
||||||
[LibraryClasses.common.UEFI_DRIVER]
|
[LibraryClasses.common.UEFI_DRIVER]
|
||||||
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
|
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
|
||||||
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
|
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
|
||||||
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
|
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
|
||||||
|
PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
|
||||||
|
|
||||||
[LibraryClasses.common.DXE_RUNTIME_DRIVER]
|
[LibraryClasses.common.DXE_RUNTIME_DRIVER]
|
||||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||||
|
@ -181,8 +183,9 @@
|
||||||
XCODE:*_*_ARM_ARCHDLINK_FLAGS == -arch armv7
|
XCODE:*_*_ARM_ARCHDLINK_FLAGS == -arch armv7
|
||||||
XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
|
XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
|
||||||
|
|
||||||
RVCT:*_*_ARM_ARCHCC_FLAGS == --cpu 7-A --thumb
|
RVCT:*_*_ARM_ARCHCC_FLAGS == --cpu Cortex-A8 --thumb
|
||||||
RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
|
RVCT:*_*_ARM_ARCHASM_FLAGS == --cpu Cortex-A8
|
||||||
|
RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
|
@ -304,8 +307,8 @@
|
||||||
gArmTokenSpaceGuid.PcdCpuResetAddress|0x80008000
|
gArmTokenSpaceGuid.PcdCpuResetAddress|0x80008000
|
||||||
|
|
||||||
gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000
|
gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000
|
||||||
gEmbeddedTokenSpaceGuid.PcdEmbeddedFdPerformanceCounterPeriodInNanoseconds|77
|
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77
|
||||||
gEmbeddedTokenSpaceGuid.PcdEmbeddedFdPerformanceCounterFrequencyInHz|13000000
|
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000
|
||||||
|
|
||||||
#
|
#
|
||||||
# ARM Pcds
|
# ARM Pcds
|
||||||
|
@ -414,10 +417,9 @@
|
||||||
# Bds
|
# Bds
|
||||||
#
|
#
|
||||||
BeagleBoardPkg/Bds/Bds.inf
|
BeagleBoardPkg/Bds/Bds.inf
|
||||||
|
|
||||||
#
|
#
|
||||||
# Gdb Stub
|
# Example Application
|
||||||
#
|
#
|
||||||
EmbeddedPkg/GdbStub/GdbStub.inf
|
MdeModulePkg/Application/HelloWorld/HelloWorld.inf
|
||||||
ArmPkg/Drivers/DebugSupportDxe/DebugSupportDxe.inf
|
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,11 @@
|
||||||
#include <Library/EfiFileLib.h>
|
#include <Library/EfiFileLib.h>
|
||||||
#include <Library/ArmDisassemblerLib.h>
|
#include <Library/ArmDisassemblerLib.h>
|
||||||
#include <Library/PeCoffGetEntryPointLib.h>
|
#include <Library/PeCoffGetEntryPointLib.h>
|
||||||
|
#include <Library/PerformanceLib.h>
|
||||||
|
#include <Library/TimerLib.h>
|
||||||
|
|
||||||
#include <Guid/DebugImageInfoTable.h>
|
#include <Guid/DebugImageInfoTable.h>
|
||||||
|
|
||||||
#include <Protocol/DebugSupport.h>
|
#include <Protocol/DebugSupport.h>
|
||||||
#include <Protocol/LoadedImage.h>
|
#include <Protocol/LoadedImage.h>
|
||||||
|
|
||||||
|
@ -146,6 +149,101 @@ EblDisassembler (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CHAR8 *
|
||||||
|
ImageHandleToPdbFileName (
|
||||||
|
IN EFI_HANDLE Handle
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
|
||||||
|
|
||||||
|
Status = gBS->HandleProtocol (Handle, &gEfiLoadedImageProtocolGuid, (VOID **)&LoadedImage);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return PeCoffLoaderGetPdbPointer (LoadedImage->ImageBase);
|
||||||
|
}
|
||||||
|
|
||||||
|
CHAR8 *mTokenList[] = {
|
||||||
|
"SEC",
|
||||||
|
"PEI",
|
||||||
|
"DXE",
|
||||||
|
"BDS",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Simple arm disassembler via a library
|
||||||
|
|
||||||
|
Argv[0] - disasm
|
||||||
|
Argv[1] - Address to start disassembling from
|
||||||
|
ARgv[2] - Number of instructions to disassembly (optional)
|
||||||
|
|
||||||
|
@param Argc Number of command arguments in Argv
|
||||||
|
@param Argv Array of strings that represent the parsed command line.
|
||||||
|
Argv[0] is the comamnd name
|
||||||
|
|
||||||
|
@return EFI_SUCCESS
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EblPerformance (
|
||||||
|
IN UINTN Argc,
|
||||||
|
IN CHAR8 **Argv
|
||||||
|
)
|
||||||
|
{
|
||||||
|
UINTN Key;
|
||||||
|
CONST VOID *Handle;
|
||||||
|
CONST CHAR8 *Token, *Module;
|
||||||
|
UINT64 Start, Stop, TimeStamp;
|
||||||
|
UINT64 Delta, TicksPerSecond, Milliseconds, Microseconds;
|
||||||
|
UINTN Index;
|
||||||
|
|
||||||
|
TicksPerSecond = GetPerformanceCounterProperties (NULL, NULL);
|
||||||
|
|
||||||
|
Key = 0;
|
||||||
|
do {
|
||||||
|
Key = GetPerformanceMeasurement (Key, (CONST VOID **)&Handle, &Token, &Module, &Start, &Stop);
|
||||||
|
if (Key != 0) {
|
||||||
|
if (AsciiStriCmp ("StartImage:", Token) == 0) {
|
||||||
|
if (Stop == 0) {
|
||||||
|
// The entry for EBL is still running so the stop time will be zero. Skip it
|
||||||
|
AsciiPrint (" running %a\n", ImageHandleToPdbFileName ((EFI_HANDLE)Handle));
|
||||||
|
} else {
|
||||||
|
Delta = Stop - Start;
|
||||||
|
Microseconds = DivU64x64Remainder (MultU64x32 (Delta, 1000000), TicksPerSecond, NULL);
|
||||||
|
AsciiPrint ("%10ld us %a\n", Microseconds, ImageHandleToPdbFileName ((EFI_HANDLE)Handle));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (Key != 0);
|
||||||
|
|
||||||
|
AsciiPrint ("\n");
|
||||||
|
|
||||||
|
TimeStamp = 0;
|
||||||
|
Key = 0;
|
||||||
|
do {
|
||||||
|
Key = GetPerformanceMeasurement (Key, (CONST VOID **)&Handle, &Token, &Module, &Start, &Stop);
|
||||||
|
if (Key != 0) {
|
||||||
|
for (Index = 0; mTokenList[Index] != NULL; Index++) {
|
||||||
|
if (AsciiStriCmp (mTokenList[Index], Token) == 0) {
|
||||||
|
Delta = Stop - Start;
|
||||||
|
TimeStamp += Delta;
|
||||||
|
Milliseconds = DivU64x64Remainder (MultU64x32 (Delta, 1000), TicksPerSecond, NULL);
|
||||||
|
AsciiPrint ("%6a %6ld ms\n", Token, Milliseconds);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (Key != 0);
|
||||||
|
|
||||||
|
AsciiPrint ("Total Time = %ld ms\n\n", DivU64x64Remainder (MultU64x32 (TimeStamp, 1000), TicksPerSecond, NULL));
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mLibCmdTemplate[] =
|
GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mLibCmdTemplate[] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -154,6 +252,12 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mLibCmdTemplate[] =
|
||||||
NULL,
|
NULL,
|
||||||
EblDisassembler
|
EblDisassembler
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"performance",
|
||||||
|
" Display boot performance info",
|
||||||
|
NULL,
|
||||||
|
EblPerformance
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"symboltable [\"format string\"] [PECOFF]",
|
"symboltable [\"format string\"] [PECOFF]",
|
||||||
" show symbol table commands for debugger",
|
" show symbol table commands for debugger",
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
EmbeddedPkg/EmbeddedPkg.dec
|
EmbeddedPkg/EmbeddedPkg.dec
|
||||||
ArmPkg/ArmPkg.dec
|
ArmPkg/ArmPkg.dec
|
||||||
|
|
||||||
|
@ -41,6 +42,8 @@
|
||||||
BaseLib
|
BaseLib
|
||||||
DebugLib
|
DebugLib
|
||||||
ArmDisassemblerLib
|
ArmDisassemblerLib
|
||||||
|
PerformanceLib
|
||||||
|
TimerLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiDebugSupportProtocolGuid
|
gEfiDebugSupportProtocolGuid
|
||||||
|
@ -48,4 +51,3 @@
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiDebugImageInfoTableGuid
|
gEfiDebugImageInfoTableGuid
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue