]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePerformanceLibNull/PerformanceLib.c
remove some comments introduced by tools.
[mirror_edk2.git] / MdePkg / Library / BasePerformanceLibNull / PerformanceLib.c
CommitLineData
e1f414b6 1/** @file\r
2 Base Performance Library which provides no service.\r
3\r
4 Copyright (c) 2006, Intel Corporation<BR>\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
e1f414b6 13**/\r
14\r
c892d846 15\r
c7d265a9 16#include <Base.h>\r
c892d846 17\r
18\r
c7d265a9 19#include <Library/PerformanceLib.h>\r
20#include <Library/DebugLib.h>\r
21#include <Library/PcdLib.h>\r
e1f414b6 22\r
23/**\r
24 Creates a record for the beginning of a performance measurement. \r
25 \r
26 Creates a record that contains the Handle, Token, and Module.\r
27 If TimeStamp is not zero, then TimeStamp is added to the record as the start time.\r
28 If TimeStamp is zero, then this function reads the current time stamp\r
29 and adds that time stamp value to the record as the start time.\r
30\r
31 @param Handle Pointer to environment specific context used\r
32 to identify the component being measured.\r
33 @param Token Pointer to a Null-terminated ASCII string\r
34 that identifies the component being measured.\r
35 @param Module Pointer to a Null-terminated ASCII string\r
36 that identifies the module being measured.\r
37 @param TimeStamp 64-bit time stamp.\r
38\r
39 @retval RETURN_SUCCESS The start of the measurement was recorded.\r
40 @retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r
41\r
42**/\r
43RETURN_STATUS\r
44EFIAPI\r
45StartPerformanceMeasurement (\r
46 IN CONST VOID *Handle, OPTIONAL\r
47 IN CONST CHAR8 *Token,\r
48 IN CONST CHAR8 *Module,\r
49 IN UINT64 TimeStamp\r
50 )\r
51{\r
52 return RETURN_SUCCESS;\r
53}\r
54\r
55/**\r
56 Fills in the end time of a performance measurement. \r
57 \r
58 Looks up the record that matches Handle, Token, and Module.\r
59 If the record can not be found then return RETURN_NOT_FOUND.\r
60 If the record is found and TimeStamp is not zero,\r
61 then TimeStamp is added to the record as the end time.\r
62 If the record is found and TimeStamp is zero, then this function reads\r
63 the current time stamp and adds that time stamp value to the record as the end time.\r
64 If this function is called multiple times for the same record, then the end time is overwritten.\r
65\r
66 @param Handle Pointer to environment specific context used\r
67 to identify the component being measured.\r
68 @param Token Pointer to a Null-terminated ASCII string\r
69 that identifies the component being measured.\r
70 @param Module Pointer to a Null-terminated ASCII string\r
71 that identifies the module being measured.\r
72 @param TimeStamp 64-bit time stamp.\r
73\r
74 @retval RETURN_SUCCESS The end of the measurement was recorded.\r
75 @retval RETURN_NOT_FOUND The specified measurement record could not be found.\r
76\r
77**/\r
78RETURN_STATUS\r
79EFIAPI\r
80EndPerformanceMeasurement (\r
81 IN CONST VOID *Handle, OPTIONAL\r
82 IN CONST CHAR8 *Token,\r
83 IN CONST CHAR8 *Module,\r
84 IN UINT64 TimeStamp\r
85 )\r
86{\r
87 return RETURN_SUCCESS;\r
88}\r
89\r
90/**\r
91 Attempts to retrieve a performance measurement log entry from the performance measurement log. \r
92 \r
93 Attempts to retrieve the performance log entry specified by LogEntryKey. If LogEntryKey is\r
94 zero on entry, then an attempt is made to retrieve the first entry from the performance log,\r
95 and the key for the second entry in the log is returned. If the performance log is empty,\r
96 then no entry is retrieved and zero is returned. If LogEntryKey is not zero, then the performance\r
97 log entry associated with LogEntryKey is retrieved, and the key for the next entry in the log is\r
98 returned. If LogEntryKey is the key for the last entry in the log, then the last log entry is\r
99 retrieved and an implementation specific non-zero key value that specifies the end of the performance\r
100 log is returned. If LogEntryKey is equal this implementation specific non-zero key value, then no entry\r
101 is retrieved and zero is returned. In the cases where a performance log entry can be returned,\r
102 the log entry is returned in Handle, Token, Module, StartTimeStamp, and EndTimeStamp.\r
103 If LogEntryKey is not a valid log entry key for the performance measurement log, then ASSERT().\r
104 If Handle is NULL, then ASSERT().\r
105 If Token is NULL, then ASSERT().\r
106 If Module is NULL, then ASSERT().\r
107 If StartTimeStamp is NULL, then ASSERT().\r
108 If EndTimeStamp is NULL, then ASSERT().\r
109\r
110 @param LogEntryKey On entry, the key of the performance measurement log entry to retrieve.\r
111 0, then the first performance measurement log entry is retrieved.\r
112 On exit, the key of the next performance lof entry entry.\r
113 @param Handle Pointer to environment specific context used to identify the component\r
114 being measured. \r
115 @param Token Pointer to a Null-terminated ASCII string that identifies the component\r
116 being measured. \r
117 @param Module Pointer to a Null-terminated ASCII string that identifies the module\r
118 being measured.\r
119 @param StartTimeStamp Pointer to the 64-bit time stamp that was recorded when the measurement\r
120 was started.\r
121 @param EndTimeStamp Pointer to the 64-bit time stamp that was recorded when the measurement\r
122 was ended.\r
123\r
124 @return The key for the next performance log entry (in general case).\r
125\r
126**/\r
127UINTN\r
128EFIAPI\r
129GetPerformanceMeasurement (\r
130 IN UINTN LogEntryKey, \r
131 OUT CONST VOID **Handle,\r
132 OUT CONST CHAR8 **Token,\r
133 OUT CONST CHAR8 **Module,\r
134 OUT UINT64 *StartTimeStamp,\r
135 OUT UINT64 *EndTimeStamp\r
136 )\r
137{\r
138 ASSERT (Handle != NULL);\r
139 ASSERT (Token != NULL);\r
140 ASSERT (Module != NULL);\r
141 ASSERT (StartTimeStamp != NULL);\r
142 ASSERT (EndTimeStamp != NULL);\r
143\r
144 return 0;\r
145}\r
146\r
147/**\r
148 Returns TRUE if the performance measurement macros are enabled. \r
149 \r
150 This function returns TRUE if the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of\r
151 PcdPerformanceLibraryPropertyMask is set. Otherwise FALSE is returned.\r
152\r
153 @retval TRUE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of\r
154 PcdPerformanceLibraryPropertyMask is set.\r
155 @retval FALSE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of\r
156 PcdPerformanceLibraryPropertyMask is clear.\r
157\r
158**/\r
159BOOLEAN\r
160EFIAPI\r
161PerformanceMeasurementEnabled (\r
162 VOID\r
163 )\r
164{\r
165 return (BOOLEAN) ((PcdGet8(PcdPerformanceLibraryPropertyMask) & PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED) != 0);\r
166}\r