function appendNode(tdNode, buParent)
    {
        var selfTime = tdNode.selfTime;
        var totalTime = tdNode.totalTime;
        buParent.selfTime += selfTime;
        buParent.totalTime += selfTime;
        while (tdNode.parent) {
            if (!buParent.children)
                buParent.children = /** @type {!Map<string,!WebInspector.TimelineModel.ProfileTreeNode>} */ (new Map());
            var id = tdNode.id;
            var buNode = buParent.children.get(id);
            if (!buNode) {
                buNode = new WebInspector.TimelineModel.ProfileTreeNode();
                buNode.selfTime = selfTime;
                buNode.totalTime = totalTime;
                buNode.name = tdNode.name;
                buNode.event = tdNode.event;
                buNode.id = id;
                buParent.children.set(id, buNode);
            } else {
                buNode.selfTime += selfTime;
                if (!nodesOnStack.has(id))
                    buNode.totalTime += totalTime;
            }
            tdNode = tdNode.parent;
            buParent = buNode;
        }
    }
@param {!WebInspector.TimelineModel.ProfileTreeNode} tdNode
@param {!WebInspector.TimelineModel.ProfileTreeNode} buParent