]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLibInternal.h
2 Master header files for SmmCorePerformanceLib instance.
4 This header file holds the prototypes of the SMM Performance and PerformanceEx Protocol published by this
5 library instance at its constructor.
7 Copyright (c) 2011 - 2015, 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 _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_
19 #define _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_
22 #include <Guid/Performance.h>
24 #include <Library/SmmServicesTableLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/PerformanceLib.h>
27 #include <Library/BaseLib.h>
28 #include <Library/BaseMemoryLib.h>
29 #include <Library/TimerLib.h>
30 #include <Library/PcdLib.h>
31 #include <Library/UefiLib.h>
32 #include <Library/UefiBootServicesTableLib.h>
33 #include <Library/MemoryAllocationLib.h>
34 #include <Library/SynchronizationLib.h>
35 #include <Library/SmmMemLib.h>
37 #include <Protocol/SmmBase2.h>
40 // Interface declarations for SMM PerformanceEx Protocol.
43 Adds a record at the end of the performance measurement log
44 that records the start time of a performance measurement.
46 Adds a record to the end of the performance measurement log
47 that contains the Handle, Token, Module and Identifier.
48 The end time of the new record must be set to zero.
49 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
50 If TimeStamp is zero, the start time in the record is filled in with the value
51 read from the current time stamp.
53 @param Handle Pointer to environment specific context used
54 to identify the component being measured.
55 @param Token Pointer to a Null-terminated ASCII string
56 that identifies the component being measured.
57 @param Module Pointer to a Null-terminated ASCII string
58 that identifies the module being measured.
59 @param TimeStamp 64-bit time stamp.
60 @param Identifier 32-bit identifier. If the value is 0, the created record
61 is same as the one created by StartGauge of PERFORMANCE_PROTOCOL.
63 @retval EFI_SUCCESS The data was read correctly from the device.
64 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
70 IN CONST VOID
*Handle
, OPTIONAL
71 IN CONST CHAR8
*Token
, OPTIONAL
72 IN CONST CHAR8
*Module
, OPTIONAL
78 Searches the performance measurement log from the beginning of the log
79 for the first matching record that contains a zero end time and fills in a valid end time.
81 Searches the performance measurement log from the beginning of the log
82 for the first record that matches Handle, Token, Module and Identifier and has an end time value of zero.
83 If the record can not be found then return EFI_NOT_FOUND.
84 If the record is found and TimeStamp is not zero,
85 then the end time in the record is filled in with the value specified by TimeStamp.
86 If the record is found and TimeStamp is zero, then the end time in the matching record
87 is filled in with the current time stamp value.
89 @param Handle Pointer to environment specific context used
90 to identify the component being measured.
91 @param Token Pointer to a Null-terminated ASCII string
92 that identifies the component being measured.
93 @param Module Pointer to a Null-terminated ASCII string
94 that identifies the module being measured.
95 @param TimeStamp 64-bit time stamp.
96 @param Identifier 32-bit identifier. If the value is 0, the found record
97 is same as the one found by EndGauge of PERFORMANCE_PROTOCOL.
99 @retval EFI_SUCCESS The end of the measurement was recorded.
100 @retval EFI_NOT_FOUND The specified measurement record could not be found.
106 IN CONST VOID
*Handle
, OPTIONAL
107 IN CONST CHAR8
*Token
, OPTIONAL
108 IN CONST CHAR8
*Module
, OPTIONAL
114 Retrieves a previously logged performance measurement.
115 It can also retrieve the log created by StartGauge and EndGauge of PERFORMANCE_PROTOCOL,
116 and then assign the Identifier with 0.
118 Retrieves the performance log entry from the performance log specified by LogEntryKey.
119 If it stands for a valid entry, then EFI_SUCCESS is returned and
120 GaugeDataEntryEx stores the pointer to that entry.
122 @param LogEntryKey The key for the previous performance measurement log entry.
123 If 0, then the first performance measurement log entry is retrieved.
124 @param GaugeDataEntryEx The indirect pointer to the extended gauge data entry specified by LogEntryKey
125 if the retrieval is successful.
127 @retval EFI_SUCCESS The GuageDataEntryEx is successfully found based on LogEntryKey.
128 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
129 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
130 @retval EFI_INVALIDE_PARAMETER GaugeDataEntryEx is NULL.
136 IN UINTN LogEntryKey
,
137 OUT GAUGE_DATA_ENTRY_EX
**GaugeDataEntryEx
141 // Interface declarations for SMM Performance Protocol.
144 Adds a record at the end of the performance measurement log
145 that records the start time of a performance measurement.
147 Adds a record to the end of the performance measurement log
148 that contains the Handle, Token, and Module.
149 The end time of the new record must be set to zero.
150 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
151 If TimeStamp is zero, the start time in the record is filled in with the value
152 read from the current time stamp.
154 @param Handle Pointer to environment specific context used
155 to identify the component being measured.
156 @param Token Pointer to a Null-terminated ASCII string
157 that identifies the component being measured.
158 @param Module Pointer to a Null-terminated ASCII string
159 that identifies the module being measured.
160 @param TimeStamp 64-bit time stamp.
162 @retval EFI_SUCCESS The data was read correctly from the device.
163 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
169 IN CONST VOID
*Handle
, OPTIONAL
170 IN CONST CHAR8
*Token
, OPTIONAL
171 IN CONST CHAR8
*Module
, OPTIONAL
176 Searches the performance measurement log from the beginning of the log
177 for the first matching record that contains a zero end time and fills in a valid end time.
179 Searches the performance measurement log from the beginning of the log
180 for the first record that matches Handle, Token, and Module and has an end time value of zero.
181 If the record can not be found then return EFI_NOT_FOUND.
182 If the record is found and TimeStamp is not zero,
183 then the end time in the record is filled in with the value specified by TimeStamp.
184 If the record is found and TimeStamp is zero, then the end time in the matching record
185 is filled in with the current time stamp value.
187 @param Handle Pointer to environment specific context used
188 to identify the component being measured.
189 @param Token Pointer to a Null-terminated ASCII string
190 that identifies the component being measured.
191 @param Module Pointer to a Null-terminated ASCII string
192 that identifies the module being measured.
193 @param TimeStamp 64-bit time stamp.
195 @retval EFI_SUCCESS The end of the measurement was recorded.
196 @retval EFI_NOT_FOUND The specified measurement record could not be found.
202 IN CONST VOID
*Handle
, OPTIONAL
203 IN CONST CHAR8
*Token
, OPTIONAL
204 IN CONST CHAR8
*Module
, OPTIONAL
209 Retrieves a previously logged performance measurement.
210 It can also retrieve the log created by StartGaugeEx and EndGaugeEx of PERFORMANCE_EX_PROTOCOL,
211 and then eliminate the Identifier.
213 Retrieves the performance log entry from the performance log specified by LogEntryKey.
214 If it stands for a valid entry, then EFI_SUCCESS is returned and
215 GaugeDataEntry stores the pointer to that entry.
217 @param LogEntryKey The key for the previous performance measurement log entry.
218 If 0, then the first performance measurement log entry is retrieved.
219 @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
220 if the retrieval is successful.
222 @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
223 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
224 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
225 @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
231 IN UINTN LogEntryKey
,
232 OUT GAUGE_DATA_ENTRY
**GaugeDataEntry