Documentation ¶
Overview ¶
Package report summarizes a performance profile into a human-readable report.
Index ¶
- Constants
- func AddSourceTemplates(t *template.Template)
- func Generate(w io.Writer, rpt *Report, obj plugin.ObjTool) error
- func GetDOT(rpt *Report) (*graph.Graph, *graph.DotConfig)
- func PrintAssembly(w io.Writer, rpt *Report, obj plugin.ObjTool, maxFuncs int) error
- func ProfileLabels(rpt *Report) []string
- type Options
- type Report
- type Stack
- type StackSet
- type StackSlot
- type StackSource
- type TextItem
- type WebListCall
- type WebListData
- type WebListFile
- type WebListFunc
- type WebListInstruction
- type WebListLine
Constants ¶
const ( Callgrind = iota Comments Dis Dot List Proto Raw Tags Text TopProto Traces Tree WebList )
Output formats.
Variables ¶
This section is empty.
Functions ¶
func AddSourceTemplates ¶
AddSourceTemplates adds templates used by PrintWebList to t.
func GetDOT ¶
GetDOT returns a graph suitable for dot processing along with some configuration information.
func PrintAssembly ¶
PrintAssembly prints annotated disassembly of rpt to w.
func ProfileLabels ¶
ProfileLabels returns printable labels for a profile.
Types ¶
type Options ¶
type Options struct { OutputFormat int CumSort bool CallTree bool DropNegative bool CompactLabels bool Ratio float64 Title string ProfileLabels []string ActiveFilters []string NumLabelUnits map[string]string NodeCount int NodeFraction float64 EdgeFraction float64 SampleValue func(s []int64) int64 SampleMeanDivisor func(s []int64) int64 SampleType string SampleUnit string // Unit for the sample data from the profile. OutputUnit string // Units for data formatting in report. Symbol *regexp.Regexp // Symbols to include on disassembly report. SourcePath string // Search path for source files. TrimPath string // Paths to trim from source file paths. IntelSyntax bool // Whether or not to print assembly in Intel syntax. }
Options are the formatting and filtering options used to generate a profile.
type Report ¶
type Report struct {
// contains filtered or unexported fields
}
Report contains the data and associated routines to extract a report from a profile.
func New ¶
New builds a new report indexing the sample values interpreting the samples with the provided function.
func NewDefault ¶
NewDefault builds a new report indexing the last sample value available.
func (*Report) OutputFormat ¶
OutputFormat returns the output format for the report.
type Stack ¶
type Stack struct { Value int64 // Total value for all samples of this stack. Sources []int // Indices in StackSet.Sources (callers before callees). }
Stack holds a single stack instance.
type StackSet ¶
type StackSet struct { Total int64 // Total value of the profile. Scale float64 // Multiplier to generate displayed value Type string // Profile type. E.g., "cpu". Unit string // One of "B", "s", "GCU", or "" (if unknown) Stacks []Stack // List of stored stacks Sources []StackSource // Mapping from source index to info }
StackSet holds a set of stacks corresponding to a profile.
Slices in StackSet and the types it contains are always non-nil, which makes Javascript code that uses the JSON encoding less error-prone.
type StackSource ¶
type StackSource struct { FullName string FileName string UniqueName string // Disambiguates functions with same names Inlined bool // If true this source was inlined into its caller // Alternative names to display (with decreasing lengths) to make text fit. // Guaranteed to be non-empty. Display []string // Places holds the list of stack slots where this source occurs. // In particular, if [a,b] is an element in Places, // StackSet.Stacks[a].Sources[b] points to this source. // // No stack will be referenced twice in the Places slice for a given // StackSource. In case of recursion, Places will contain the outer-most // entry in the recursive stack. E.g., if stack S has source X at positions // 4,6,9,10, the Places entry for X will contain [S,4]. Places []StackSlot // Combined count of stacks where this source is the leaf. Self int64 // Color number to use for this source. // Colors with high numbers than supported may be treated as zero. Color int }
StackSource holds function/location info for a stack entry.
type TextItem ¶
type TextItem struct { Name string InlineLabel string // Not empty if inlined Flat, Cum int64 // Raw values FlatFormat, CumFormat string // Formatted values }
TextItem holds a single text report entry.
type WebListCall ¶
WebListCall holds the per-inlined-call information for HTML source code listing.
type WebListData ¶
type WebListData struct { Total string Files []WebListFile }
WebListData holds the data needed to generate HTML source code listing.
func MakeWebList ¶
MakeWebList returns an annotated source listing of rpt. rpt.prof should contain inlined call info.
type WebListFile ¶
type WebListFile struct {
Funcs []WebListFunc
}
WebListFile holds the per-file information for HTML source code listing.
type WebListFunc ¶
type WebListFunc struct { Name string File string Flat string Cumulative string Percent string Lines []WebListLine }
WebListFunc holds the per-function information for HTML source code listing.
type WebListInstruction ¶
type WebListInstruction struct { NewBlock bool // Insert marker that indicates separation from previous block Flat string Cumulative string Synthetic bool Address uint64 Disasm string FileLine string InlinedCalls []WebListCall }
WebListInstruction holds the per-instruction information for HTML source code listing.
type WebListLine ¶
type WebListLine struct { SrcLine string HTMLClass string Line int Flat string Cumulative string Instructions []WebListInstruction }
WebListLine holds the per-source-line information for HTML source code listing.