go/src/cmd/vendor/github.com/google/pprof/internal/report/source.go

// printSource prints an annotated source listing, include all
// functions with samples that match the regexp rpt.options.symbol.
// The sources are sorted by function name and then by filename to
// eliminate potential nondeterminism.
func printSource(w io.Writer, rpt *Report) error {}

type sourcePrinter

type addrInfo

type instructionInfo

type sourceFile

type sourceInst

type sourceFunction

type addressRange

type WebListData

type WebListFile

type WebListFunc

type WebListLine

type WebListInstruction

type WebListCall

// MakeWebList returns an annotated source listing of rpt.
// rpt.prof should contain inlined call info.
func MakeWebList(rpt *Report, obj plugin.ObjTool, maxFiles int) (WebListData, error) {}

func newSourcePrinter(rpt *Report, obj plugin.ObjTool, sourcePath string) *sourcePrinter {}

func (sp *sourcePrinter) close() {}

func (sp *sourcePrinter) expandAddresses(rpt *Report, addrs map[uint64]addrInfo, flat map[uint64]int64) {}

func (sp *sourcePrinter) addStack(addr uint64, frames []plugin.Frame) {}

const synthAsm

// handleUnprocessed handles addresses that were skipped by splitIntoRanges because they
// did not belong to a known object file.
func (sp *sourcePrinter) handleUnprocessed(addrs map[uint64]addrInfo, unprocessed []uint64) {}

// splitIntoRanges converts the set of addresses we are interested in into a set of address
// ranges to disassemble. It also returns the set of addresses found that did not have an
// associated object file and were therefore not added to an address range.
func (sp *sourcePrinter) splitIntoRanges(prof *profile.Profile, addrMap map[uint64]addrInfo, flat map[uint64]int64) ([]addressRange, []uint64) {}

func (sp *sourcePrinter) initSamples(flat, cum map[uint64]int64) {}

func (sp *sourcePrinter) generate(maxFiles int, rpt *Report) WebListData {}

func (sp *sourcePrinter) generateFile(f *sourceFile, rpt *Report) WebListFile {}

// functions splits apart the lines to show in a file into a list of per-function ranges.
func (sp *sourcePrinter) functions(f *sourceFile) []sourceFunction {}

// objectFile return the object for the specified mapping, opening it if necessary.
// It returns nil on error.
func (sp *sourcePrinter) objectFile(m *profile.Mapping) plugin.ObjFile {}

// makeWebListLine returns the contents of a single line in a web listing. This includes
// the source line and the corresponding assembly.
func makeWebListLine(lineNo int, flat, cum int64, lineContents string,
	assembly []assemblyInstruction, reader *sourceReader, rpt *Report) WebListLine {}

func makeWebListInstructions(srcIndent int, assembly []assemblyInstruction, reader *sourceReader, rpt *Report) []WebListInstruction {}

// getSourceFromFile collects the sources of a function from a source
// file and annotates it with the samples in fns. Returns the sources
// as nodes, using the info.name field to hold the source code.
func getSourceFromFile(file string, reader *sourceReader, fns graph.Nodes, start, end int) (graph.Nodes, string, error) {}

type sourceReader

func newSourceReader(searchPath, trimPath string) *sourceReader {}

func (reader *sourceReader) fileError(path string) error {}

// line returns the line numbered "lineno" in path, or _,false if lineno is out of range.
func (reader *sourceReader) line(path string, lineno int) (string, bool) {}

// openSourceFile opens a source file from a name encoded in a profile. File
// names in a profile after can be relative paths, so search them in each of
// the paths in searchPath and their parents. In case the profile contains
// absolute paths, additional paths may be configured to trim from the source
// paths in the profile. This effectively turns the path into a relative path
// searching it using searchPath as usual).
func openSourceFile(path, searchPath, trim string) (*os.File, error) {}

// trimPath cleans up a path by removing prefixes that are commonly
// found on profiles plus configured prefixes.
// TODO(aalexand): Consider optimizing out the redundant work done in this
// function if it proves to matter.
func trimPath(path, trimPath, searchPath string) string {}

func indentation(line string) int {}

// rightPad pads the input with spaces on the right-hand-side to make it have
// at least width n. It treats tabs as enough spaces that lead to the next
// 8-aligned tab-stop.
func rightPad(s string, n int) string {}

func canonicalizeFileName(fname string) string {}