예제 #1
0
        public IEnumerator <object> Build(
            HeapSnapshot snapshot,
            Dictionary <uint, HeapSnapshot.Traceback> tracebacks,
            Dictionary <uint, TracebackFrame> symbols
            )
        {
            var allocations = from heap in snapshot.Heaps
                              from allocation in heap.Allocations
                              select allocation;

            yield return(Future.RunInThread(() => {
                Parallel.ForEach(
                    allocations, (alloc) => {
                    StackGraphNode parent = null, node;
                    var traceback = tracebacks[alloc.TracebackID];

                    foreach (var frameId in traceback.Reverse())
                    {
                        var frame = symbols[frameId];

                        if (parent != null)
                        {
                            node = parent.GetNodeForChildFrame(frame);
                        }
                        else
                        {
                            node = GetNodeForFrame(frame);
                        }

                        if (node != null)
                        {
                            node.Visit(alloc);
                        }

                        if (node != null)
                        {
                            parent = node;
                        }

                        node = Functions.GetNodeForFrame(frame);
                        node.Visit(alloc);
                    }
                }
                    );
            }));

            yield return(FinalizeBuild());
        }
예제 #2
0
        public IEnumerator <object> Build(HeapRecording instance, IEnumerable <DeltaInfo> deltas)
        {
            yield return(Future.RunInThread(() => {
                Parallel.ForEach(
                    deltas, (delta) => {
                    StackGraphNode parent = null, node;

                    foreach (var frame in delta.Traceback.Reverse())
                    {
                        if (parent != null)
                        {
                            node = parent.GetNodeForChildFrame(frame);
                        }
                        else
                        {
                            node = GetNodeForFrame(frame);
                        }

                        if (node != null)
                        {
                            node.Visit(delta);
                        }

                        if (node != null)
                        {
                            parent = node;
                        }

                        node = Functions.GetNodeForFrame(frame);
                        node.Visit(delta);
                    }
                }
                    );
            }));

            yield return(FinalizeBuild());
        }
예제 #3
0
 public StackGraphTooltipContent(StackGraphNode node, StringFormat sf)
 {
     Node         = node;
     StringFormat = sf;
 }