64 if (Measurement->EndTimeStamp == 0) {
68 Duration = Measurement->EndTimeStamp - Measurement->StartTimeStamp;
69 Error = (BOOLEAN)(Duration > Measurement->EndTimeStamp);
72 DEBUG ((DEBUG_ERROR, ALit_TimerLibError));
98 ((
AsciiStrCmp (Measurement->Token, ALit_SEC) == 0) ||
99 (
AsciiStrCmp (Measurement->Token, ALit_PEI) == 0) ||
100 (
AsciiStrCmp (Measurement->Token, ALit_DXE) == 0) ||
123 ((Measurement->Identifier == MODULE_START_ID) ||
124 (Measurement->Identifier == MODULE_END_ID) ||
125 (Measurement->Identifier == MODULE_LOADIMAGE_START_ID) ||
126 (Measurement->Identifier == MODULE_LOADIMAGE_END_ID) ||
127 (Measurement->Identifier == MODULE_DB_START_ID) ||
128 (Measurement->Identifier == MODULE_DB_END_ID) ||
129 (Measurement->Identifier == MODULE_DB_SUPPORT_START_ID) ||
130 (Measurement->Identifier == MODULE_DB_SUPPORT_END_ID) ||
131 (Measurement->Identifier == MODULE_DB_STOP_START_ID) ||
132 (Measurement->Identifier == MODULE_DB_STOP_START_ID))
151 IN CHAR8 *PdbFileName,
152 OUT CHAR16 *UnicodeBuffer
160 ZeroMem (UnicodeBuffer, (DP_GAUGE_STRING_LENGTH + 1) *
sizeof (CHAR16));
162 if (PdbFileName ==
NULL) {
163 StrnCpyS (UnicodeBuffer, DP_GAUGE_STRING_LENGTH + 1, L
" ", 1);
166 for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++) {
169 for (IndexA = 0; PdbFileName[IndexA] != 0; IndexA++) {
170 if ((PdbFileName[IndexA] ==
'\\') || (PdbFileName[IndexA] ==
'/')) {
171 StartIndex = IndexA + 1;
174 if (PdbFileName[IndexA] ==
'.') {
180 for (IndexA = StartIndex; IndexA < EndIndex; IndexA++) {
181 UnicodeBuffer[IndexU] = (CHAR16)PdbFileName[IndexA];
183 if (IndexU >= DP_GAUGE_STRING_LENGTH) {
184 UnicodeBuffer[DP_GAUGE_STRING_LENGTH] = 0;
216 EFI_STRING StringPtr;
222 CHAR8 *PlatformLanguage;
227 LoadedImageDevicePath =
NULL;
233 Status =
gBS->HandleProtocol (
235 &gEfiLoadedImageProtocolGuid,
239 if (EFI_ERROR (Status)) {
240 Status =
gBS->OpenProtocol (
242 &gEfiDriverBindingProtocolGuid,
243 (VOID **)&DriverBinding,
246 EFI_OPEN_PROTOCOL_GET_PROTOCOL
248 if (!EFI_ERROR (Status)) {
249 Status =
gBS->HandleProtocol (
250 DriverBinding->ImageHandle,
251 &gEfiLoadedImageProtocolGuid,
257 if (!EFI_ERROR (Status)) {
258 PdbFileName = PeCoffLoaderGetPdbPointer (Image->
ImageBase);
260 if (PdbFileName !=
NULL) {
269 Status =
gBS->HandleProtocol (
271 &gEfiComponentName2ProtocolGuid,
272 (VOID **)&ComponentName2
274 if (!EFI_ERROR (Status)) {
278 GetVariable2 (L
"PlatformLang", &gEfiGlobalVariableGuid, (VOID **)&PlatformLanguage,
NULL);
282 (PlatformLanguage !=
NULL) ? PlatformLanguage :
"",
286 SHELL_FREE_NON_NULL (PlatformLanguage);
288 Status = ComponentName2->GetDriverName (
290 BestLanguage !=
NULL ? BestLanguage :
"en-US",
293 if (!EFI_ERROR (Status)) {
294 SHELL_FREE_NON_NULL (BestLanguage);
301 Status =
gBS->HandleProtocol (
303 &gEfiLoadedImageDevicePathProtocolGuid,
304 (VOID **)&LoadedImageDevicePath
306 if (!EFI_ERROR (Status) && (LoadedImageDevicePath !=
NULL)) {
307 DevicePath = LoadedImageDevicePath;
308 }
else if (Image !=
NULL) {
312 if (DevicePath !=
NULL) {
319 if (NameGuid !=
NULL) {
326 if (NameGuid !=
NULL) {
334 EFI_SECTION_USER_INTERFACE,
336 (VOID **)&NameString,
340 if (!EFI_ERROR (Status)) {
360 if (NameString !=
NULL) {
373 ASSERT (StringPtr !=
NULL);
419 for ( Index = 0; Index < (
INTN)
NumCum; ++Index) {
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI NextDevicePathNode(IN CONST VOID *Node)
CHAR16 *EFIAPI ConvertDevicePathToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
BOOLEAN EFIAPI IsDevicePathEndType(IN CONST VOID *Node)
PERF_CUM_DATA CumData[]
Items for which to gather cumulative statistics.
CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH+1]
UINT32 const NumCum
Number of items for which we are gathering cumulative statistics.
EFI_HII_HANDLE mDpHiiHandle
INTN GetCumulativeItem(IN MEASUREMENT_RECORD *Measurement)
VOID DpGetShortPdbFileName(IN CHAR8 *PdbFileName, OUT CHAR16 *UnicodeBuffer)
BOOLEAN IsPhase(IN MEASUREMENT_RECORD *Measurement)
VOID DpGetNameFromHandle(IN EFI_HANDLE Handle)
UINT64 GetDuration(IN OUT MEASUREMENT_RECORD *Measurement)
BOOLEAN IsCorePerf(IN MEASUREMENT_RECORD *Measurement)
UINT64 DurationInMicroSeconds(IN UINT64 Duration)
EFI_STATUS EFIAPI GetSectionFromAnyFv(IN CONST EFI_GUID *NameGuid, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, OUT VOID **Buffer, OUT UINTN *Size)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define DEBUG(Expression)
EFI_STATUS EFIAPI GetVariable2(IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, OUT VOID **Value, OUT UINTN *Size OPTIONAL)
CHAR8 *EFIAPI GetBestLanguage(IN CONST CHAR8 *SupportedLanguages, IN UINTN Iso639Language,...)
EFI_GUID *EFIAPI EfiGetNameGuidFromFwVolDevicePathNode(IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode)
CHAR8 * SupportedLanguages
EFI_DEVICE_PATH_PROTOCOL * FilePath
VOID * ImageBase
The base address at which the image was loaded.
CHAR8 * Name
ASCII name of this item.