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