code/Debug/Block/View.php
public function getBlocksAsTree()
    {
        $blocks = $this->getRequestInfo()->getBlocks();
        $tree = new Varien_Data_Tree();
        $rootNodes = array();

        foreach ($blocks as $block) {
            $parentNode = $tree->getNodeById($block->getParentName());

            $node = new Varien_Data_Tree_Node(array(
                'name'     => $block->getName(),
                'class'    => $block->getClass(),
                'template' => $block->getTemplateFile(),
                'duration' => $block->getRenderedDuration(),
                'count' => $block->getRenderedCount()
            ), 'name', $tree, $parentNode);

            $tree->addNode($node, $parentNode);

            if (!$parentNode) {
                $rootNodes[] = $node;
            }
        }

        return $rootNodes;
    }
public function getBlocksAsTree()
    {
        $blocks = $this->getRequestInfo()->getBlocks();
        $tree = new Varien_Data_Tree();
        $rootNodes = array();

        foreach ($blocks as $block) {
            $parentNode = $tree->getNodeById($block->getParentName());

            $node = new Varien_Data_Tree_Node(array(
                'name'     => $block->getName(),
                'class'    => $block->getClass(),
                'template' => $block->getTemplateFile(),
                'duration' => $block->getRenderedDuration(),
                'count' => $block->getRenderedCount()
            ), 'name', $tree, $parentNode);

            $tree->addNode($node, $parentNode);

            if (!$parentNode) {
                $rootNodes[] = $node;
            }
        }

        return $rootNodes;
    }
Builds a tree based on block recorded information

@return Varien_Data_Tree_Node[]