code: func computeTotal(prof *profile.Profile, value, meanDiv func(v []int64) int64) int64 {
  	var div, total, diffDiv, diffTotal int64
  	for _, sample := range prof.Sample {
  		var d, v int64
  		v = value(sample.Value)
  		if meanDiv != nil {
  			d = meanDiv(sample.Value)
  		}
  		if v < 0 {
  			v = -v
  		}
  		total += v
  		div += d
  		if sample.DiffBaseSample() {
  			diffTotal += v
  			diffDiv += d
  		}
  	}
  	if diffTotal > 0 {
  		total = diffTotal
  		div = diffDiv
  	}
  	if div != 0 {
  		return total / div
  	}
  	return total
  }
docs: // computeTotal computes the sum of the absolute value of all sample values.
  // If any samples have label indicating they belong to the diff base, then the
  // total will only include samples with that label.