From b388f6cd87d87f4a07fe966aaa1bc92f245165d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rivero?= Date: Tue, 16 Apr 2019 18:58:31 -0700 Subject: [EventPipe] Minor bug fixes, and remove redundant/unused code. (#23956) - Update MicrosoftDiagnosticsTracingTraceEventPackageVersion - Delete connection if the request is unknown/unhandled - Adding missing error handling. - Provider names must be defined. - Some renaming, error handling, and build warnings. - Removing test code, and merge EventPipe::Enable functions. - Remove commented/non-used lines. --- src/vm/eventpipeinternal.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/vm/eventpipeinternal.cpp') 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; -- cgit v1.2.3