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

Update provider_compute_event_enable_mask so EventSouces with no keywords show up by default #75248

Merged
merged 3 commits into from
Oct 4, 2022
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
4 changes: 3 additions & 1 deletion src/native/eventpipe/ep-provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ provider_compute_event_enable_mask (
if (session_provider) {
int64_t session_keyword = ep_session_provider_get_keywords (session_provider);
EventPipeEventLevel session_level = ep_session_provider_get_logging_level (session_provider);
// EventSources always set 0xF00000000000 to signify no keywords
int64_t session_mask = ~0xF00000000000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than do this filtering at the point of use, how about we filter these keyword bits at the point we are initializing the event in provider_add_event?

// The event is enabled if:
// - The provider is enabled.
// - The event keywords are unspecified in the manifest (== 0) or when masked with the enabled config are != 0.
// - The event level is LogAlways or the provider's verbosity level is set to greater than the event's verbosity level in the manifest.
bool keyword_enabled = (keywords == 0) || ((session_keyword & keywords) != 0);
bool keyword_enabled = ((keywords & session_mask) == 0) || ((session_keyword & keywords) != 0);
bool level_enabled = ((event_level == EP_EVENT_LEVEL_LOGALWAYS) || (session_level >= event_level));
if (provider_enabled && keyword_enabled && level_enabled)
result = result | ep_session_get_mask (session);
Expand Down