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