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

Method addBaseProfiles

internal/driver/cli.go:174–185  ·  view source on GitHub ↗

addBaseProfiles adds the list of base profiles or diff base profiles to the source. This function will return an error if both base and diff base profiles are specified.

(flagBase, flagDiffBase []*string)

Source from the content-addressed store, hash-verified

172// the source. This function will return an error if both base and diff base
173// profiles are specified.
174func (source *source) addBaseProfiles(flagBase, flagDiffBase []*string) error {
175 base, diffBase := dropEmpty(flagBase), dropEmpty(flagDiffBase)
176 if len(base) > 0 && len(diffBase) > 0 {
177 return errors.New("-base and -diff_base flags cannot both be specified")
178 }
179
180 source.Base = base
181 if len(diffBase) > 0 {
182 source.Base, source.DiffBase = diffBase, true
183 }
184 return nil
185}
186
187// dropEmpty list takes a slice of string pointers, and outputs a slice of
188// non-empty strings associated with the flag.

Callers 1

parseFlagsFunction · 0.95

Calls 1

dropEmptyFunction · 0.85

Tested by

no test coverage detected