concurrency

package
v0.3.5-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisResult

type AnalysisResult struct {
	// Ids contains the indices of Go calls. Ids[0] is always nil
	Ids []*ssa.Go

	// GoCalls contains the map from go calls to indices. The indices are >= 1, and such that for some go instruction
	// g, Ids[GoCalls[g]] == g
	GoCalls map[*ssa.Go]uint32

	// NodeColors is a map from callgraph nodes (functions) to a set of go ids. That set should at least contain the
	// index 0 (no go routine) for all reachable nodes, and then any additional id means the function is called inside
	// a goroutine starting at instruction GoCalls[id]
	NodeColors map[*callgraph.Node]map[uint32]bool
}

AnalysisResult contains all the information resulting from the Analyze function

func Analyze

func Analyze(state *ptr.State) (AnalysisResult, error)

Analyze runs the concurrency analysis on the program contained in the state. The dataflow analysis state must contain the program, as well as the results from the callgraph analysis and the pointer analysis

The analysis currently consists in:

- a first pass to collect all occurrences of `go ...` instructions

- a second pass to mark function with the all the `go ...` instructions they may be called from

Jump to

Keyboard shortcuts

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