]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h
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 - 2012, 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>
26 #include <Library/PerformanceLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/HobLib.h>
29 #include <Library/BaseLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/TimerLib.h>
32 #include <Library/PcdLib.h>
33 #include <Library/UefiBootServicesTableLib.h>
34 #include <Library/MemoryAllocationLib.h>
37 // Interface declarations for PerformanceEx Protocol.
40 Adds a record at the end of the performance measurement log
41 that records the start time of a performance measurement.
43 Adds a record to the end of the performance measurement log
44 that contains the Handle, Token, Module and Identifier.
45 The end time of the new record must be set to zero.
46 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
47 If TimeStamp is zero, the start time in the record is filled in with the value
48 read from the current time stamp.
50 @param Handle Pointer to environment specific context used
51 to identify the component being measured.
52 @param Token Pointer to a Null-terminated ASCII string
53 that identifies the component being measured.
54 @param Module Pointer to a Null-terminated ASCII string
55 that identifies the module being measured.
56 @param TimeStamp 64-bit time stamp.
57 @param Identifier 32-bit identifier. If the value is 0, the created record
58 is same as the one created by StartGauge of PERFORMANCE_PROTOCOL.
60 @retval EFI_SUCCESS The data was read correctly from the device.
61 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
67 IN CONST VOID
*Handle
, OPTIONAL
68 IN CONST CHAR8
*Token
, OPTIONAL
69 IN CONST CHAR8
*Module
, OPTIONAL
75 Searches the performance measurement log from the beginning of the log
76 for the first matching record that contains a zero end time and fills in a valid end time.
78 Searches the performance measurement log from the beginning of the log
79 for the first record that matches Handle, Token, Module and Identifier and has an end time value of zero.
80 If the record can not be found then return EFI_NOT_FOUND.
81 If the record is found and TimeStamp is not zero,
82 then the end time in the record is filled in with the value specified by TimeStamp.
83 If the record is found and TimeStamp is zero, then the end time in the matching record
84 is filled in with the current time stamp value.
86 @param Handle Pointer to environment specific context used
87 to identify the component being measured.
88 @param Token Pointer to a Null-terminated ASCII string
89 that identifies the component being measured.
90 @param Module Pointer to a Null-terminated ASCII string
91 that identifies the module being measured.
92 @param TimeStamp 64-bit time stamp.
93 @param Identifier 32-bit identifier. If the value is 0, the found record
94 is same as the one found by EndGauge of PERFORMANCE_PROTOCOL.
96 @retval EFI_SUCCESS The end of the measurement was recorded.
97 @retval EFI_NOT_FOUND The specified measurement record could not be found.
103 IN CONST VOID
*Handle
, OPTIONAL
104 IN CONST CHAR8
*Token
, OPTIONAL
105 IN CONST CHAR8
*Module
, OPTIONAL
111 Retrieves a previously logged performance measurement.
112 It can also retrieve the log created by StartGauge and EndGauge of PERFORMANCE_PROTOCOL,
113 and then assign the Identifier with 0.
115 Retrieves the performance log entry from the performance log specified by LogEntryKey.
116 If it stands for a valid entry, then EFI_SUCCESS is returned and
117 GaugeDataEntryEx stores the pointer to that entry.
119 @param LogEntryKey The key for the previous performance measurement log entry.
120 If 0, then the first performance measurement log entry is retrieved.
121 @param GaugeDataEntryEx The indirect pointer to the extended gauge data entry specified by LogEntryKey
122 if the retrieval is successful.
124 @retval EFI_SUCCESS The GuageDataEntryEx is successfully found based on LogEntryKey.
125 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
126 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
127 @retval EFI_INVALIDE_PARAMETER GaugeDataEntryEx is NULL.
133 IN UINTN LogEntryKey
,
134 OUT GAUGE_DATA_ENTRY_EX
**GaugeDataEntryEx
138 // Interface declarations for Performance Protocol.
141 Adds a record at the end of the performance measurement log
142 that records the start time of a performance measurement.
144 Adds a record to the end of the performance measurement log
145 that contains the Handle, Token, and Module.
146 The end time of the new record must be set to zero.
147 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
148 If TimeStamp is zero, the start time in the record is filled in with the value
149 read from the current time stamp.
151 @param Handle Pointer to environment specific context used
152 to identify the component being measured.
153 @param Token Pointer to a Null-terminated ASCII string
154 that identifies the component being measured.
155 @param Module Pointer to a Null-terminated ASCII string
156 that identifies the module being measured.
157 @param TimeStamp 64-bit time stamp.
159 @retval EFI_SUCCESS The data was read correctly from the device.
160 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
166 IN CONST VOID
*Handle
, OPTIONAL
167 IN CONST CHAR8
*Token
, OPTIONAL
168 IN CONST CHAR8
*Module
, OPTIONAL
173 Searches the performance measurement log from the beginning of the log
174 for the first matching record that contains a zero end time and fills in a valid end time.
176 Searches the performance measurement log from the beginning of the log
177 for the first record that matches Handle, Token, and Module and has an end time value of zero.
178 If the record can not be found then return EFI_NOT_FOUND.
179 If the record is found and TimeStamp is not zero,
180 then the end time in the record is filled in with the value specified by TimeStamp.
181 If the record is found and TimeStamp is zero, then the end time in the matching record
182 is filled in with the current time stamp value.
184 @param Handle Pointer to environment specific context used
185 to identify the component being measured.
186 @param Token Pointer to a Null-terminated ASCII string
187 that identifies the component being measured.
188 @param Module Pointer to a Null-terminated ASCII string
189 that identifies the module being measured.
190 @param TimeStamp 64-bit time stamp.
192 @retval EFI_SUCCESS The end of the measurement was recorded.
193 @retval EFI_NOT_FOUND The specified measurement record could not be found.
199 IN CONST VOID
*Handle
, OPTIONAL
200 IN CONST CHAR8
*Token
, OPTIONAL
201 IN CONST CHAR8
*Module
, OPTIONAL
206 Retrieves a previously logged performance measurement.
207 It can also retrieve the log created by StartGaugeEx and EndGaugeEx of PERFORMANCE_EX_PROTOCOL,
208 and then eliminate the Identifier.
210 Retrieves the performance log entry from the performance log specified by LogEntryKey.
211 If it stands for a valid entry, then EFI_SUCCESS is returned and
212 GaugeDataEntry stores the pointer to that entry.
214 @param LogEntryKey The key for the previous performance measurement log entry.
215 If 0, then the first performance measurement log entry is retrieved.
216 @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
217 if the retrieval is successful.
219 @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
220 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
221 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
222 @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
228 IN UINTN LogEntryKey
,
229 OUT GAUGE_DATA_ENTRY
**GaugeDataEntry