Skip to content

Conversation

sharwell
Copy link
Contributor

@sharwell sharwell commented Aug 21, 2019

Closes #37477

The steps for manually recording traces have already been updated to enable the provider.

image

@sharwell sharwell requested a review from a team as a code owner August 21, 2019 23:44
@sharwell sharwell added the Tenet-Telemetry Our ability to collect telemetry is broken. label Aug 21, 2019
return RecoverRoot(stream, cancellationToken);
if (RoslynEventSource.Instance.IsEnabled(EventLevel.Informational, EventKeywords.None))
{
RoslynEventSource.Instance.BlockStart(_containingTree.FilePath, FunctionId.Workspace_Recoverable_RecoverRootAsync, blockId: 0);
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to keep using RoslynEventSource.Instance vs. capturing it in a local?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not especially. I just used the pattern seen in similar features for other libraries we ship.

}
finally
{
if (RoslynEventSource.Instance.IsEnabled(EventLevel.Informational, EventKeywords.None))
Copy link
Member

Choose a reason for hiding this comment

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

Seems odd at a glance to check this here. Naiively I'd say that if the check for IsEnabled(EventLevel.Informational, EventKeywords.None)) was true inside the try block then we should execute the body of this block period. Not re-check the value again. Checking the value in both places just seems to open the possibility that we'd have unmatched data points in the trace (start but no end, end but no start, etc ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mismatched events is always a possibility (sometimes events get dropped by the OS before we even have a chance to log them). The pattern used here was modeled after the pattern used in vs-threading, e.g. https://github.com/microsoft/vs-threading/blob/e213c20ec8d58d5a32e23739103ccfc22bccbc89/src/Microsoft.VisualStudio.Threading/JoinableTask.cs#L841-L891. I'm not sure what impact deviating from this would have, but I can give one example of where the current behavior might be desired: if the user stops a performance trace while one or more trees is in the process of being deserialized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also on the other side, if a user starts a performance trace while the tree is being deserialized, we will see the time it took to deserialize that tree even though it started before the performance trace started capturing data.

@sharwell sharwell changed the base branch from release/dev16.3 to master September 10, 2019 06:04
Copy link
Member

@genlu genlu left a comment

Choose a reason for hiding this comment

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

:shipit:

@sharwell sharwell merged commit b0d1f7c into dotnet:master Sep 19, 2019
@sharwell sharwell deleted the roslyn-etw branch September 19, 2019 15:11
@sharwell sharwell added this to the 16.4.P2 milestone Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tenet-Telemetry Our ability to collect telemetry is broken.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report an ETW event when reconstituting a syntax tree
3 participants