Skip to content

Commit

Permalink
Fixing up FEATURE_EVENTSOURCE_XPLAT
Browse files Browse the repository at this point in the history
  • Loading branch information
ramarag committed Apr 19, 2016
1 parent 83e52fa commit 84a8d4d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 30 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ if(CLR_CMAKE_PLATFORM_LINUX AND CLR_CMAKE_PLATFORM_ARCH_AMD64)
set(FEATURE_EVENT_TRACE 1)
endif()

if(CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
endif(CLR_CMAKE_PLATFORM_UNIX)

if(CLR_CMAKE_PLATFORM_UNIX)
add_subdirectory(src/ToolBox/SOS/lldbplugin)
add_subdirectory(src/pal)
Expand Down Expand Up @@ -825,9 +829,6 @@ if(CLR_CMAKE_PLATFORM_UNIX)
endif(CLR_CMAKE_PLATFORM_UNIX)
if(FEATURE_EVENT_TRACE)
add_definitions(-DFEATURE_EVENT_TRACE=1)
if(CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
endif(CLR_CMAKE_PLATFORM_UNIX)
endif(FEATURE_EVENT_TRACE)
add_definitions(-DFEATURE_EXCEPTIONDISPATCHINFO)
# NetBSD doesn't implement this feature
Expand Down
1 change: 1 addition & 0 deletions src/vm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ set(VM_SOURCES_WKS
typeparse.cpp
verifier.cpp
weakreferencenative.cpp
nativeeventsource.cpp
)

if(FEATURE_EVENT_TRACE)
Expand Down
27 changes: 0 additions & 27 deletions src/vm/eventtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7389,31 +7389,4 @@ VOID ETW::EnumerationLog::EnumerationHelper(Module *moduleFilter, BaseDomain *do
}
}

#if defined(FEATURE_EVENTSOURCE_XPLAT)

void QCALLTYPE XplatEventSourceLogger::LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload)
{
QCALL_CONTRACT;

BEGIN_QCALL;
FireEtwEventSource(eventID, eventName, eventSourceName, payload);
END_QCALL;
}

BOOL QCALLTYPE XplatEventSourceLogger::IsEventSourceLoggingEnabled()
{
QCALL_CONTRACT;

BOOL retVal = FALSE;

BEGIN_QCALL;
retVal = XplatEventLogger::IsEventLoggingEnabled();
END_QCALL;

return retVal;

}

#endif //defined(FEATURE_EVENTSOURCE_XPLAT)

#endif // !FEATURE_REDHAWK
40 changes: 40 additions & 0 deletions src/vm/nativeeventsource.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//
// File: nativeeventsource.cpp
// Abstract: This module implements native part of Event Source support in VM
//

//

//
// ============================================================================

#if defined(FEATURE_EVENTSOURCE_XPLAT)
#include "common.h"
#include "eventtracepriv.h"

void QCALLTYPE XplatEventSourceLogger::LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload)
{
QCALL_CONTRACT;
BEGIN_QCALL;
FireEtwEventSource(eventID, eventName, eventSourceName, payload);
END_QCALL;
}

BOOL QCALLTYPE XplatEventSourceLogger::IsEventSourceLoggingEnabled()
{
QCALL_CONTRACT;

BOOL retVal = FALSE;

BEGIN_QCALL;
retVal = XplatEventLogger::IsEventLoggingEnabled();
END_QCALL;

return retVal;

}

#endif //defined(FEATURE_EVENTSOURCE_XPLAT)

0 comments on commit 84a8d4d

Please sign in to comment.