Skip to content

added and cleaned up logs around build and live diagnostics.#24551

Merged
heejaechang merged 1 commit intodotnet:dev15.7.xfrom
heejaechang:internalVisibleTo
Feb 1, 2018
Merged

added and cleaned up logs around build and live diagnostics.#24551
heejaechang merged 1 commit intodotnet:dev15.7.xfrom
heejaechang:internalVisibleTo

Conversation

@heejaechang
Copy link
Contributor

@heejaechang heejaechang commented Jan 31, 2018

also added RoslynActivityLogger that can be enabled through project-system-tool

Customer scenario

There is no user experience change in this PR.

This PR is to let our project-system-tool (https://github.com/heejaechang/project-system-tools) to inject Roslyn logger so that we can use that tool to see roslyn activity around build/live errors and behavior of error list.

Bugs this fixes

this doesn't fix any issue. but hopefully, help us to figure out what is causing this issue (https://devdiv.visualstudio.com/DevDiv/_workitems/edit/364961)

Workarounds, if any

No workaround

Risk

All these changes are no-op if Roslyn logger is not enabled explicitly through the tool.

Performance impact

All these changes are no-op if Roslyn logger is not enabled explicitly through the tool.

Is this a regression from a previous update?

No

Root cause analysis

we are getting bunch of bugs around error list (error not showing, error not going away, build and live errors not consistent and etc). but since error list is just presentation that reflects current state, either dump or etl are not enough to find out how error list got to this state. this change let us to monitor activities around error list so that we can get better idea on how things moved to this state.

How was the bug found?

Feedbacks.

also added RoslynActivityLogger that can be enabled through project-system-tool
@heejaechang
Copy link
Contributor Author

@jinujoseph @Pilchie @dotnet/roslyn-ide @dotnet/roslyn-analysis can you take a look? targetting 15.7.x

public bool IsEnabled(FunctionId functionId)
{
// we log every roslyn activity
return true;
Copy link
Member

Choose a reason for hiding this comment

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

Is this a perf problem in practice?

Copy link
Contributor Author

@heejaechang heejaechang Jan 31, 2018

Choose a reason for hiding this comment

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

this logger only injected to Roslyn when someone uses project-system-tool to inject it. otherwise, it is no-op. but when it is injected, it does affect perf since it runs in this log everything mode which involves creating bunch of strings. but as how existing project-system-tool works, users are not supposed to enable it all the time, but only enable it while they are collecting data. otherwise, disable which will remove the logger if injected to Roslyn.

so in another word, no it won't affect perf in normal operation.

Copy link
Member

Choose a reason for hiding this comment

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

Because it's just a tool window that people can choose not to show, and it's handy to have installed for when you do run into problems, I expect many people will just have the extension installed. I think we need to be explicit somewhere that logs are being recorded and it will affect performance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

installing tool windows doesn't do anything. it is same as existing tool's behavior. user need to click "start" button for logger to actually start recording.

logger will be injected and removed when start button is clicked and when stop button is clicked respectively.

/// this also involves creating string, boxing and etc. so, perf wise, it will impact VS quite a bit.
/// this also won't collect trace from Roslyn OOP for now. only in proc activity
/// </summary>
internal static class RoslynActivityLogger
Copy link
Member

Choose a reason for hiding this comment

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

Is the plan to find this and call SetLogger via reflection from the extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep. I already have corresponding change in project system tool - dotnet/project-system-tools#44

@Pilchie
Copy link
Member

Pilchie commented Jan 31, 2018

Approved pending another code review.

@Pilchie Pilchie added this to the 15.7 milestone Jan 31, 2018
@heejaechang
Copy link
Contributor Author

ping?

@heejaechang heejaechang merged commit 5588347 into dotnet:dev15.7.x Feb 1, 2018
heejaechang pushed a commit that referenced this pull request Feb 2, 2018
* Remove duplicate lock DocumentState.s_syntaxTreeToIdMapLock

This lock is only being used to protect access to an instance which contains
internal synchronization.

* Better handle surrounding directives when inlining a local variable.

* Add tests.

* Share code between VB and C#.

* Reduce allocations in UnboundLambda

Fixes #23463

* Restore ReturnInferenceCacheKey as the key for _returnInferenceCache

* Update code to more closely follow patterns of the original code

* Cleanup from code review

* basic fix for intellisense in Immediate window

* better comments and cleanup

* Add basic integration tests

* cleanup inproc Immediate window integration test helper

* fix incorrect comment

* address PR feedback

* create Immediate window on ImmediateWindow_InProc.GetText()

* Verify MSBuild version in Developer CMD prompt

Roslyn is designed to have the simplest possible contribution story:
clone then build. Every pre-req needed is either located on the machine
or bootstrapped via NuGet. All the way down to using an xcopy MSBuild if
needed.

The one case which causes a problem is the VS command prompt. In this
case MSBuild is pre-installed on the machine and may or may not be
suitable for building Roslyn.

Previously when building from a VS command prompt we just used whatever
MSBuild was provided. The assumption being a developer command prompt
was an explicit statement of whath MSBuild you wanted to use. Based on
all of our customer reports though this does not seem to be the
assumption that consumers of our repo have. The build gave them no
explicit errors about the provided toolset and hence when the build
failed they assigned flakiness to our repo.

Going forward we are applying the same version validation to MSBuild
when provided via a developer command prompt. If it doesn't match we
will refuse to build asking the user to upgrade VS or build from a
normal command prompt.

* Remove unneeded debugging line

* Comment about pre-release

* Added minimum version

* Add Omit If Default style option

* Add space to be like test without the omit

* Add/Remove without needing a property

* Reformat

* PR feedback

* Fix VB diagnostic based on feedback

* Handle case of NotApplicable modifier and field declaration list

* Fix tests

* PR feedback

* PR feedback

* PreviewCodeAction was overriding ComputeOperations but returning a post-processed operation from original action. This results in another PostProcess being called on the codeaction. If postprocess was overriden in originalaction that'll be ignored the second time (#23920)

* Support negative null-check when we are suggesting to inline type checks

Fixes #21097
Fixes #24286

* fix a case where persistent storage registration fails and some clean… (#24458)

* fix a case where persistent storage registration fails and some clean up code around it.

* added readonly

* address PR feedback

* removed comments no longer relevant

* renamed lock name

* moved waiter from diagnostics.dll to features.dll where all interfaces are defined. (#24512)

* put listener change back in (#24120)

* leave old types in legacy folder until partner teams move to new interface

* added legacy waiter to support partner teams

* Remove methods indirecting access to _metadataFileNameToConvertedProjectReference

This field is documented as being written and read from any thread,
but in practice all uses are guarded by an AssertIsForeground(). Thus
we can get rid of the helper methods that are trying to "help" by
locking before accessing the fields, making it really hard to track all
the real uses of it.

* Make method static that doesn't need state

* add a comment to address PR feedback

* Fix up tests of P2P to metadata reference conversion

It turns out we had some tests, but the tests were disabled. This was
because the tests weren't working properly anyways: they were calling
into UpdateProjectBinPath which only updated some (but not all) of
the project state. That was an internal helper method that shouldn't
be used by tests. Updating the tests to use
SetBinOutputPathAndRelatedData works better.

* Delete debug-only reference validation

This was some legacy code that tried to verify that the references
we have from the project system match up to what DTE and other sources
say. This was debug-only, and the actual asserts were commented out.
This is deadweight at this point, so delete it.

* added and cleaned up logs around build and live diagnostics. (#24551)

also added RoslynActivityLogger that can be enabled through project-system-tool

* Avoid closure allocations on the BindSyntaxTreeToId fast path

* CS1628 error text mentions in parameters; fixes #24584

* Small cleanup of completion logic.

* Move to xunit.console for CoreClr tests

Previously we were using xunit.console for desktop tests and dotnet-xunit for our
CoreClr tests. This change unifies us on top of xunit.console (now that it has a
netcoreapp2.0 version available).

* Move unix builds to xunit.runner.console as well

* Get actual directory name, not file

* Fix dir name issue

* fixed build break
heejaechang pushed a commit that referenced this pull request Feb 7, 2018
* Remove duplicate lock DocumentState.s_syntaxTreeToIdMapLock

This lock is only being used to protect access to an instance which contains
internal synchronization.

* Better handle surrounding directives when inlining a local variable.

* Add tests.

* Share code between VB and C#.

* Reduce allocations in UnboundLambda

Fixes #23463

* Restore ReturnInferenceCacheKey as the key for _returnInferenceCache

* Update code to more closely follow patterns of the original code

* Cleanup from code review

* Verify MSBuild version in Developer CMD prompt

Roslyn is designed to have the simplest possible contribution story:
clone then build. Every pre-req needed is either located on the machine
or bootstrapped via NuGet. All the way down to using an xcopy MSBuild if
needed.

The one case which causes a problem is the VS command prompt. In this
case MSBuild is pre-installed on the machine and may or may not be
suitable for building Roslyn.

Previously when building from a VS command prompt we just used whatever
MSBuild was provided. The assumption being a developer command prompt
was an explicit statement of whath MSBuild you wanted to use. Based on
all of our customer reports though this does not seem to be the
assumption that consumers of our repo have. The build gave them no
explicit errors about the provided toolset and hence when the build
failed they assigned flakiness to our repo.

Going forward we are applying the same version validation to MSBuild
when provided via a developer command prompt. If it doesn't match we
will refuse to build asking the user to upgrade VS or build from a
normal command prompt.

* Remove unneeded debugging line

* Comment about pre-release

* Added minimum version

* Add Omit If Default style option

* Add space to be like test without the omit

* Add/Remove without needing a property

* Reformat

* PR feedback

* Fix VB diagnostic based on feedback

* Handle case of NotApplicable modifier and field declaration list

* Fix tests

* PR feedback

* PR feedback

* Support negative null-check when we are suggesting to inline type checks

Fixes #21097
Fixes #24286

* fix a case where persistent storage registration fails and some clean… (#24458)

* fix a case where persistent storage registration fails and some clean up code around it.

* added readonly

* address PR feedback

* removed comments no longer relevant

* renamed lock name

* moved waiter from diagnostics.dll to features.dll where all interfaces are defined. (#24512)

* put listener change back in (#24120)

* leave old types in legacy folder until partner teams move to new interface

* added legacy waiter to support partner teams

* Remove methods indirecting access to _metadataFileNameToConvertedProjectReference

This field is documented as being written and read from any thread,
but in practice all uses are guarded by an AssertIsForeground(). Thus
we can get rid of the helper methods that are trying to "help" by
locking before accessing the fields, making it really hard to track all
the real uses of it.

* Make method static that doesn't need state

* Fix up tests of P2P to metadata reference conversion

It turns out we had some tests, but the tests were disabled. This was
because the tests weren't working properly anyways: they were calling
into UpdateProjectBinPath which only updated some (but not all) of
the project state. That was an internal helper method that shouldn't
be used by tests. Updating the tests to use
SetBinOutputPathAndRelatedData works better.

* Delete debug-only reference validation

This was some legacy code that tried to verify that the references
we have from the project system match up to what DTE and other sources
say. This was debug-only, and the actual asserts were commented out.
This is deadweight at this point, so delete it.

* added and cleaned up logs around build and live diagnostics. (#24551)

also added RoslynActivityLogger that can be enabled through project-system-tool

* Avoid closure allocations on the BindSyntaxTreeToId fast path

* CS1628 error text mentions in parameters; fixes #24584

* Update optimization data to 2.7.0-beta3-62526-01...

* Small cleanup of completion logic.

* Locate implementations for reference assemblies using the process binding path

* Use GlobalAssemblyCache helper to locate assemblies directly in the GAC

* Update InteractiveEditorFeatures to account for a second definition of GlobalAssemblyCache

* Move to xunit.console for CoreClr tests

Previously we were using xunit.console for desktop tests and dotnet-xunit for our
CoreClr tests. This change unifies us on top of xunit.console (now that it has a
netcoreapp2.0 version available).

* Move unix builds to xunit.runner.console as well

* Fixes 559223

Fix and re-enable test that would catch this error

* Update LanguageServices training data again...

* Get actual directory name, not file

* Fix dir name issue

* Cleanup based on code review feedback

* Check fully-qualified names for SuppressIldasmAttribute and ReferenceAssemblyAttribute
* Use correct reference location, or fail decompilation if it's not available

* Fix typo...

* Don't use inferred member name if that creates duplicates (#24632)

* Fixes #23983

* Added test for unique IDEDiagnosticIDs

* Fixed capitalization on local variable

* Fix `is` and pattern-matching behavior in presence of implicit UD conversion (#24547)

* Fix `is` and pattern-matching behavior in presence of implicit UD conversion
and also an explicit reference conversion. User-defined conversions should
never be considered for `is` and pattern-matching.
Fixes #24522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants