internal void AssignInterestLevelsToTypes(BuildTypeGraphOptions options, FilterForm filterForm) { foreach (GcType gcType in typeIdToGcType.Values) { // Otherwise figure which the interesting types are. gcType.interestLevel = filterForm.InterestLevelOfTypeName(gcType.name, null, readNewLog.finalizableTypes.ContainsKey(gcType.typeID)); } }
internal void AssignInterestLevelToObject(ulong id, GcObject gcObject, BuildTypeGraphOptions options, FilterForm filterForm) { // The initial interest level in objects is the one of their type InterestLevel interestLevel = gcObject.Type(this).interestLevel; if (filterForm.signatureFilters.Length != 0) { string signature = SignatureOfObject(id, gcObject, BuildTypeGraphOptions.LumpBySignature); interestLevel &= filterForm.InterestLevelOfTypeName(gcObject.Type(this).name, signature, readNewLog.finalizableTypes.ContainsKey(gcObject.Type(this).typeID)); } if (filterForm.addressFilters.Length != 0) { interestLevel &= filterForm.InterestLevelOfAddress(id); } gcObject.InterestLevel |= interestLevel; // 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. }
private void AssignInterestLevels() { foreach (GcType gcType in typeNameToGcType.Values) { // Otherwise figure which the interesting types are. gcType.interestLevel = FilterForm.InterestLevelOfTypeName(gcType.name, readNewLog.finalizableTypes[gcType.typeID] != null); } foreach (GcObject gcObject in idToObject.Values) { // The initial interest level in objects is the one of their type gcObject.interestLevel = gcObject.type.interestLevel; } foreach (GcObject gcObject in idToObject.Values) { // 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 object, 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; } } } // Check if this object should be displayed because one of its ancestors // is interesting, and it says its descendents are interesting as well if ((gcObject.interestLevel & (InterestLevel.Interesting | InterestLevel.Display)) == InterestLevel.Ignore) { CheckForParentMarkingDescendant(gcObject); } } }
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.InterestLevelOfTypeName(typeName, null, finalizableTypes.ContainsKey(typeId)); }