code: func combineHeaders(srcs []*Profile) (*Profile, error) {
  	for _, s := range srcs[1:] {
  		if err := srcs[0].compatible(s); err != nil {
  			return nil, err
  		}
  	}
  
  	var timeNanos, durationNanos, period int64
  	var comments []string
  	seenComments := map[string]bool{}
  	var defaultSampleType string
  	for _, s := range srcs {
  		if timeNanos == 0 || s.TimeNanos < timeNanos {
  			timeNanos = s.TimeNanos
  		}
  		durationNanos += s.DurationNanos
  		if period == 0 || period < s.Period {
  			period = s.Period
  		}
  		for _, c := range s.Comments {
  			if seen := seenComments[c]; !seen {
  				comments = append(comments, c)
  				seenComments[c] = true
  			}
  		}
  		if defaultSampleType == "" {
  			defaultSampleType = s.DefaultSampleType
  		}
  	}
  
  	p := &Profile{
  		SampleType: make([]*ValueType, len(srcs[0].SampleType)),
  
  		DropFrames: srcs[0].DropFrames,
  		KeepFrames: srcs[0].KeepFrames,
  
  		TimeNanos:     timeNanos,
  		DurationNanos: durationNanos,
  		PeriodType:    srcs[0].PeriodType,
  		Period:        period,
  
  		Comments:          comments,
  		DefaultSampleType: defaultSampleType,
  	}
  	copy(p.SampleType, srcs[0].SampleType)
  	return p, nil
  }
docs: // combineHeaders checks that all profiles can be merged and returns
  // their combined profile.