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

Method initSamples

internal/report/source.go:594–606  ·  view source on GitHub ↗
(flat, cum map[uint64]int64)

Source from the content-addressed store, hash-verified

592}
593
594func (sp *sourcePrinter) initSamples(flat, cum map[uint64]int64) {
595 for addr, inst := range sp.insts {
596 // Move all samples that were assigned to the middle of an instruction to the
597 // beginning of that instruction. This takes care of samples that were recorded
598 // against pc+1.
599 instEnd := addr + uint64(inst.length)
600 for p := addr; p < instEnd; p++ {
601 inst.flat += flat[p]
602 inst.cum += cum[p]
603 }
604 sp.insts[addr] = inst
605 }
606}
607
608func (sp *sourcePrinter) generate(maxFiles int, rpt *Report) WebListData {
609 // Finalize per-file counts.

Callers 1

newSourcePrinterFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected