internal void AddFunctionVertex(int funcId, string functionName, string signature, Graph graph, ref Vertex[] funcVertex) { EnsureVertexCapacity(funcId, ref funcVertex); int moduleId = funcModule[funcId]; string moduleName = null; if (moduleId >= 0) moduleName = modBasicName[moduleId]; funcVertex[funcId] = graph.FindOrCreateVertex(functionName, signature, moduleName); }
void BuildClassTrace(Graph graph, int stackTraceIndex, int funcIndex, ulong size, Vertex[] funcVertex, ref Vertex[] vertexStack) { string className = ClassNameOfFunc(funcIndex); int functionsToSkip = FunctionsInSameClass(className, stackTraceIndex); int stackPtr = BuildVertexStack(stackTraceIndex, funcVertex, ref vertexStack, 0) - functionsToSkip; Vertex toVertex = graph.TopVertex; Vertex fromVertex; Edge edge; if (ReadNewLog.InterestingCallStack(vertexStack, stackPtr)) { vertexStack[stackPtr] = graph.FindOrCreateVertex(className, null, null); stackPtr++; stackPtr = ReadNewLog.FilterVertices(vertexStack, stackPtr); stackPtr = Vertex.SqueezeOutRepetitions(vertexStack, stackPtr); for (int i = 0; i < stackPtr; i++) { fromVertex = toVertex; toVertex = vertexStack[i]; edge = graph.FindOrCreateEdge(fromVertex, toVertex); edge.AddWeight(size); } if (toVertex != graph.TopVertex) { fromVertex = toVertex; toVertex = graph.BottomVertex; edge = graph.FindOrCreateEdge(fromVertex, toVertex); edge.AddWeight(size); } } }
internal void AddTypeVertex(int typeId, string typeName, Graph graph, ref Vertex[] typeVertex) { EnsureVertexCapacity(typeId, ref typeVertex); typeVertex[typeId] = graph.FindOrCreateVertex(typeName, null, null); }
internal void BuildHandleAllocationTrace(Graph graph, int stackTraceIndex, uint count, Vertex[] funcVertex, ref Vertex[] vertexStack) { int stackPtr = BuildVertexStack(stackTraceIndex, funcVertex, ref vertexStack, 0); Vertex handleVertex = graph.FindOrCreateVertex("Handle", null, null); handleVertex.interestLevel = InterestLevel.Interesting; Vertex toVertex = graph.TopVertex; Vertex fromVertex; Edge edge; if (ReadNewLog.InterestingCallStack(vertexStack, stackPtr)) { vertexStack[stackPtr] = handleVertex; stackPtr++; stackPtr = ReadNewLog.FilterVertices(vertexStack, stackPtr); stackPtr = Vertex.SqueezeOutRepetitions(vertexStack, stackPtr); for (int i = 0; i < stackPtr; i++) { fromVertex = toVertex; toVertex = vertexStack[i]; edge = graph.FindOrCreateEdge(fromVertex, toVertex); edge.AddWeight(count); } fromVertex = toVertex; toVertex = graph.BottomVertex; edge = graph.FindOrCreateEdge(fromVertex, toVertex); edge.AddWeight(count); } }