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

Function configure

internal/driver/config.go:296–312  ·  view source on GitHub ↗

configure stores the name=value mapping into the current config, correctly handling the case when name identifies a particular choice in a field.

(name, value string)

Source from the content-addressed store, hash-verified

294// configure stores the name=value mapping into the current config, correctly
295// handling the case when name identifies a particular choice in a field.
296func configure(name, value string) error {
297 currentMu.Lock()
298 defer currentMu.Unlock()
299 f, ok := configFieldMap[name]
300 if !ok {
301 return fmt.Errorf("unknown config field %q", name)
302 }
303 if f.name == name {
304 return currentCfg.set(f, value)
305 }
306 // name must be one of the choices. If value is true, set field-value
307 // to name.
308 if v, err := strconv.ParseBool(value); v && err == nil {
309 return currentCfg.set(f, name)
310 }
311 return fmt.Errorf("unknown config field %q", name)
312}
313
314// resetTransient sets all transient fields in *cfg to their currently
315// configured values.

Callers 3

SetVariableDefaultFunction · 0.85
TestAssignFunction · 0.85
interactiveFunction · 0.85

Calls 1

setMethod · 0.45

Tested by 1

TestAssignFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…