コード例 #1
0
ファイル: SamplingFrame.cs プロジェクト: wobbier/brofiler
        void AppendMerge(Callstack callstack, int index, SamplingNode root)
        {
            if (callstack.Count == index)
            {
                return;
            }

            SamplingDescription desc     = callstack[index];
            SamplingNode        rootNode = root == null ? this : root;

            foreach (SamplingNode node in Children)
            {
                if (IsSimilar(node.Description, desc))
                {
                    ++node.Passed;
                    node.AppendMerge(callstack, index + 1, rootNode);
                    return;
                }
            }

            SamplingNode child = new SamplingNode(rootNode, desc, desc.Address, 1);

            AddChild(child);
            child.AppendMerge(callstack, index + 1, rootNode);
        }
コード例 #2
0
        void AppendMerge(Callstack callstack, int index, SamplingNode root)
        {
            if (callstack.Count == index)
            {
                return;
            }

            SamplingDescription desc     = callstack[index];
            SamplingNode        rootNode = root == null ? this : root;

            foreach (SamplingNode node in Children)
            {
                if (IsSimilar(node.Description, desc))
                {
                    node.shadowNodes.Add(new SamplingNode(rootNode, desc, 1)
                    {
                        Parent = this, ChildrenDuration = index == callstack.Count - 1 ? 0 : 1
                    });
                    ++node.Passed;
                    node.AppendMerge(callstack, index + 1, rootNode);
                    return;
                }
            }

            SamplingNode child = new SamplingNode(rootNode, desc, 1);

            child.shadowNodes.Add(new SamplingNode(rootNode, desc, 1)
            {
                Parent = child, ChildrenDuration = index == callstack.Count - 1 ? 0 : 1
            });
            AddChild(child);
            child.AppendMerge(callstack, index + 1, rootNode);
        }
コード例 #3
0
 public override void Load()
 {
     if (!IsLoaded)
     {
         DescriptionBoard = SamplingDescriptionBoard.Create(Response);
         Root             = SamplingNode.Create(Response.Reader, DescriptionBoard, null);
     }
 }
コード例 #4
0
ファイル: SamplingFrame.cs プロジェクト: wobbier/brofiler
        public static SamplingNode Create(List <Callstack> callstacks)
        {
            SamplingNode node = new SamplingNode(null, null, 0, (uint)callstacks.Count);

            callstacks.ForEach(c => node.AppendMerge(c, 0, node));
            node.Update();
            return(node);
        }
コード例 #5
0
ファイル: SamplingFrame.cs プロジェクト: vr3d/brofiler
        public override void Load()
        {
            if (!IsLoaded)
            {
                DescriptionBoard = SamplingDescriptionBoard.Create(Reader);
                root             = SamplingNode.Create(Reader, DescriptionBoard, null);

                board = new Board <SamplingBoardItem, SamplingDescription, SamplingNode>(root);

                IsLoaded = true;
            }
        }
コード例 #6
0
        public override void Load()
        {
            if (!IsLoaded)
            {
                DescriptionBoard = SamplingDescriptionBoard.Create(Reader);
                root             = SamplingNode.Create(Reader, DescriptionBoard, null);
                root.CalculateRecursiveExcludeFlag(new Dictionary <Object, int>());

                board = new Board <SamplingBoardItem, SamplingDescription, SamplingNode>(root);

                IsLoaded = true;
            }
        }
コード例 #7
0
        void Update()
        {
            ForEach((node, level) =>
            {
                SamplingNode sNode = (node as SamplingNode);
                sNode.Duration     = sNode.Passed;

                uint passedChildren = 0;
                sNode.Children.ForEach(child => passedChildren += (child as SamplingNode).Passed);
                sNode.ChildrenDuration = passedChildren;

                return(true);
            });
        }
コード例 #8
0
        public static SamplingNode Create(BinaryReader reader, SamplingDescriptionBoard board, SamplingNode root)
        {
            UInt64 address = reader.ReadUInt64();

            SamplingDescription desc = null;

            if (!board.Descriptions.TryGetValue(address, out desc))
            {
                desc = SamplingDescription.UnresolvedDescription;
            }

            UInt32 passed = reader.ReadUInt32();

            SamplingNode node = new SamplingNode(root, desc, passed);

            UInt32 childrenCount = reader.ReadUInt32();

            for (UInt32 i = 0; i < childrenCount; ++i)
            {
                node.AddChild(SamplingNode.Create(reader, board, root != null ? root : node));
            }

            return(node);
        }
コード例 #9
0
 public SamplingFrame(List <Callstack> callstacks, FrameGroup group) : base(null, group)
 {
     SampleCount = callstacks.Count;
     Root        = SamplingNode.Create(callstacks);
 }
コード例 #10
0
        //public SamplingNode Parent { get; private set; }

        SamplingNode(SamplingNode root, SamplingDescription desc, UInt32 passed)
            : base(root, desc, passed)
        {
            Passed = passed;
        }