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

Method handleUnprocessed

internal/report/source.go:506–542  ·  view source on GitHub ↗

handleUnprocessed handles addresses that were skipped by splitIntoRanges because they did not belong to a known object file.

(addrs map[uint64]addrInfo, unprocessed []uint64)

Source from the content-addressed store, hash-verified

504// handleUnprocessed handles addresses that were skipped by splitIntoRanges because they
505// did not belong to a known object file.
506func (sp *sourcePrinter) handleUnprocessed(addrs map[uint64]addrInfo, unprocessed []uint64) {
507 // makeFrames synthesizes a []plugin.Frame list for the specified address.
508 // The result will typically have length 1, but may be longer if address corresponds
509 // to inlined calls.
510 makeFrames := func(addr uint64) []plugin.Frame {
511 loc := addrs[addr].loc
512 stack := make([]plugin.Frame, 0, len(loc.Line))
513 for _, line := range loc.Line {
514 fn := line.Function
515 if fn == nil {
516 continue
517 }
518 stack = append(stack, plugin.Frame{
519 Func: fn.Name,
520 File: fn.Filename,
521 Line: int(line.Line),
522 })
523 }
524 return stack
525 }
526
527 for _, addr := range unprocessed {
528 frames := makeFrames(addr)
529 x := instructionInfo{
530 objAddr: addr,
531 length: 1,
532 disasm: synthAsm,
533 }
534 if len(frames) > 0 {
535 x.file = frames[0].File
536 x.line = frames[0].Line
537 }
538 sp.insts[addr] = x
539
540 sp.addStack(addr, frames)
541 }
542}
543
544// splitIntoRanges converts the set of addresses we are interested in into a set of address
545// ranges to disassemble. It also returns the set of addresses found that did not have an

Callers 1

expandAddressesMethod · 0.95

Calls 1

addStackMethod · 0.95

Tested by

no test coverage detected