code: func printText(w io.Writer, rpt *Report) error {
  	g, err := newGraph(rpt)
  	if err != nil {
  		return err
  	}
  
  	origCount, droppedNodes, _ := g.preprocess(rpt)
  	fmt.Fprintln(w, strings.Join(legendDetailLabels(rpt, g, origCount, droppedNodes, 0), "\n"))
  
  	// fmt.Fprintf(w, "%10s %5s%% %5s%% %10s %5s%%\n",
  	// 	"flat", "flat", "sum", "cum", "cum")
  
  	var flatSum int64
  	for _, n := range g.ns {
  		name, flat, cum := n.info.prettyName(), n.flat, n.cum
  
  		flatSum += flat
  		fmt.Fprintf(w, "%10s %s %s %10s %s  %s\n",
  			rpt.formatValue(flat),
  			percentage(flat, rpt.total),
  			percentage(flatSum, rpt.total),
  			rpt.formatValue(cum),
  			percentage(cum, rpt.total),
  			name)
  	}
  	return nil
  }
docs: // printText prints a flat text report for a profile.