Skip to content

Commit 84a8d4d

Browse files
committed
Fixing up FEATURE_EVENTSOURCE_XPLAT
1 parent 83e52fa commit 84a8d4d

4 files changed

Lines changed: 45 additions & 30 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,10 @@ if(CLR_CMAKE_PLATFORM_LINUX AND CLR_CMAKE_PLATFORM_ARCH_AMD64)
693693
set(FEATURE_EVENT_TRACE 1)
694694
endif()
695695

696+
if(CLR_CMAKE_PLATFORM_UNIX)
697+
add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
698+
endif(CLR_CMAKE_PLATFORM_UNIX)
699+
696700
if(CLR_CMAKE_PLATFORM_UNIX)
697701
add_subdirectory(src/ToolBox/SOS/lldbplugin)
698702
add_subdirectory(src/pal)
@@ -825,9 +829,6 @@ if(CLR_CMAKE_PLATFORM_UNIX)
825829
endif(CLR_CMAKE_PLATFORM_UNIX)
826830
if(FEATURE_EVENT_TRACE)
827831
add_definitions(-DFEATURE_EVENT_TRACE=1)
828-
if(CLR_CMAKE_PLATFORM_UNIX)
829-
add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
830-
endif(CLR_CMAKE_PLATFORM_UNIX)
831832
endif(FEATURE_EVENT_TRACE)
832833
add_definitions(-DFEATURE_EXCEPTIONDISPATCHINFO)
833834
# NetBSD doesn't implement this feature

src/vm/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ set(VM_SOURCES_WKS
267267
typeparse.cpp
268268
verifier.cpp
269269
weakreferencenative.cpp
270+
nativeeventsource.cpp
270271
)
271272

272273
if(FEATURE_EVENT_TRACE)

src/vm/eventtrace.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7389,31 +7389,4 @@ VOID ETW::EnumerationLog::EnumerationHelper(Module *moduleFilter, BaseDomain *do
73897389
}
73907390
}
73917391

7392-
#if defined(FEATURE_EVENTSOURCE_XPLAT)
7393-
7394-
void QCALLTYPE XplatEventSourceLogger::LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload)
7395-
{
7396-
QCALL_CONTRACT;
7397-
7398-
BEGIN_QCALL;
7399-
FireEtwEventSource(eventID, eventName, eventSourceName, payload);
7400-
END_QCALL;
7401-
}
7402-
7403-
BOOL QCALLTYPE XplatEventSourceLogger::IsEventSourceLoggingEnabled()
7404-
{
7405-
QCALL_CONTRACT;
7406-
7407-
BOOL retVal = FALSE;
7408-
7409-
BEGIN_QCALL;
7410-
retVal = XplatEventLogger::IsEventLoggingEnabled();
7411-
END_QCALL;
7412-
7413-
return retVal;
7414-
7415-
}
7416-
7417-
#endif //defined(FEATURE_EVENTSOURCE_XPLAT)
7418-
74197392
#endif // !FEATURE_REDHAWK

src/vm/nativeeventsource.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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.
4+
//
5+
// File: nativeeventsource.cpp
6+
// Abstract: This module implements native part of Event Source support in VM
7+
//
8+
9+
//
10+
11+
//
12+
// ============================================================================
13+
14+
#if defined(FEATURE_EVENTSOURCE_XPLAT)
15+
#include "common.h"
16+
#include "eventtracepriv.h"
17+
18+
void QCALLTYPE XplatEventSourceLogger::LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload)
19+
{
20+
QCALL_CONTRACT;
21+
BEGIN_QCALL;
22+
FireEtwEventSource(eventID, eventName, eventSourceName, payload);
23+
END_QCALL;
24+
}
25+
26+
BOOL QCALLTYPE XplatEventSourceLogger::IsEventSourceLoggingEnabled()
27+
{
28+
QCALL_CONTRACT;
29+
30+
BOOL retVal = FALSE;
31+
32+
BEGIN_QCALL;
33+
retVal = XplatEventLogger::IsEventLoggingEnabled();
34+
END_QCALL;
35+
36+
return retVal;
37+
38+
}
39+
40+
#endif //defined(FEATURE_EVENTSOURCE_XPLAT)

0 commit comments

Comments
 (0)