コード例 #1
0
ファイル: ObjectGraph.cs プロジェクト: dbremner/clrprofiler
 internal void AssignInterestLevelsToTypes(BuildTypeGraphOptions options, FilterForm filterForm)
 {
     foreach (GcType gcType in typeIdToGcType.Values)
     {
         gcType.interestLevel = filterForm.IsInterestingTypeName(gcType.name, null, readNewLog.finalizableTypes.ContainsKey(gcType.typeID)) ?
                                InterestLevel.Interesting : InterestLevel.Ignore;
     }
 }
コード例 #2
0
ファイル: ObjectGraph.cs プロジェクト: dbremner/clrprofiler
        internal void AssignInterestLevelToObject(ulong id, GcObject gcObject, BuildTypeGraphOptions options, FilterForm filterForm, bool isRoot)
        {
            bool isInteresting = gcObject.Type(this).interestLevel == InterestLevel.Interesting &&
                                 filterForm.IsInterestingAddress(id);

            if (isInteresting && filterForm.signatureFilters.Length != 0)
            {
                string signature = SignatureOfObject(id, gcObject, BuildTypeGraphOptions.LumpBySignature);
                isInteresting = filterForm.IsInterestingTypeName(gcObject.Type(this).name, signature,
                                                                 readNewLog.finalizableTypes.ContainsKey(gcObject.Type(this).typeID));
            }

            if (isInteresting)
            {
                gcObject.InterestLevel = InterestLevel.Interesting;
                if (!isRoot)
                {
                    gcObject.InterestLevel |= filterForm.InterestLevelForParentsAndChildren();
                }
            }
            else
            {
                gcObject.InterestLevel = InterestLevel.Ignore;
            }

            // Check if this is an interesting object, and we are supposed to mark its ancestors
            if ((gcObject.InterestLevel & InterestLevel.InterestingParents) == InterestLevel.InterestingParents)
            {
                for (GcObject parentObject = gcObject.parent; parentObject != null; parentObject = parentObject.parent)
                {
                    // As long as we find uninteresting objects, mark them for display
                    // When we find an interesting object, we stop, because either it
                    // will itself mark its parents, or it isn't interested in them (and we
                    // respect that despite the interest of the current object, somewhat arbitrarily).
                    if ((parentObject.InterestLevel & InterestLevel.InterestingParents) == InterestLevel.Ignore)
                    {
                        parentObject.InterestLevel |= InterestLevel.Display;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            // It's tempting here to mark the descendants as well, but they may be reached via
            // long reference paths, when there are shorter ones that were deemed uninteresting
            // Instead, we look whether our parent objects are interesting and want to show their
            // descendants, but we have to do that in a separate pass.
        }
コード例 #3
0
 internal void AddTypeVertex(int typeId, string typeName, Graph graph, ref Vertex[] typeVertex, FilterForm filterForm)
 {
     EnsureVertexCapacity(typeId, ref typeVertex);
     typeVertex[typeId] = graph.FindOrCreateVertex(typeName, null, null);
     typeVertex[typeId].interestLevel = filterForm.IsInterestingTypeName(typeName, null, finalizableTypes.ContainsKey(typeId))
         ? InterestLevel.Interesting | filterForm.InterestLevelForParentsAndChildren() : InterestLevel.Ignore;
 }