code: func sampleFormat(p *profile.Profile, sampleIndex string, mean bool) (value, meanDiv sampleValueFunc, v *profile.ValueType, err error) {
  	if len(p.SampleType) == 0 {
  		return nil, nil, nil, fmt.Errorf("profile has no samples")
  	}
  	index, err := p.SampleIndexByName(sampleIndex)
  	if err != nil {
  		return nil, nil, nil, err
  	}
  	value = valueExtractor(index)
  	if mean {
  		meanDiv = valueExtractor(0)
  	}
  	v = p.SampleType[index]
  	return
  }
docs: // sampleFormat returns a function to extract values out of a profile.Sample,
  // and the type/units of those values.