code: func (p *Profile) String() string {
  	ss := make([]string, 0, len(p.Comments)+len(p.Sample)+len(p.Mapping)+len(p.Location))
  	for _, c := range p.Comments {
  		ss = append(ss, "Comment: "+c)
  	}
  	if pt := p.PeriodType; pt != nil {
  		ss = append(ss, fmt.Sprintf("PeriodType: %s %s", pt.Type, pt.Unit))
  	}
  	ss = append(ss, fmt.Sprintf("Period: %d", p.Period))
  	if p.TimeNanos != 0 {
  		ss = append(ss, fmt.Sprintf("Time: %v", time.Unix(0, p.TimeNanos)))
  	}
  	if p.DurationNanos != 0 {
  		ss = append(ss, fmt.Sprintf("Duration: %.4v", time.Duration(p.DurationNanos)))
  	}
  
  	ss = append(ss, "Samples:")
  	var sh1 string
  	for _, s := range p.SampleType {
  		dflt := ""
  		if s.Type == p.DefaultSampleType {
  			dflt = "[dflt]"
  		}
  		sh1 = sh1 + fmt.Sprintf("%s/%s%s ", s.Type, s.Unit, dflt)
  	}
  	ss = append(ss, strings.TrimSpace(sh1))
  	for _, s := range p.Sample {
  		ss = append(ss, s.string())
  	}
  
  	ss = append(ss, "Locations")
  	for _, l := range p.Location {
  		ss = append(ss, l.string())
  	}
  
  	ss = append(ss, "Mappings")
  	for _, m := range p.Mapping {
  		ss = append(ss, m.string())
  	}
  
  	return strings.Join(ss, "\n") + "\n"
  }
docs: // String dumps a text representation of a profile. Intended mainly
  // for debugging purposes.