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

Method mapFunction

profile/merge.go:426–449  ·  view source on GitHub ↗
(src *Function)

Source from the content-addressed store, hash-verified

424}
425
426func (pm *profileMerger) mapFunction(src *Function) *Function {
427 if src == nil {
428 return nil
429 }
430 if f, ok := pm.functionsByID[src.ID]; ok {
431 return f
432 }
433 k := src.key()
434 if f, ok := pm.functions[k]; ok {
435 pm.functionsByID[src.ID] = f
436 return f
437 }
438 f := &Function{
439 ID: uint64(len(pm.p.Function) + 1),
440 Name: src.Name,
441 SystemName: src.SystemName,
442 Filename: src.Filename,
443 StartLine: src.StartLine,
444 }
445 pm.functions[k] = f
446 pm.functionsByID[src.ID] = f
447 pm.p.Function = append(pm.p.Function, f)
448 return f
449}
450
451// key generates a struct to be used as a key for maps.
452func (f *Function) key() functionKey {

Callers 1

mapLineMethod · 0.95

Calls 1

keyMethod · 0.45

Tested by

no test coverage detected