Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit aaf464e

Browse files
committed
Add missing #ifdef.
1 parent f50f38b commit aaf464e

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/Common/src/CoreLib/System/Diagnostics/Tracing/EventSource.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,11 @@ protected unsafe void WriteEventWithRelatedActivityIdCore(int eventId, Guid* rel
11651165
}
11661166

11671167
#if FEATURE_MANAGED_ETW
1168-
if (m_eventData[eventId].EnabledForETW || m_eventData[eventId].EnabledForEventPipe)
1168+
if (m_eventData[eventId].EnabledForETW
1169+
#if FEATURE_PERFTRACING
1170+
|| m_eventData[eventId].EnabledForEventPipe
1171+
#endif // FEATURE_PERFTRACING
1172+
)
11691173
{
11701174
if (!SelfDescribingEvents)
11711175
{
@@ -1865,7 +1869,11 @@ private unsafe void WriteEventVarargs(int eventId, Guid* childActivityID, object
18651869
}
18661870

18671871
#if FEATURE_MANAGED_ETW
1868-
if (m_eventData[eventId].EnabledForETW || m_eventData[eventId].EnabledForEventPipe)
1872+
if (m_eventData[eventId].EnabledForETW
1873+
#if FEATURE_PERFTRACING
1874+
|| m_eventData[eventId].EnabledForEventPipe
1875+
#endif // FEATURE_PERFTRACING
1876+
)
18691877
{
18701878
if (!SelfDescribingEvents)
18711879
{
@@ -2339,7 +2347,9 @@ partial struct EventMetadata
23392347
public EventTags Tags;
23402348
public bool EnabledForAnyListener; // true if any dispatcher has this event turned on
23412349
public bool EnabledForETW; // is this event on for ETW?
2350+
#if FEATURE_PERFTRACING
23422351
public bool EnabledForEventPipe; // is this event on for EventPipe?
2352+
#endif
23432353

23442354
public bool HasRelatedActivityID; // Set if the event method's first parameter is a Guid named 'relatedActivityId'
23452355
#pragma warning disable 0649
@@ -2625,7 +2635,11 @@ internal bool EnableEventForDispatcher(EventDispatcher dispatcher, EventProvider
26252635
private bool AnyEventEnabled()
26262636
{
26272637
for (int i = 0; i < m_eventData.Length; i++)
2628-
if (m_eventData[i].EnabledForETW || m_eventData[i].EnabledForEventPipe || m_eventData[i].EnabledForAnyListener)
2638+
if (m_eventData[i].EnabledForETW || m_eventData[i].EnabledForAnyListener
2639+
#if FEATURE_PERFTRACING
2640+
|| m_eventData[i].EnabledForEventPipe
2641+
#endif // FEATURE_PERFTRACING
2642+
)
26292643
return true;
26302644
return false;
26312645
}

0 commit comments

Comments
 (0)