]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h
7e79675f94017f4b4f95254587f1caf3675f2613
2 Master header files for DxeCorePerformanceLib instance.
4 This header file holds the prototypes of the Performance and PerformanceEx Protocol published by this
5 library instance at its constructor.
7 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_
19 #define _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_
24 #include <Guid/Performance.h>
25 #include <Guid/ExtendedFirmwarePerformance.h>
26 #include <Guid/ZeroGuid.h>
27 #include <Guid/EventGroup.h>
28 #include <Guid/FirmwarePerformance.h>
29 #include <Guid/PiSmmCommunicationRegionTable.h>
31 #include <Protocol/DriverBinding.h>
32 #include <Protocol/LoadedImage.h>
33 #include <Protocol/ComponentName2.h>
34 #include <Protocol/DevicePathToText.h>
35 #include <Protocol/SmmCommunication.h>
37 #include <Library/PerformanceLib.h>
38 #include <Library/DebugLib.h>
39 #include <Library/HobLib.h>
40 #include <Library/BaseLib.h>
41 #include <Library/BaseMemoryLib.h>
42 #include <Library/TimerLib.h>
43 #include <Library/PcdLib.h>
44 #include <Library/UefiBootServicesTableLib.h>
45 #include <Library/UefiRuntimeServicesTableLib.h>
46 #include <Library/MemoryAllocationLib.h>
47 #include <Library/UefiLib.h>
48 #include <Library/ReportStatusCodeLib.h>
49 #include <Library/DxeServicesLib.h>
50 #include <Library/PeCoffGetEntryPointLib.h>
53 // Interface declarations for PerformanceEx Protocol.
56 Adds a record at the end of the performance measurement log
57 that records the start time of a performance measurement.
59 Adds a record to the end of the performance measurement log
60 that contains the Handle, Token, Module and Identifier.
61 The end time of the new record must be set to zero.
62 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
63 If TimeStamp is zero, the start time in the record is filled in with the value
64 read from the current time stamp.
66 @param Handle Pointer to environment specific context used
67 to identify the component being measured.
68 @param Token Pointer to a Null-terminated ASCII string
69 that identifies the component being measured.
70 @param Module Pointer to a Null-terminated ASCII string
71 that identifies the module being measured.
72 @param TimeStamp 64-bit time stamp.
73 @param Identifier 32-bit identifier. If the value is 0, the created record
74 is same as the one created by StartGauge of PERFORMANCE_PROTOCOL.
76 @retval EFI_SUCCESS The data was read correctly from the device.
77 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
83 IN CONST VOID
*Handle
, OPTIONAL
84 IN CONST CHAR8
*Token
, OPTIONAL
85 IN CONST CHAR8
*Module
, OPTIONAL
91 Searches the performance measurement log from the beginning of the log
92 for the first matching record that contains a zero end time and fills in a valid end time.
94 Searches the performance measurement log from the beginning of the log
95 for the first record that matches Handle, Token, Module and Identifier and has an end time value of zero.
96 If the record can not be found then return EFI_NOT_FOUND.
97 If the record is found and TimeStamp is not zero,
98 then the end time in the record is filled in with the value specified by TimeStamp.
99 If the record is found and TimeStamp is zero, then the end time in the matching record
100 is filled in with the current time stamp value.
102 @param Handle Pointer to environment specific context used
103 to identify the component being measured.
104 @param Token Pointer to a Null-terminated ASCII string
105 that identifies the component being measured.
106 @param Module Pointer to a Null-terminated ASCII string
107 that identifies the module being measured.
108 @param TimeStamp 64-bit time stamp.
109 @param Identifier 32-bit identifier. If the value is 0, the found record
110 is same as the one found by EndGauge of PERFORMANCE_PROTOCOL.
112 @retval EFI_SUCCESS The end of the measurement was recorded.
113 @retval EFI_NOT_FOUND The specified measurement record could not be found.
119 IN CONST VOID
*Handle
, OPTIONAL
120 IN CONST CHAR8
*Token
, OPTIONAL
121 IN CONST CHAR8
*Module
, OPTIONAL
127 Retrieves a previously logged performance measurement.
128 It can also retrieve the log created by StartGauge and EndGauge of PERFORMANCE_PROTOCOL,
129 and then assign the Identifier with 0.
131 Retrieves the performance log entry from the performance log specified by LogEntryKey.
132 If it stands for a valid entry, then EFI_SUCCESS is returned and
133 GaugeDataEntryEx stores the pointer to that entry.
135 @param LogEntryKey The key for the previous performance measurement log entry.
136 If 0, then the first performance measurement log entry is retrieved.
137 @param GaugeDataEntryEx The indirect pointer to the extended gauge data entry specified by LogEntryKey
138 if the retrieval is successful.
140 @retval EFI_SUCCESS The GuageDataEntryEx is successfully found based on LogEntryKey.
141 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
142 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
143 @retval EFI_INVALIDE_PARAMETER GaugeDataEntryEx is NULL.
149 IN UINTN LogEntryKey
,
150 OUT GAUGE_DATA_ENTRY_EX
**GaugeDataEntryEx
154 // Interface declarations for Performance Protocol.
157 Adds a record at the end of the performance measurement log
158 that records the start time of a performance measurement.
160 Adds a record to the end of the performance measurement log
161 that contains the Handle, Token, and Module.
162 The end time of the new record must be set to zero.
163 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
164 If TimeStamp is zero, the start time in the record is filled in with the value
165 read from the current time stamp.
167 @param Handle Pointer to environment specific context used
168 to identify the component being measured.
169 @param Token Pointer to a Null-terminated ASCII string
170 that identifies the component being measured.
171 @param Module Pointer to a Null-terminated ASCII string
172 that identifies the module being measured.
173 @param TimeStamp 64-bit time stamp.
175 @retval EFI_SUCCESS The data was read correctly from the device.
176 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
182 IN CONST VOID
*Handle
, OPTIONAL
183 IN CONST CHAR8
*Token
, OPTIONAL
184 IN CONST CHAR8
*Module
, OPTIONAL
189 Searches the performance measurement log from the beginning of the log
190 for the first matching record that contains a zero end time and fills in a valid end time.
192 Searches the performance measurement log from the beginning of the log
193 for the first record that matches Handle, Token, and Module and has an end time value of zero.
194 If the record can not be found then return EFI_NOT_FOUND.
195 If the record is found and TimeStamp is not zero,
196 then the end time in the record is filled in with the value specified by TimeStamp.
197 If the record is found and TimeStamp is zero, then the end time in the matching record
198 is filled in with the current time stamp value.
200 @param Handle Pointer to environment specific context used
201 to identify the component being measured.
202 @param Token Pointer to a Null-terminated ASCII string
203 that identifies the component being measured.
204 @param Module Pointer to a Null-terminated ASCII string
205 that identifies the module being measured.
206 @param TimeStamp 64-bit time stamp.
208 @retval EFI_SUCCESS The end of the measurement was recorded.
209 @retval EFI_NOT_FOUND The specified measurement record could not be found.
215 IN CONST VOID
*Handle
, OPTIONAL
216 IN CONST CHAR8
*Token
, OPTIONAL
217 IN CONST CHAR8
*Module
, OPTIONAL
222 Retrieves a previously logged performance measurement.
223 It can also retrieve the log created by StartGaugeEx and EndGaugeEx of PERFORMANCE_EX_PROTOCOL,
224 and then eliminate the Identifier.
226 Retrieves the performance log entry from the performance log specified by LogEntryKey.
227 If it stands for a valid entry, then EFI_SUCCESS is returned and
228 GaugeDataEntry stores the pointer to that entry.
230 @param LogEntryKey The key for the previous performance measurement log entry.
231 If 0, then the first performance measurement log entry is retrieved.
232 @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
233 if the retrieval is successful.
235 @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
236 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
237 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
238 @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
244 IN UINTN LogEntryKey
,
245 OUT GAUGE_DATA_ENTRY
**GaugeDataEntry