1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5#ifndef __EVENTPIPE_METADATAGENERATOR_H__
6#define __EVENTPIPE_METADATAGENERATOR_H__
7
8#ifdef FEATURE_PERFTRACING
9
10enum class EventPipeEventLevel;
11
12// Represents the type of an event parameter.
13// This enum is derived from the managed TypeCode type, though
14// not all of these values are available in TypeCode.
15// For example, Guid does not exist in TypeCode.
16enum class EventPipeParameterType
17{
18 Empty = 0, // Null reference
19 Object = 1, // Instance that isn't a value
20 DBNull = 2, // Database null value
21 Boolean = 3, // Boolean
22 Char = 4, // Unicode character
23 SByte = 5, // Signed 8-bit integer
24 Byte = 6, // Unsigned 8-bit integer
25 Int16 = 7, // Signed 16-bit integer
26 UInt16 = 8, // Unsigned 16-bit integer
27 Int32 = 9, // Signed 32-bit integer
28 UInt32 = 10, // Unsigned 32-bit integer
29 Int64 = 11, // Signed 64-bit integer
30 UInt64 = 12, // Unsigned 64-bit integer
31 Single = 13, // IEEE 32-bit float
32 Double = 14, // IEEE 64-bit double
33 Decimal = 15, // Decimal
34 DateTime = 16, // DateTime
35 Guid = 17, // Guid
36 String = 18, // Unicode character string
37};
38
39// Contains the metadata associated with an EventPipe event parameter.
40struct EventPipeParameterDesc
41{
42 EventPipeParameterType Type;
43 LPCWSTR Name;
44};
45
46// Generates metadata for an event emitted by the EventPipe.
47class EventPipeMetadataGenerator
48{
49public:
50 static BYTE* GenerateEventMetadata(
51 unsigned int eventID,
52 LPCWSTR pEventName,
53 INT64 keywords,
54 unsigned int version,
55 EventPipeEventLevel level,
56 EventPipeParameterDesc *pParams,
57 unsigned int paramCount,
58 size_t &metadataLength);
59};
60
61#endif // FEATURE_PERFTRACING
62
63#endif // __EVENTPIPE_METADATAGENERATOR_H__
64