TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
#include <Library/PrintLib.h>
#include <Library/HiiLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiLib.h>
#include <Library/DevicePathLib.h>
#include <Library/HandleParsingLib.h>
#include <Pi/PiFirmwareFile.h>
#include <Library/DxeServicesLib.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/DriverBinding.h>
#include <Protocol/ComponentName2.h>
#include <Protocol/DevicePath.h>
#include <Guid/Performance.h>
#include "Dp.h"
#include "Literals.h"
#include "DpInternal.h"
Go to the source code of this file.
Functions | |
UINT64 | GetDuration (IN OUT MEASUREMENT_RECORD *Measurement) |
BOOLEAN | IsPhase (IN MEASUREMENT_RECORD *Measurement) |
BOOLEAN | IsCorePerf (IN MEASUREMENT_RECORD *Measurement) |
VOID | DpGetShortPdbFileName (IN CHAR8 *PdbFileName, OUT CHAR16 *UnicodeBuffer) |
VOID | DpGetNameFromHandle (IN EFI_HANDLE Handle) |
UINT64 | DurationInMicroSeconds (IN UINT64 Duration) |
INTN | GetCumulativeItem (IN MEASUREMENT_RECORD *Measurement) |
Utility functions used by the Dp application.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved. (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DpUtilities.c.
VOID DpGetNameFromHandle | ( | IN EFI_HANDLE | Handle | ) |
Get a human readable name for an image handle. The following methods will be tried orderly:
[in] | Handle |
Definition at line 208 of file DpUtilities.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 converted to Unicode and copied into UnicodeBuffer. The name is truncated, if necessary, to ensure that UnicodeBuffer is not overrun.
[in] | PdbFileName | Pdb file name. |
[out] | UnicodeBuffer | The resultant Unicode File Name. |
Definition at line 150 of file DpUtilities.c.
UINT64 DurationInMicroSeconds | ( | IN UINT64 | Duration | ) |
Calculate the Duration in microseconds.
Duration is multiplied by 1000, instead of Frequency being divided by 1000 or multiplying the result by 1000, in order to maintain precision. Since Duration is a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow.
The time is calculated as (Duration * 1000) / Timer_Frequency.
[in] | Duration | The event duration in timer ticks. |
Definition at line 392 of file DpUtilities.c.
INTN GetCumulativeItem | ( | IN MEASUREMENT_RECORD * | Measurement | ) |
Get index of Measurement Record's match in the CumData array.
If the Measurement's Token value matches a Token in one of the CumData records, the index of the matching record is returned. The returned index is a signed value so that negative values can indicate that the Measurement didn't match any entry in the CumData array.
[in] | Measurement | A pointer to a Measurement Record to match against the CumData array. |
<0 | Token is not in the CumData array. |
>=0 | Return value is the index into CumData where Token is found. |
Definition at line 413 of file DpUtilities.c.
UINT64 GetDuration | ( | IN OUT MEASUREMENT_RECORD * | Measurement | ) |
Calculate an event's duration in timer ticks.
Given the count direction and the event's start and end timer values, calculate the duration of the event in timer ticks. Information for the current measurement is pointed to by the parameter.
If the measurement's start time is 1, it indicates that the developer is indicating that the measurement began at the release of reset. The start time is adjusted to the timer's starting count before performing the elapsed time calculation.
The calculated duration, in ticks, is the absolute difference between the measurement's ending and starting counts.
Measurement | Pointer to a MEASUREMENT_RECORD structure containing data for the current measurement. |
Definition at line 57 of file DpUtilities.c.
BOOLEAN IsCorePerf | ( | IN MEASUREMENT_RECORD * | Measurement | ) |
Determine whether the Measurement record is for core code.
[in] | Measurement | A pointer to the Measurement record to test. |
TRUE | The measurement record is used for core. |
FALSE | The measurement record is NOT used for core. |
Definition at line 116 of file DpUtilities.c.
BOOLEAN IsPhase | ( | IN MEASUREMENT_RECORD * | Measurement | ) |
Determine whether the Measurement record is for an EFI Phase.
The Token and Module members of the measurement record are checked. Module must be empty and Token must be one of SEC, PEI, DXE, BDS, or SHELL.
[in] | Measurement | A pointer to the Measurement record to test. |
TRUE | The measurement record is for an EFI Phase. |
FALSE | The measurement record is NOT for an EFI Phase. |
Definition at line 91 of file DpUtilities.c.