]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Guid/PerformanceMeasurement.h
MdeModulePkg: Apply uncrustify changes
[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
9d510e61 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
56f7741e
BD
8\r
9**/\r
10\r
11#ifndef _PERFORMANCE_MEASUREMENT_H_\r
12#define _PERFORMANCE_MEASUREMENT_H_\r
13\r
14//\r
15// GUID for Performance measurement Protocol\r
16//\r
17#define PERFORMANCE_MEASUREMENT_PROTOCOL_GUID \\r
18 { 0xc85d06be, 0x5f75, 0x48ce, {0xa8, 0x0f, 0x12, 0x36, 0xba, 0x3b, 0x87, 0xb1 } }\r
19\r
20#define SMM_PERFORMANCE_MEASUREMENT_PROTOCOL_GUID \\r
21 { 0xd56b6d73, 0x1a7b, 0x4015, {0x9b, 0xb4, 0x7b, 0x07, 0x17, 0x29, 0xed, 0x24 } }\r
22\r
23typedef struct _EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL;\r
24\r
25typedef enum {\r
26 PerfStartEntry, // used in StartPerformanceMeasurement()/StartPerformanceMeasurementEx()\r
27 // (map to PERF_START/PERF_START_EX)\r
28 PerfEndEntry, // used in EndPerformanceMeasurement()/EndPerformanceMeasurementEx()\r
29 // (map to PERF_END/PERF_END_EX)\r
30 PerfEntry // used in LogPerformanceMeasurement()\r
31 // (map to other Perf macros except above 4 macros)\r
32} PERF_MEASUREMENT_ATTRIBUTE;\r
33\r
34/**\r
35 Create performance record with event description and a timestamp.\r
36\r
37 @param CallerIdentifier - Image handle or pointer to caller ID GUID.\r
38 @param Guid - Pointer to a GUID.\r
39 @param String - Pointer to a string describing the measurement.\r
40 @param TimeStamp - 64-bit time stamp.\r
41 @param Address - Pointer to a location in memory relevant to the measurement.\r
42 @param Identifier - Performance identifier describing the type of measurement.\r
43 @param Attribute - The attribute of the measurement. According to attribute can create a start\r
44 record for PERF_START/PERF_START_EX, or a end record for PERF_END/PERF_END_EX,\r
45 or a general record for other Perf macros.\r
46\r
47 @retval EFI_SUCCESS - Successfully created performance record.\r
48 @retval EFI_OUT_OF_RESOURCES - Ran out of space to store the records.\r
49 @retval EFI_INVALID_PARAMETER - Invalid parameter passed to function - NULL\r
50 pointer or invalid PerfId.\r
51\r
52**/\r
53typedef\r
54EFI_STATUS\r
55(EFIAPI *CREATE_PERFORMANCE_MEASUREMENT)(\r
e3917e22
MK
56 IN CONST VOID *CallerIdentifier OPTIONAL,\r
57 IN CONST VOID *Guid OPTIONAL,\r
58 IN CONST CHAR8 *String OPTIONAL,\r
59 IN UINT64 TimeStamp OPTIONAL,\r
60 IN UINT64 Address OPTIONAL,\r
56f7741e
BD
61 IN UINT32 Identifier,\r
62 IN PERF_MEASUREMENT_ATTRIBUTE Attribute\r
63 );\r
64\r
65struct _EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL {\r
1436aea4 66 CREATE_PERFORMANCE_MEASUREMENT CreatePerformanceMeasurement;\r
56f7741e
BD
67};\r
68\r
1436aea4
MK
69extern EFI_GUID gEdkiiPerformanceMeasurementProtocolGuid;\r
70extern EFI_GUID gEdkiiSmmPerformanceMeasurementProtocolGuid;\r
56f7741e
BD
71\r
72#endif // _PERFORMANCE_MEASUREMENT_H_\r