Transform collected trace data into a tree.