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

Method disasm

internal/driver/webui.go:385–404  ·  view source on GitHub ↗

disasm generates a web page containing disassembly.

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

Source from the content-addressed store, hash-verified

383
384// disasm generates a web page containing disassembly.
385func (ui *webInterface) disasm(w http.ResponseWriter, req *http.Request) {
386 args := []string{"disasm", req.URL.Query().Get("f")}
387 rpt, errList := ui.makeReport(w, req, args, nil)
388 if rpt == nil {
389 return // error already reported
390 }
391
392 out := &bytes.Buffer{}
393 if err := report.PrintAssembly(out, rpt, ui.options.Obj, maxEntries); err != nil {
394 http.Error(w, err.Error(), http.StatusBadRequest)
395 ui.options.UI.PrintErr(err)
396 return
397 }
398
399 legend := report.ProfileLabels(rpt)
400 ui.render(w, req, "plaintext", rpt, errList, legend, webArgs{
401 TextBody: out.String(),
402 })
403
404}
405
406// source generates a web page containing source code annotated with profile
407// data.

Callers

nothing calls this directly

Calls 6

makeReportMethod · 0.95
renderMethod · 0.95
PrintAssemblyFunction · 0.92
ProfileLabelsFunction · 0.92
PrintErrMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected