stackview

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFunctionNotFoundInCollection = errors.New("function not found in eBPF collection")

ErrFunctionNotFoundInCollection indicates a function was present in DWARF but not in the eBPF collection spec.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

Analyzer provides stack usage information for one collection file.

func NewAnalyzer

func NewAnalyzer(collectionPath string) (*Analyzer, error)

NewAnalyzer parses DWARF data from a collection path.

func (*Analyzer) CollectionSummary

func (a *Analyzer) CollectionSummary() []ProgramStackUsage

CollectionSummary returns peak stack usage for all BPF programs in the collection.

func (*Analyzer) CollectionSummaryInCollection

func (a *Analyzer) CollectionSummaryInCollection() ([]ProgramStackUsage, error)

CollectionSummaryInCollection returns peak stack usage for BPF programs that are also present in the loaded eBPF collection.

func (*Analyzer) ProgramDetails

func (a *Analyzer) ProgramDetails(functionName string) ([][]SlotUsage, error)

ProgramDetails returns grouped stack slot usage for a single program.

type CallStackEntry

type CallStackEntry struct {
	Name        string `json:"name"`
	FileLineCol string `json:"file_line_col"`
}

CallStackEntry describes one call frame for a stack slot.

type ProgramStackUsage

type ProgramStackUsage struct {
	Name       string `json:"name"`
	StackUsage int64  `json:"stack_usage"`
}

ProgramStackUsage holds peak stack usage for one program.

func SortProgramStackUsage

func SortProgramStackUsage(stackUsagePerProgram map[string]int64) []ProgramStackUsage

SortProgramStackUsage returns usage sorted by bytes descending and name ascending.

type SlotUsage

type SlotUsage struct {
	Offset      int64            `json:"offset"`
	Name        string           `json:"name"`
	ByteSize    int64            `json:"byte_size"`
	FileLineCol string           `json:"file_line_col"`
	Callstack   []CallStackEntry `json:"callstack,omitempty"`
}

SlotUsage describes one variable/register use mapped to a stack offset.

func (SlotUsage) DisplayEqual

func (s SlotUsage) DisplayEqual(other SlotUsage) bool

DisplayEqual reports whether two entries render as the same line in non-callstack views.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL