code: func printCallgrind(w io.Writer, rpt *Report) error {
  	g, err := newGraph(rpt)
  	if err != nil {
  		return err
  	}
  
  	o := rpt.options
  	rpt.options.NodeFraction = 0
  	rpt.options.EdgeFraction = 0
  	rpt.options.NodeCount = 0
  
  	g.preprocess(rpt)
  
  	fmt.Fprintln(w, "events:", o.SampleType+"("+o.OutputUnit+")")
  
  	files := make(map[string]int)
  	names := make(map[string]int)
  	for _, n := range g.ns {
  		fmt.Fprintln(w, "fl="+callgrindName(files, n.info.file))
  		fmt.Fprintln(w, "fn="+callgrindName(names, n.info.name))
  		sv, _ := ScaleValue(n.flat, o.SampleUnit, o.OutputUnit)
  		fmt.Fprintf(w, "%d %d\n", n.info.lineno, int(sv))
  
  		// Print outgoing edges.
  		for _, out := range sortedEdges(n.out) {
  			c, _ := ScaleValue(out.weight, o.SampleUnit, o.OutputUnit)
  			count := fmt.Sprintf("%d", int(c))
  			callee := out.dest
  			fmt.Fprintln(w, "cfl="+callgrindName(files, callee.info.file))
  			fmt.Fprintln(w, "cfn="+callgrindName(names, callee.info.name))
  			fmt.Fprintln(w, "calls="+count, callee.info.lineno)
  			fmt.Fprintln(w, n.info.lineno, count)
  		}
  		fmt.Fprintln(w)
  	}
  
  	return nil
  }
docs: // printCallgrind prints a graph for a profile on callgrind format.