]>
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>
38 #include <Protocol/SmmAccess2.h>
41 // Interface declarations for SMM PerformanceEx Protocol.
44 Adds a record at the end of the performance measurement log
45 that records the start time of a performance measurement.
47 Adds a record to the end of the performance measurement log
48 that contains the Handle, Token, Module and Identifier.
49 The end time of the new record must be set to zero.
50 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
51 If TimeStamp is zero, the start time in the record is filled in with the value
52 read from the current time stamp.
54 @param Handle Pointer to environment specific context used
55 to identify the component being measured.
56 @param Token Pointer to a Null-terminated ASCII string
57 that identifies the component being measured.
58 @param Module Pointer to a Null-terminated ASCII string
59 that identifies the module being measured.
60 @param TimeStamp 64-bit time stamp.
61 @param Identifier 32-bit identifier. If the value is 0, the created record
62 is same as the one created by StartGauge of PERFORMANCE_PROTOCOL.
64 @retval EFI_SUCCESS The data was read correctly from the device.
65 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
71 IN CONST VOID
*Handle
, OPTIONAL
72 IN CONST CHAR8
*Token
, OPTIONAL
73 IN CONST CHAR8
*Module
, OPTIONAL
79 Searches the performance measurement log from the beginning of the log
80 for the first matching record that contains a zero end time and fills in a valid end time.
82 Searches the performance measurement log from the beginning of the log
83 for the first record that matches Handle, Token, Module and Identifier and has an end time value of zero.
84 If the record can not be found then return EFI_NOT_FOUND.
85 If the record is found and TimeStamp is not zero,
86 then the end time in the record is filled in with the value specified by TimeStamp.
87 If the record is found and TimeStamp is zero, then the end time in the matching record
88 is filled in with the current time stamp value.
90 @param Handle Pointer to environment specific context used
91 to identify the component being measured.
92 @param Token Pointer to a Null-terminated ASCII string
93 that identifies the component being measured.
94 @param Module Pointer to a Null-terminated ASCII string
95 that identifies the module being measured.
96 @param TimeStamp 64-bit time stamp.
97 @param Identifier 32-bit identifier. If the value is 0, the found record
98 is same as the one found by EndGauge of PERFORMANCE_PROTOCOL.
100 @retval EFI_SUCCESS The end of the measurement was recorded.
101 @retval EFI_NOT_FOUND The specified measurement record could not be found.
107 IN CONST VOID
*Handle
, OPTIONAL
108 IN CONST CHAR8
*Token
, OPTIONAL
109 IN CONST CHAR8
*Module
, OPTIONAL
115 Retrieves a previously logged performance measurement.
116 It can also retrieve the log created by StartGauge and EndGauge of PERFORMANCE_PROTOCOL,
117 and then assign the Identifier with 0.
119 Retrieves the performance log entry from the performance log specified by LogEntryKey.
120 If it stands for a valid entry, then EFI_SUCCESS is returned and
121 GaugeDataEntryEx stores the pointer to that entry.
123 @param LogEntryKey The key for the previous performance measurement log entry.
124 If 0, then the first performance measurement log entry is retrieved.
125 @param GaugeDataEntryEx The indirect pointer to the extended gauge data entry specified by LogEntryKey
126 if the retrieval is successful.
128 @retval EFI_SUCCESS The GuageDataEntryEx is successfully found based on LogEntryKey.
129 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
130 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
131 @retval EFI_INVALIDE_PARAMETER GaugeDataEntryEx is NULL.
137 IN UINTN LogEntryKey
,
138 OUT GAUGE_DATA_ENTRY_EX
**GaugeDataEntryEx
142 // Interface declarations for SMM Performance Protocol.
145 Adds a record at the end of the performance measurement log
146 that records the start time of a performance measurement.
148 Adds a record to the end of the performance measurement log
149 that contains the Handle, Token, and Module.
150 The end time of the new record must be set to zero.
151 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
152 If TimeStamp is zero, the start time in the record is filled in with the value
153 read from the current time stamp.
155 @param Handle Pointer to environment specific context used
156 to identify the component being measured.
157 @param Token Pointer to a Null-terminated ASCII string
158 that identifies the component being measured.
159 @param Module Pointer to a Null-terminated ASCII string
160 that identifies the module being measured.
161 @param TimeStamp 64-bit time stamp.
163 @retval EFI_SUCCESS The data was read correctly from the device.
164 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
170 IN CONST VOID
*Handle
, OPTIONAL
171 IN CONST CHAR8
*Token
, OPTIONAL
172 IN CONST CHAR8
*Module
, OPTIONAL
177 Searches the performance measurement log from the beginning of the log
178 for the first matching record that contains a zero end time and fills in a valid end time.
180 Searches the performance measurement log from the beginning of the log
181 for the first record that matches Handle, Token, and Module and has an end time value of zero.
182 If the record can not be found then return EFI_NOT_FOUND.
183 If the record is found and TimeStamp is not zero,
184 then the end time in the record is filled in with the value specified by TimeStamp.
185 If the record is found and TimeStamp is zero, then the end time in the matching record
186 is filled in with the current time stamp value.
188 @param Handle Pointer to environment specific context used
189 to identify the component being measured.
190 @param Token Pointer to a Null-terminated ASCII string
191 that identifies the component being measured.
192 @param Module Pointer to a Null-terminated ASCII string
193 that identifies the module being measured.
194 @param TimeStamp 64-bit time stamp.
196 @retval EFI_SUCCESS The end of the measurement was recorded.
197 @retval EFI_NOT_FOUND The specified measurement record could not be found.
203 IN CONST VOID
*Handle
, OPTIONAL
204 IN CONST CHAR8
*Token
, OPTIONAL
205 IN CONST CHAR8
*Module
, OPTIONAL
210 Retrieves a previously logged performance measurement.
211 It can also retrieve the log created by StartGaugeEx and EndGaugeEx of PERFORMANCE_EX_PROTOCOL,
212 and then eliminate the Identifier.
214 Retrieves the performance log entry from the performance log specified by LogEntryKey.
215 If it stands for a valid entry, then EFI_SUCCESS is returned and
216 GaugeDataEntry stores the pointer to that entry.
218 @param LogEntryKey The key for the previous performance measurement log entry.
219 If 0, then the first performance measurement log entry is retrieved.
220 @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
221 if the retrieval is successful.
223 @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
224 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
225 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
226 @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
232 IN UINTN LogEntryKey
,
233 OUT GAUGE_DATA_ENTRY
**GaugeDataEntry