[ftrace] Construct function trees.