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.
5 #ifndef __EVENTPIPEINTERNAL_H__
6 #define __EVENTPIPEINTERNAL_H__
8 #ifdef FEATURE_PERFTRACING
10 // TODO: Maybe we should move the other types that are used on PInvoke here?
12 class EventPipeInternal
15 enum class ActivityControlCode
17 EVENT_ACTIVITY_CONTROL_GET_ID = 1,
18 EVENT_ACTIVITY_CONTROL_SET_ID = 2,
19 EVENT_ACTIVITY_CONTROL_CREATE_ID = 3,
20 EVENT_ACTIVITY_CONTROL_GET_SET_ID = 4,
21 EVENT_ACTIVITY_CONTROL_CREATE_SET_ID = 5
24 struct EventPipeEventInstanceData
28 unsigned int ThreadID;
29 LARGE_INTEGER TimeStamp;
31 GUID RelatedActivityId;
33 unsigned int PayloadLength;
36 struct EventPipeSessionInfo
38 FILETIME StartTimeAsUTCFileTime;
39 LARGE_INTEGER StartTimeStamp;
40 LARGE_INTEGER TimeStampFrequency;
45 //! Sets the sampling rate and enables the event pipe for the specified configuration.
47 static UINT64 QCALLTYPE Enable(
48 __in_z LPCWSTR outputFile,
49 EventPipeSerializationFormat format,
50 UINT32 circularBufferSizeInMB,
51 EventPipeProviderConfiguration *pProviders,
55 //! Disables the specified session Id.
57 static void QCALLTYPE Disable(UINT64 sessionID);
59 static bool QCALLTYPE GetSessionInfo(UINT64 sessionID, EventPipeSessionInfo *pSessionInfo);
61 static INT_PTR QCALLTYPE CreateProvider(
62 __in_z LPCWSTR providerName,
63 EventPipeCallback pCallbackFunc);
65 static INT_PTR QCALLTYPE DefineEvent(
72 UINT32 metadataLength);
74 static INT_PTR QCALLTYPE GetProvider(
75 __in_z LPCWSTR providerName);
77 static void QCALLTYPE DeleteProvider(
80 static int QCALLTYPE EventActivityIdControl(
84 static void QCALLTYPE WriteEvent(
89 LPCGUID pActivityId, LPCGUID pRelatedActivityId);
91 static void QCALLTYPE WriteEventData(
94 EventData *pEventData,
95 UINT32 eventDataCount,
96 LPCGUID pActivityId, LPCGUID pRelatedActivityId);
98 static bool QCALLTYPE GetNextEvent(
100 EventPipeEventInstanceData *pInstance);
102 static HANDLE QCALLTYPE GetWaitHandle(
107 #endif // FEATURE_PERFTRACING
109 #endif // __EVENTPIPEINTERNAL_H__