runtime icon indicating copy to clipboard operation
runtime copied to clipboard

ILLink: Add EdgeVisitor and ITracingNode to enable logging dependency graph edges to illink dependency loggers

Open jtschuster opened this issue 1 year ago • 1 comments

Adds a new dependency node that stores the DependencyInfo.Source and DependencyInfo.Kind information from a call to MarkMethod or MarkType, and returns the method/type as a static dependency. This will create an edge that the EdgeVisitor will log a dependency for with Annotations.AddDirectDependency. Because the nodes and EdgeVisitor will log the dependencies, the calls to Annotations.Mark() shouldn't pass a reason.

ITracingNode is implemented by nodes that represent a metadatum that was logged in the old tracing system. DependencyObject returns this item, which corresponds to the DependencyInfo.Source if the node is a "depender", and the marked object if it's a "dependee".

Also adds dictionaries to go back and forth from a DependencyKind to string since Enum.ToString()/Enum.GetName() allocates a new string each time.

In order to log all the dependencies properly, the FullGraphLogStrategy must be used, however. This adds about 0.4 seconds to a hello world (from 6.6 to 7 seconds), and about 4 seconds to the asp.net benchmarks trim time (from 29.5 to 33.5 seconds).

jtschuster avatar May 06 '24 22:05 jtschuster

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas See info in area-owners.md if you want to be subscribed.

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.