MdeModulePkg/PerformanceMeasurement.h: Correct the license
[mirror_edk2.git] / MdeModulePkg / Include / Guid / PerformanceMeasurement.h
1 /** @file
2
3 Performance measurement protocol, allows logging performance data.
4
5 Copyright (c) 2017, Microsoft Corporation<BR>
6 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials are licensed and made available under
8 the terms and conditions of the BSD License that accompanies this distribution.
9 The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef _PERFORMANCE_MEASUREMENT_H_
18 #define _PERFORMANCE_MEASUREMENT_H_
19
20 //
21 // GUID for Performance measurement Protocol
22 //
23 #define PERFORMANCE_MEASUREMENT_PROTOCOL_GUID \
24 { 0xc85d06be, 0x5f75, 0x48ce, {0xa8, 0x0f, 0x12, 0x36, 0xba, 0x3b, 0x87, 0xb1 } }
25
26 #define SMM_PERFORMANCE_MEASUREMENT_PROTOCOL_GUID \
27 { 0xd56b6d73, 0x1a7b, 0x4015, {0x9b, 0xb4, 0x7b, 0x07, 0x17, 0x29, 0xed, 0x24 } }
28
29 typedef struct _EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL;
30
31 typedef enum {
32 PerfStartEntry, // used in StartPerformanceMeasurement()/StartPerformanceMeasurementEx()
33 // (map to PERF_START/PERF_START_EX)
34 PerfEndEntry, // used in EndPerformanceMeasurement()/EndPerformanceMeasurementEx()
35 // (map to PERF_END/PERF_END_EX)
36 PerfEntry // used in LogPerformanceMeasurement()
37 // (map to other Perf macros except above 4 macros)
38 } PERF_MEASUREMENT_ATTRIBUTE;
39
40 /**
41 Create performance record with event description and a timestamp.
42
43 @param CallerIdentifier - Image handle or pointer to caller ID GUID.
44 @param Guid - Pointer to a GUID.
45 @param String - Pointer to a string describing the measurement.
46 @param TimeStamp - 64-bit time stamp.
47 @param Address - Pointer to a location in memory relevant to the measurement.
48 @param Identifier - Performance identifier describing the type of measurement.
49 @param Attribute - The attribute of the measurement. According to attribute can create a start
50 record for PERF_START/PERF_START_EX, or a end record for PERF_END/PERF_END_EX,
51 or a general record for other Perf macros.
52
53 @retval EFI_SUCCESS - Successfully created performance record.
54 @retval EFI_OUT_OF_RESOURCES - Ran out of space to store the records.
55 @retval EFI_INVALID_PARAMETER - Invalid parameter passed to function - NULL
56 pointer or invalid PerfId.
57
58 **/
59 typedef
60 EFI_STATUS
61 (EFIAPI *CREATE_PERFORMANCE_MEASUREMENT)(
62 IN CONST VOID *CallerIdentifier, OPTIONAL
63 IN CONST VOID *Guid, OPTIONAL
64 IN CONST CHAR8 *String, OPTIONAL
65 IN UINT64 TimeStamp, OPTIONAL
66 IN UINT64 Address, OPTIONAL
67 IN UINT32 Identifier,
68 IN PERF_MEASUREMENT_ATTRIBUTE Attribute
69 );
70
71 struct _EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL {
72 CREATE_PERFORMANCE_MEASUREMENT CreatePerformanceMeasurement;
73 };
74
75 extern EFI_GUID gEdkiiPerformanceMeasurementProtocolGuid;
76 extern EFI_GUID gEdkiiSmmPerformanceMeasurementProtocolGuid;
77
78 #endif // _PERFORMANCE_MEASUREMENT_H_