From 377073385e4545d36e1a96429dd78548f87c597c Mon Sep 17 00:00:00 2001 From: Brian Robbins Date: Wed, 10 May 2017 15:11:28 -0700 Subject: Re-Factor EventSource to Support Writing to EventPipe (#11435) Re-Factor EventSource to Support Writing to EventPipe. --- src/vm/eventpipe.cpp | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) (limited to 'src/vm/eventpipe.cpp') diff --git a/src/vm/eventpipe.cpp b/src/vm/eventpipe.cpp index 8ea3f0867e..bed4cfdbc4 100644 --- a/src/vm/eventpipe.cpp +++ b/src/vm/eventpipe.cpp @@ -184,8 +184,10 @@ void EventPipe::WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int leng length); // Write to the EventPipeFile. - _ASSERTE(s_pFile != NULL); - s_pFile->WriteEvent(instance); + if(s_pFile != NULL) + { + s_pFile->WriteEvent(instance); + } // Write to the EventPipeJsonFile if it exists. if(s_pJsonFile != NULL) @@ -306,4 +308,67 @@ CrstStatic* EventPipe::GetLock() return &s_configCrst; } +INT_PTR QCALLTYPE EventPipeInternal::CreateProvider( + GUID providerID, + EventPipeCallback pCallbackFunc) +{ + QCALL_CONTRACT; + + EventPipeProvider *pProvider = NULL; + + BEGIN_QCALL; + + pProvider = new EventPipeProvider(providerID, pCallbackFunc, NULL); + + END_QCALL; + + return reinterpret_cast(pProvider); +} + +INT_PTR QCALLTYPE EventPipeInternal::AddEvent( + INT_PTR provHandle, + __int64 keywords, + unsigned int eventID, + unsigned int eventVersion, + unsigned int level, + bool needStack) +{ + QCALL_CONTRACT; + BEGIN_QCALL; + + // TODO + + END_QCALL; + + return 0; +} + +void QCALLTYPE EventPipeInternal::DeleteProvider( + INT_PTR provHandle) +{ + QCALL_CONTRACT; + BEGIN_QCALL; + + if(provHandle != NULL) + { + EventPipeProvider *pProvider = reinterpret_cast(provHandle); + delete pProvider; + } + + END_QCALL; +} + +void QCALLTYPE EventPipeInternal::WriteEvent( + INT_PTR eventHandle, + void *pData, + unsigned int length) +{ + QCALL_CONTRACT; + BEGIN_QCALL; + + // TODO + + END_QCALL; +} + #endif // FEATURE_PERFTRACING -- cgit v1.2.3