]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h
Program SD Cards into 4-bit mode (support for this is required in the spec). This...
[mirror_edk2.git] / MdeModulePkg / Library / DxeCorePerformanceLib / DxeCorePerformanceLibInternal.h
1 /** @file
2 Master header files for DxeCorePerformanceLib 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) 2006 - 2008, 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 _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_
19 #define _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_
20
21
22 #include <PiDxe.h>
23
24 #include <Guid/Performance.h>
25
26 #include <Library/PerformanceLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/HobLib.h>
29 #include <Library/BaseLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/TimerLib.h>
32 #include <Library/PcdLib.h>
33 #include <Library/UefiBootServicesTableLib.h>
34 #include <Library/MemoryAllocationLib.h>
35
36 //
37 // Interface declarations for Performance Protocol.
38 //
39 /**
40 Adds a record at the end of the performance measurement log
41 that records the start time of a performance measurement.
42
43 Adds a record to the end of the performance measurement log
44 that contains the Handle, Token, and Module.
45 The end time of the new record must be set to zero.
46 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
47 If TimeStamp is zero, the start time in the record is filled in with the value
48 read from the current time stamp.
49
50 @param Handle Pointer to environment specific context used
51 to identify the component being measured.
52 @param Token Pointer to a Null-terminated ASCII string
53 that identifies the component being measured.
54 @param Module Pointer to a Null-terminated ASCII string
55 that identifies the module being measured.
56 @param TimeStamp 64-bit time stamp.
57
58 @retval EFI_SUCCESS The data was read correctly from the device.
59 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
60
61 **/
62 EFI_STATUS
63 EFIAPI
64 StartGauge (
65 IN CONST VOID *Handle, OPTIONAL
66 IN CONST CHAR8 *Token, OPTIONAL
67 IN CONST CHAR8 *Module, OPTIONAL
68 IN UINT64 TimeStamp
69 );
70
71 /**
72 Searches the performance measurement log from the beginning of the log
73 for the first matching record that contains a zero end time and fills in a valid end time.
74
75 Searches the performance measurement log from the beginning of the log
76 for the first record that matches Handle, Token, and Module and has an end time value of zero.
77 If the record can not be found then return EFI_NOT_FOUND.
78 If the record is found and TimeStamp is not zero,
79 then the end time in the record is filled in with the value specified by TimeStamp.
80 If the record is found and TimeStamp is zero, then the end time in the matching record
81 is filled in with the current time stamp value.
82
83 @param Handle Pointer to environment specific context used
84 to identify the component being measured.
85 @param Token Pointer to a Null-terminated ASCII string
86 that identifies the component being measured.
87 @param Module Pointer to a Null-terminated ASCII string
88 that identifies the module being measured.
89 @param TimeStamp 64-bit time stamp.
90
91 @retval EFI_SUCCESS The end of the measurement was recorded.
92 @retval EFI_NOT_FOUND The specified measurement record could not be found.
93
94 **/
95 EFI_STATUS
96 EFIAPI
97 EndGauge (
98 IN CONST VOID *Handle, OPTIONAL
99 IN CONST CHAR8 *Token, OPTIONAL
100 IN CONST CHAR8 *Module, OPTIONAL
101 IN UINT64 TimeStamp
102 );
103
104 /**
105 Retrieves a previously logged performance measurement.
106
107 Retrieves the performance log entry from the performance log specified by LogEntryKey.
108 If it stands for a valid entry, then EFI_SUCCESS is returned and
109 GaugeDataEntry stores the pointer to that entry.
110
111 @param LogEntryKey The key for the previous performance measurement log entry.
112 If 0, then the first performance measurement log entry is retrieved.
113 @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
114 if the retrieval is successful.
115
116 @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
117 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
118 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
119 @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
120
121 **/
122 EFI_STATUS
123 EFIAPI
124 GetGauge (
125 IN UINTN LogEntryKey,
126 OUT GAUGE_DATA_ENTRY **GaugeDataEntry
127 );
128
129
130 #endif