]>
Commit | Line | Data |
---|---|---|
d042c6e8 | 1 | /** @file\r |
2 | Master header files for SmmCorePerformanceLib instance.\r | |
3 | \r | |
4 | This header file holds the prototypes of the Performance Protocol published by this\r | |
5 | library instance at its constructor.\r | |
6 | \r | |
7 | Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r | |
8 | This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_\r | |
19 | #define _SMM_CORE_PERFORMANCE_LIB_INTERNAL_H_\r | |
20 | \r | |
21 | \r | |
22 | #include <Guid/Performance.h>\r | |
23 | \r | |
24 | #include <Library/SmmServicesTableLib.h>\r | |
25 | #include <Library/DebugLib.h>\r | |
26 | #include <Library/PerformanceLib.h>\r | |
27 | #include <Library/BaseLib.h>\r | |
28 | #include <Library/BaseMemoryLib.h>\r | |
29 | #include <Library/TimerLib.h>\r | |
30 | #include <Library/PcdLib.h>\r | |
31 | #include <Library/UefiLib.h> \r | |
32 | #include <Library/UefiBootServicesTableLib.h>\r | |
33 | #include <Library/MemoryAllocationLib.h>\r | |
34 | #include <Library/SynchronizationLib.h>\r | |
35 | \r | |
36 | #include <Protocol/SmmBase2.h>\r | |
37 | #include <Protocol/SmmAccess2.h>\r | |
38 | \r | |
39 | //\r | |
40 | // Interface declarations for Performance Protocol.\r | |
41 | //\r | |
42 | /**\r | |
43 | Adds a record at the end of the performance measurement log\r | |
44 | that records the start time of a performance measurement.\r | |
45 | \r | |
46 | Adds a record to the end of the performance measurement log\r | |
47 | that contains the Handle, Token, and Module.\r | |
48 | The end time of the new record must be set to zero.\r | |
49 | If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r | |
50 | If TimeStamp is zero, the start time in the record is filled in with the value\r | |
51 | read from the current time stamp.\r | |
52 | \r | |
53 | @param Handle Pointer to environment specific context used\r | |
54 | to identify the component being measured.\r | |
55 | @param Token Pointer to a Null-terminated ASCII string\r | |
56 | that identifies the component being measured.\r | |
57 | @param Module Pointer to a Null-terminated ASCII string\r | |
58 | that identifies the module being measured.\r | |
59 | @param TimeStamp 64-bit time stamp.\r | |
60 | \r | |
61 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
62 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r | |
63 | \r | |
64 | **/\r | |
65 | EFI_STATUS\r | |
66 | EFIAPI\r | |
67 | StartGauge (\r | |
68 | IN CONST VOID *Handle, OPTIONAL\r | |
69 | IN CONST CHAR8 *Token, OPTIONAL\r | |
70 | IN CONST CHAR8 *Module, OPTIONAL\r | |
71 | IN UINT64 TimeStamp\r | |
72 | );\r | |
73 | \r | |
74 | /**\r | |
75 | Searches the performance measurement log from the beginning of the log\r | |
76 | for the first matching record that contains a zero end time and fills in a valid end time.\r | |
77 | \r | |
78 | Searches the performance measurement log from the beginning of the log\r | |
79 | for the first record that matches Handle, Token, and Module and has an end time value of zero.\r | |
80 | If the record can not be found then return EFI_NOT_FOUND.\r | |
81 | If the record is found and TimeStamp is not zero,\r | |
82 | then the end time in the record is filled in with the value specified by TimeStamp.\r | |
83 | If the record is found and TimeStamp is zero, then the end time in the matching record\r | |
84 | is filled in with the current time stamp value.\r | |
85 | \r | |
86 | @param Handle Pointer to environment specific context used\r | |
87 | to identify the component being measured.\r | |
88 | @param Token Pointer to a Null-terminated ASCII string\r | |
89 | that identifies the component being measured.\r | |
90 | @param Module Pointer to a Null-terminated ASCII string\r | |
91 | that identifies the module being measured.\r | |
92 | @param TimeStamp 64-bit time stamp.\r | |
93 | \r | |
94 | @retval EFI_SUCCESS The end of the measurement was recorded.\r | |
95 | @retval EFI_NOT_FOUND The specified measurement record could not be found.\r | |
96 | \r | |
97 | **/\r | |
98 | EFI_STATUS\r | |
99 | EFIAPI\r | |
100 | EndGauge (\r | |
101 | IN CONST VOID *Handle, OPTIONAL\r | |
102 | IN CONST CHAR8 *Token, OPTIONAL\r | |
103 | IN CONST CHAR8 *Module, OPTIONAL\r | |
104 | IN UINT64 TimeStamp\r | |
105 | );\r | |
106 | \r | |
107 | /**\r | |
108 | Retrieves a previously logged performance measurement.\r | |
109 | \r | |
110 | Retrieves the performance log entry from the performance log specified by LogEntryKey.\r | |
111 | If it stands for a valid entry, then EFI_SUCCESS is returned and\r | |
112 | GaugeDataEntry stores the pointer to that entry.\r | |
113 | \r | |
114 | @param LogEntryKey The key for the previous performance measurement log entry.\r | |
115 | If 0, then the first performance measurement log entry is retrieved.\r | |
116 | @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey\r | |
117 | if the retrieval is successful.\r | |
118 | \r | |
119 | @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.\r | |
120 | @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).\r | |
121 | @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).\r | |
122 | @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.\r | |
123 | \r | |
124 | **/\r | |
125 | EFI_STATUS\r | |
126 | EFIAPI\r | |
127 | GetGauge (\r | |
128 | IN UINTN LogEntryKey,\r | |
129 | OUT GAUGE_DATA_ENTRY **GaugeDataEntry\r | |
130 | );\r | |
131 | \r | |
132 | \r | |
133 | #endif\r |