parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectOrRemoveHeader

func CollectOrRemoveHeader(scanner *bufio.Scanner, profileType string, lines *[]string, shouldRemove bool)

func GetAllFunctionNames

func GetAllFunctionNames(filePath string, filter ProfileFilter) (names []string, err error)

GetAllFunctionNames extracts all function names from a profile text file, applying the given filter.

func GetAllProfileLines

func GetAllProfileLines(scanner *bufio.Scanner, lines *[]string)

func ShouldKeepLine

func ShouldKeepLine(line string, agrs *args.LineFilterArgs) bool

ShouldKeepLine determines if a line from a profile should be kept based on profile values and ignore filters.

Types

type LineObj

type LineObj struct {
	FnName         string
	Flat           float64
	FlatPercentage float64
	SumPercentage  float64
	Cum            float64
	CumPercentage  float64
}

func TurnLinesIntoObjects

func TurnLinesIntoObjects(profilePath, profileType string) ([]*LineObj, error)

type ProfileFilter

type ProfileFilter struct {
	// Include only lines starting with specified prefix
	FunctionPrefixes []string

	// Ignore all functions after the last dot even if includes the above prefix
	IgnoreFunctions []string
}

ProfileFilter collects filters for extracting function names from a profile.

type ProfileFloats

type ProfileFloats struct {
	Flat           float64
	FlatPercentage float64
	Sum            float64
	Cum            float64
	CumPercentage  float64
}

Jump to

Keyboard shortcuts

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