code: func javaCPUProfile(b []byte, period int64, parse func(b []byte) (uint64, []byte)) (*Profile, error) {
  	p := &Profile{
  		Period:     period * 1000,
  		PeriodType: &ValueType{Type: "cpu", Unit: "nanoseconds"},
  		SampleType: []*ValueType{{Type: "samples", Unit: "count"}, {Type: "cpu", Unit: "nanoseconds"}},
  	}
  	var err error
  	var locs map[uint64]*Location
  	if b, locs, err = parseCPUSamples(b, parse, false, p); err != nil {
  		return nil, err
  	}
  
  	if err = parseJavaLocations(b, locs, p); err != nil {
  		return nil, err
  	}
  
  	// Strip out addresses for better merge.
  	if err = p.Aggregate(true, true, true, true, false); err != nil {
  		return nil, err
  	}
  
  	return p, nil
  }
docs: // javaCPUProfile returns a new Profile from profilez data.
  // b is the profile bytes after the header, period is the profiling
  // period, and parse is a function to parse 8-byte chunks from the
  // profile in its native endianness.