Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to EtwCallback and EtwCallbackCommon: #35793

Merged
merged 2 commits into from
May 6, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix Linux and OSX compile issues.
  • Loading branch information
PeterSolMS committed May 5, 2020
commit 5cf3de27da5e25a0ed3883a78f9080c253d31574
12 changes: 10 additions & 2 deletions src/coreclr/src/vm/eventtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4269,15 +4269,23 @@ VOID EtwCallbackCommon(
ctxToUpdate->EventPipeProvider.EnabledKeywordsBitmask = MatchAnyKeyword;
}

if ((ControlCode == EVENT_CONTROL_CODE_ENABLE_PROVIDER || ControlCode == EVENT_CONTROL_CODE_DISABLE_PROVIDER) &&
if (
#if !defined(HOST_UNIX)
(ControlCode == EVENT_CONTROL_CODE_ENABLE_PROVIDER || ControlCode == EVENT_CONTROL_CODE_DISABLE_PROVIDER) &&
#endif
(ProviderIndex == DotNETRuntime || ProviderIndex == DotNETRuntimePrivate))
{
// consolidate level and keywords across event pipe and ETW contexts -
#if !defined(HOST_UNIX)
// On Windows, consolidate level and keywords across event pipe and ETW contexts -
// ETW may still want to see events that event pipe doesn't care about and vice versa
GCEventKeyword keywords = static_cast<GCEventKeyword>(ctxToUpdate->EventPipeProvider.EnabledKeywordsBitmask |
ctxToUpdate->EtwProvider->MatchAnyKeyword);
GCEventLevel level = static_cast<GCEventLevel>(max(ctxToUpdate->EventPipeProvider.Level,
ctxToUpdate->EtwProvider->Level));
#else
GCEventKeyword keywords = static_cast<GCEventKeyword>(ctxToUpdate->EventPipeProvider.EnabledKeywordsBitmask);
GCEventLevel level = static_cast<GCEventLevel>(ctxToUpdate->EventPipeProvider.Level);
#endif
GCHeapUtilities::RecordEventStateChange(bIsPublicTraceHandle, keywords, level);
}

Expand Down