go/src/internal/profile/graph.go

type Options

type Nodes

type Node

type Graph

// FlatValue returns the exclusive value for this node, computing the
// mean if a divisor is available.
func (n *Node) FlatValue() int64 {}

// CumValue returns the inclusive value for this node, computing the
// mean if a divisor is available.
func (n *Node) CumValue() int64 {}

// AddToEdge increases the weight of an edge between two nodes. If
// there isn't such an edge one is created.
func (n *Node) AddToEdge(to *Node, v int64, residual, inline bool) {}

// AddToEdgeDiv increases the weight of an edge between two nodes. If
// there isn't such an edge one is created.
func (n *Node) AddToEdgeDiv(to *Node, dv, v int64, residual, inline bool) {}

type NodeInfo

// PrintableName calls the Node's Formatter function with a single space separator.
func (i *NodeInfo) PrintableName() string {}

// NameComponents returns the components of the printable name to be used for a node.
func (i *NodeInfo) NameComponents() []string {}

type NodeMap

type NodeSet

type NodePtrSet

// FindOrInsertNode takes the info for a node and either returns a matching node
// from the node map if one exists, or adds one to the map if one does not.
// If kept is non-nil, nodes are only added if they can be located on it.
func (nm NodeMap) FindOrInsertNode(info NodeInfo, kept NodeSet) *Node {}

type EdgeMap

func (em EdgeMap) FindTo(n *Node) *Edge {}

func (em *EdgeMap) Add(e *Edge) {}

func (em *EdgeMap) Delete(e *Edge) {}

type Edge

// WeightValue returns the weight value for this edge, normalizing if a
// divisor is available.
func (e *Edge) WeightValue() int64 {}

// NewGraph computes a graph from a profile.
func NewGraph(prof *Profile, o *Options) *Graph {}

func selectNodesForGraph(nodes Nodes, dropNegative bool) *Graph {}

type nodePair

// isNegative returns true if the node is considered as "negative" for the
// purposes of drop_negative.
func isNegative(n *Node) bool {}

type locationMap

func (l *locationMap) add(id uint64, n Nodes) {}

func (l locationMap) get(id uint64) Nodes {}

// CreateNodes creates graph nodes for all locations in a profile. It
// returns set of all nodes, plus a mapping of each location to the
// set of corresponding nodes (one per location.Line).
func CreateNodes(prof *Profile, o *Options) (Nodes, locationMap) {}

func (nm NodeMap) nodes() Nodes {}

func (nm NodeMap) findOrInsertLine(l *Location, li Line, o *Options) *Node {}

func nodeInfo(l *Location, line Line, objfile string, o *Options) *NodeInfo {}

// Sum adds the flat and cum values of a set of nodes.
func (ns Nodes) Sum() (flat int64, cum int64) {}

func (n *Node) addSample(dw, w int64, flat bool) {}

// String returns a text representation of a graph, for debugging purposes.
func (g *Graph) String() string {}

// Sort returns a slice of the edges in the map, in a consistent
// order. The sort order is first based on the edge weight
// (higher-to-lower) and then by the node names to avoid flakiness.
func (em EdgeMap) Sort() []*Edge {}

// Sum returns the total weight for a set of nodes.
func (em EdgeMap) Sum() int64 {}

type edgeList

func (el edgeList) Len() int {}

func (el edgeList) Less(i, j int) bool {}

func (el edgeList) Swap(i, j int) {}

func abs64(i int64) int64 {}