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

Function MakeWebList

internal/report/source.go:243–258  ·  view source on GitHub ↗

MakeWebList returns an annotated source listing of rpt. rpt.prof should contain inlined call info.

(rpt *Report, obj plugin.ObjTool, maxFiles int)

Source from the content-addressed store, hash-verified

241// MakeWebList returns an annotated source listing of rpt.
242// rpt.prof should contain inlined call info.
243func MakeWebList(rpt *Report, obj plugin.ObjTool, maxFiles int) (WebListData, error) {
244 sourcePath := rpt.options.SourcePath
245 if sourcePath == "" {
246 wd, err := os.Getwd()
247 if err != nil {
248 return WebListData{}, fmt.Errorf("could not stat current dir: %v", err)
249 }
250 sourcePath = wd
251 }
252 sp := newSourcePrinter(rpt, obj, sourcePath)
253 if len(sp.interest) == 0 {
254 return WebListData{}, fmt.Errorf("no matches found for regexp: %s", rpt.options.Symbol)
255 }
256 defer sp.close()
257 return sp.generate(maxFiles, rpt), nil
258}
259
260func newSourcePrinter(rpt *Report, obj plugin.ObjTool, sourcePath string) *sourcePrinter {
261 sp := &sourcePrinter{

Callers 4

sourceMethod · 0.92
printWebListFunction · 0.92
TestWebListFunction · 0.85
testSourceMappingFunction · 0.85

Calls 3

newSourcePrinterFunction · 0.85
generateMethod · 0.80
closeMethod · 0.65

Tested by 2

TestWebListFunction · 0.68
testSourceMappingFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…