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

Method source

internal/driver/webui.go:408–427  ·  view source on GitHub ↗

source generates a web page containing source code annotated with profile data.

(w http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

406// source generates a web page containing source code annotated with profile
407// data.
408func (ui *webInterface) source(w http.ResponseWriter, req *http.Request) {
409 args := []string{"weblist", req.URL.Query().Get("f")}
410 rpt, errList := ui.makeReport(w, req, args, nil)
411 if rpt == nil {
412 return // error already reported
413 }
414
415 // Generate source listing.
416 listing, err := report.MakeWebList(rpt, ui.options.Obj, maxEntries)
417 if err != nil {
418 http.Error(w, err.Error(), http.StatusBadRequest)
419 ui.options.UI.PrintErr(err)
420 return
421 }
422
423 legend := report.ProfileLabels(rpt)
424 ui.render(w, req, "sourcelisting", rpt, errList, legend, webArgs{
425 Listing: listing,
426 })
427}
428
429// peek generates a web page listing callers/callers.
430func (ui *webInterface) peek(w http.ResponseWriter, req *http.Request) {

Callers

nothing calls this directly

Calls 5

makeReportMethod · 0.95
renderMethod · 0.95
MakeWebListFunction · 0.92
ProfileLabelsFunction · 0.92
PrintErrMethod · 0.65

Tested by

no test coverage detected