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