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

Function selectNodesForGraph

internal/graph/graph.go:394–410  ·  view source on GitHub ↗
(nodes Nodes, dropNegative bool)

Source from the content-addressed store, hash-verified

392}
393
394func selectNodesForGraph(nodes Nodes, dropNegative bool) *Graph {
395 // Collect nodes into a graph.
396 gNodes := make(Nodes, 0, len(nodes))
397 for _, n := range nodes {
398 if n == nil {
399 continue
400 }
401 if n.Cum == 0 && n.Flat == 0 {
402 continue
403 }
404 if dropNegative && isNegative(n) {
405 continue
406 }
407 gNodes = append(gNodes, n)
408 }
409 return &Graph{gNodes}
410}
411
412type nodePair struct {
413 src, dest *Node

Callers 2

newGraphFunction · 0.85
newTreeFunction · 0.85

Calls 1

isNegativeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…