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

Function makeWebListLine

internal/report/source.go:807–835  ·  view source on GitHub ↗

makeWebListLine returns the contents of a single line in a web listing. This includes the source line and the corresponding assembly.

(lineNo int, flat, cum int64, lineContents string,
	assembly []assemblyInstruction, reader *sourceReader, rpt *Report)

Source from the content-addressed store, hash-verified

805// makeWebListLine returns the contents of a single line in a web listing. This includes
806// the source line and the corresponding assembly.
807func makeWebListLine(lineNo int, flat, cum int64, lineContents string,
808 assembly []assemblyInstruction, reader *sourceReader, rpt *Report) WebListLine {
809 line := WebListLine{
810 SrcLine: lineContents,
811 Line: lineNo,
812 Flat: valueOrDot(flat, rpt),
813 Cumulative: valueOrDot(cum, rpt),
814 }
815
816 if len(assembly) == 0 {
817 line.HTMLClass = "nop"
818 return line
819 }
820
821 nestedInfo := false
822 line.HTMLClass = "deadsrc"
823 for _, an := range assembly {
824 if len(an.inlineCalls) > 0 || an.instruction != synthAsm {
825 nestedInfo = true
826 line.HTMLClass = "livesrc"
827 }
828 }
829
830 if nestedInfo {
831 srcIndent := indentation(lineContents)
832 line.Instructions = makeWebListInstructions(srcIndent, assembly, reader, rpt)
833 }
834 return line
835}
836
837func makeWebListInstructions(srcIndent int, assembly []assemblyInstruction, reader *sourceReader, rpt *Report) []WebListInstruction {
838 var result []WebListInstruction

Callers 1

generateFileMethod · 0.85

Calls 3

valueOrDotFunction · 0.85
indentationFunction · 0.85
makeWebListInstructionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…