]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLibInternal.h
Patch from open source community for CryptoPkg to allow it to build for ARM using...
[mirror_edk2.git] / MdeModulePkg / Library / SmmCorePerformanceLib / SmmCorePerformanceLibInternal.h
1 /** @file
2 Master header files for SmmCorePerformanceLib instance.
3
4 This header file holds the prototypes of the Performance Protocol published by this
5 library instance at its constructor.
6
7 Copyright (c) 2011, 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
12
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.
15
16 **/
17
18 #ifndef _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_
19 #define _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_
20
21
22 #include <Guid/Performance.h>
23
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
36 #include <Protocol/SmmBase2.h>
37 #include <Protocol/SmmAccess2.h>
38
39 //
40 // Interface declarations for Performance Protocol.
41 //
42 /**
43 Adds a record at the end of the performance measurement log
44 that records the start time of a performance measurement.
45
46 Adds a record to the end of the performance measurement log
47 that contains the Handle, Token, and Module.
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.
52
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
61 @retval EFI_SUCCESS The data was read correctly from the device.
62 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
63
64 **/
65 EFI_STATUS
66 EFIAPI
67 StartGauge (
68 IN CONST VOID *Handle, OPTIONAL
69 IN CONST CHAR8 *Token, OPTIONAL
70 IN CONST CHAR8 *Module, OPTIONAL
71 IN UINT64 TimeStamp
72 );
73
74 /**
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.
77
78 Searches the performance measurement log from the beginning of the log
79 for the first record that matches Handle, Token, and Module 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.
85
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
94 @retval EFI_SUCCESS The end of the measurement was recorded.
95 @retval EFI_NOT_FOUND The specified measurement record could not be found.
96
97 **/
98 EFI_STATUS
99 EFIAPI
100 EndGauge (
101 IN CONST VOID *Handle, OPTIONAL
102 IN CONST CHAR8 *Token, OPTIONAL
103 IN CONST CHAR8 *Module, OPTIONAL
104 IN UINT64 TimeStamp
105 );
106
107 /**
108 Retrieves a previously logged performance measurement.
109
110 Retrieves the performance log entry from the performance log specified by LogEntryKey.
111 If it stands for a valid entry, then EFI_SUCCESS is returned and
112 GaugeDataEntry stores the pointer to that entry.
113
114 @param LogEntryKey The key for the previous performance measurement log entry.
115 If 0, then the first performance measurement log entry is retrieved.
116 @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
117 if the retrieval is successful.
118
119 @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
120 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
121 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
122 @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
123
124 **/
125 EFI_STATUS
126 EFIAPI
127 GetGauge (
128 IN UINTN LogEntryKey,
129 OUT GAUGE_DATA_ENTRY **GaugeDataEntry
130 );
131
132
133 #endif