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