diff options
Diffstat (limited to 'src/vm/eventpipeinternal.cpp')
-rw-r--r-- | src/vm/eventpipeinternal.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/vm/eventpipeinternal.cpp b/src/vm/eventpipeinternal.cpp index 17efeb39e6..9291d6b228 100644 --- a/src/vm/eventpipeinternal.cpp +++ b/src/vm/eventpipeinternal.cpp @@ -20,7 +20,7 @@ UINT64 QCALLTYPE EventPipeInternal::Enable( __in_z LPCWSTR outputFile, UINT32 circularBufferSizeInMB, - INT64 profilerSamplingRateInNanoseconds, + UINT64 profilerSamplingRateInNanoseconds, EventPipeProviderConfiguration *pProviders, UINT32 numProviders) { @@ -28,6 +28,15 @@ UINT64 QCALLTYPE EventPipeInternal::Enable( UINT64 sessionID = 0; + // Invalid input! + if (circularBufferSizeInMB == 0 || + profilerSamplingRateInNanoseconds == 0 || + numProviders == 0 || + pProviders == nullptr) + { + return 0; + } + BEGIN_QCALL; { sessionID = EventPipe::Enable( @@ -35,7 +44,9 @@ UINT64 QCALLTYPE EventPipeInternal::Enable( circularBufferSizeInMB, profilerSamplingRateInNanoseconds, pProviders, - numProviders); + numProviders, + outputFile != NULL ? EventPipeSessionType::File : EventPipeSessionType::Streaming, + nullptr); } END_QCALL; |