MCPcopy Create free account
hub / github.com/google/pprof / CompatibilizeSampleTypes

Function CompatibilizeSampleTypes

profile/merge.go:586–597  ·  view source on GitHub ↗

CompatibilizeSampleTypes makes profiles compatible to be compared/merged. It keeps sample types that appear in all profiles only and drops/reorders the sample types as necessary. In the case of sample types order is not the same for given profiles the order is derived from the first profile. Profi

(ps []*Profile)

Source from the content-addressed store, hash-verified

584//
585// It returns an error if the sample type's intersection is empty.
586func CompatibilizeSampleTypes(ps []*Profile) error {
587 sTypes := commonSampleTypes(ps)
588 if len(sTypes) == 0 {
589 return fmt.Errorf("profiles have empty common sample type list")
590 }
591 for _, p := range ps {
592 if err := compatibilizeSampleTypes(p, sTypes); err != nil {
593 return err
594 }
595 }
596 return nil
597}
598
599// commonSampleTypes returns sample types that appear in all profiles in the
600// order how they ordered in the first profile.

Callers 2

combineProfilesFunction · 0.92

Calls 2

commonSampleTypesFunction · 0.85
compatibilizeSampleTypesFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…