Documentation
¶
Overview ¶
Implements Experiments and their methods
detectors
Main file for evaluation ¶
Implements Experiments and their methods ¶
Implements Experiments and their methods ¶
detectors
JSON-related functions ¶
Generates tables and reports ¶
Utility functions for package evaluate
Index ¶
- Constants
- func CoverageSummary(ex Ex) []interface{}
- func CoverageSummaryPerExp(ex Ex)
- func EvaluateComparison(configFile string, thresh int)
- func EvaluateCoverage(configFile string, thresh int, isRace bool)
- func EvaluateNonBlocking(configFile string, thresh int)
- func EvaluateOverhead(configFile string, thresh int, ns []int)
- func EvaluateSingle(path string, freq, d int, isRace bool)
- func MeasureTime(fn func()) (et time.Duration)
- func PrintGGTree(root *GGTree, concUsage []*instrument.ConcurrencyUsage)
- func ReadConcUsage(fname string) (ret []*instrument.ConcurrencyUsage)
- func ReadGoKerConfig(bugtype string) map[string][]string
- func ReadLines(f string) (lines []string)
- func ReadResults(fname string) map[string]Ex
- func TableSummaryPerBug(rx *RootExperiment)
- func Table_Bug_Coverage(bugs map[string]*RootExperiment, tool string, thresh int, coverage1 bool)
- func Table_Bug_Tool(bugs map[string]*RootExperiment, order int, identifier string)
- type Bug
- type ConcUsageStruct
- type Count
- type Coverage
- type DetectFunc
- type ECTExperiment
- type Ex
- type ExConfig
- type Experiment
- type GGInfo
- type GGTree
- type GlobalStack
- type GoatExperiment
- func (gex *GoatExperiment) Build(race bool)
- func (gex *GoatExperiment) Execute(i int, race bool) *Result
- func (gex *GoatExperiment) GetMode() string
- func (gex *GoatExperiment) Init(race bool)
- func (gex *GoatExperiment) InitConcMap()
- func (gex *GoatExperiment) Instrument()
- func (gex *GoatExperiment) PrintCoverageReport(countNoop bool) float64
- func (gex *GoatExperiment) PrintGlobals()
- func (gex *GoatExperiment) UpdateConcUsage(stacks map[uint64][]*trace.Frame, lstack map[uint64]string)
- func (gex *GoatExperiment) UpdateCoverageGGTree(parseResult *trace.ParseResult, lstack map[uint64]string)
- func (gex *GoatExperiment) UpdateCoverageReport()
- func (gex *GoatExperiment) UpdateGGTree(parseResult *trace.ParseResult, lstack map[uint64]string)
- func (gex *GoatExperiment) UpdateGStack(stack map[uint64][]*trace.Frame) map[uint64]string
- type InstFunc
- type Result
- type RootExperiment
- type Selecti
- type ToolExperiment
Constants ¶
const ( BUILTINDL = iota GOLEAK LOCKDL GOAT_M GOAT_U GOAT_D1 GOAT_D2 GOAT_D3 TOOL_COUNT )
const ( ORDER_BUG = iota ORDER_CAUSE ORDER_SUBCAUSE )
const CPU = 0
const EVENT_BOUND = 200000000
const GOVER_GOAT = "/home/saeed/go-builds/go-goat-1.15.6"
const GOVER_ORIG = "/home/saeed/go-builds/go-orig-1.15.6"
const RESDIR = "/home/saeed/goatws/results"
const TERMINATION = "hitBug"
const TO = 30 // second
const WORKDIR = ""
Variables ¶
This section is empty.
Functions ¶
func CoverageSummary ¶
func CoverageSummary(ex Ex) []interface{}
func CoverageSummaryPerExp ¶
func CoverageSummaryPerExp(ex Ex)
func EvaluateComparison ¶
func EvaluateCoverage ¶
func EvaluateNonBlocking ¶
func EvaluateOverhead ¶
func EvaluateSingle ¶
func MeasureTime ¶
func PrintGGTree ¶
func PrintGGTree(root *GGTree, concUsage []*instrument.ConcurrencyUsage)
func ReadConcUsage ¶
func ReadConcUsage(fname string) (ret []*instrument.ConcurrencyUsage)
Read concUsage
func ReadGoKerConfig ¶
Read GoKer config JSON file
func TableSummaryPerBug ¶
func TableSummaryPerBug(rx *RootExperiment)
func Table_Bug_Coverage ¶
func Table_Bug_Coverage(bugs map[string]*RootExperiment, tool string, thresh int, coverage1 bool)
func Table_Bug_Tool ¶
func Table_Bug_Tool(bugs map[string]*RootExperiment, order int, identifier string)
Types ¶
type Bug ¶
type Bug struct { BugName string `json:"bugName"` // Name BugDir string `json:"bugDir"` // Dir BugType string `json:"bugType"` // Blocking - Nonblocking - overhead BugCause string `json:"bugCause"` // Majore Cause BugSubCause string `json:"bugSubcause"` // Sub-cause }
Struct for Bugs
type ConcUsageStruct ¶
type ConcUsageStruct struct { ConcUsage []*instrument.ConcurrencyUsage `json:"concUsage"` ConcUsageMap map[string]int // key: cu.string, val: cu index ConcUsageStackMap map[string][]int // key: fkey for cu, val: []cu index (there might be multiple concurrent usage that shares a common stack frame) ConcUsageStackFekys []string // list of all fkeys ConcUsageReport map[int]map[string]int // how each concusage is covered (post-execution) }
type Coverage ¶
type Coverage struct {
// contains filtered or unexported fields
}
func (*Coverage) ToMap ¶
func (cov *Coverage) ToMap(cu *instrument.ConcurrencyUsage, gid int) (ret map[string]int)
func (*Coverage) ToString ¶
func (cov *Coverage) ToString(cu *instrument.ConcurrencyUsage) (string, string)
type DetectFunc ¶
type ECTExperiment ¶
type ECTExperiment struct { Experiment Args []string `json:"args"` ID string `json:"ID"` GoVer string `json:"goVer"` TraceDir string `json:"traceDir,omitempty"` }
func (*ECTExperiment) Execute ¶
func (ex *ECTExperiment) Execute(i int, race bool) *Result
Execute and analyze ECT-experiment
func (*ECTExperiment) Init ¶
func (ex *ECTExperiment) Init(race bool)
type Ex ¶
type Ex interface { Init(bool) // init the experiments (bool: race) Instrument() // instrument the program Build(bool) // build the program (bool: race) Execute(int, bool) *Result // execute the instrumented program (int: #iteration) }
Interface for Experiments
type Experiment ¶
type Experiment struct { ExConfig Target *Bug `json:"-"` PrefixDir string `json:"prefixDir"` BinaryName string `json:"binaryName"` OutPath string `json:"outPath"` OutBuf *bufio.Writer `json:"-"` Results []*Result `json:"results"` Detector DetectFunc `json:"-"` Instrumentor InstFunc `json:"-"` }
Struct for all experiments
type GGInfo ¶
type GGInfo struct { CoverageMap map[int]*Coverage // global structure to store general coverages. key: cuIndex, val: coverage instance per each node // contains filtered or unexported fields }
Nodes of GGTree
func (*GGInfo) CovNodeMap ¶
func (gi *GGInfo) CovNodeMap(concUsage []*instrument.ConcurrencyUsage) (ret map[int]map[string]int)
func (*GGInfo) ToString ¶
func (gi *GGInfo) ToString(concUsage []*instrument.ConcurrencyUsage) (string, string)
type GGTree ¶
type GGTree struct { Node *GGInfo Children map[string][]*GGTree // key: createFkey, val: totally ordered goroutines that were created in fkey }
func (*GGTree) ToString ¶
func (t *GGTree) ToString(concUsage []*instrument.ConcurrencyUsage) string
type GlobalStack ¶
type GoatExperiment ¶
type GoatExperiment struct { Experiment ID string `json:"goatid"` Bound int `json:"goatBound"` // -1: multi, 0: uni, 1 =< : delay TraceDir string `json:"traceDir"` // for blocking bugs only LastFailedTrace string `json:"lastFailedTrace"` LastSuccessTrace string `json:"lastSuccessTrace"` FirstFailedAfter int `json:"firstFailedAfter"` GGTree *GGTree `json:"-"` // (will be reconstructed from replay) TotalGG int `json:"-"` // (will be reconstructed from replay) ConcUsage *ConcUsageStruct `json:"-"` // (will be reconstructed from replay) GStack *GlobalStack `json:"-"` // (will be reconstructed from replay) }
Struct for Goat experiments
func ReadExperimentResults_goat ¶
func ReadExperimentResults_goat(fname string) (exp *GoatExperiment)
func (*GoatExperiment) Execute ¶
func (gex *GoatExperiment) Execute(i int, race bool) *Result
Execute and analyze Goat-experiment
func (*GoatExperiment) InitConcMap ¶
func (gex *GoatExperiment) InitConcMap()
map concurrency usage index to its respective string representation
func (*GoatExperiment) Instrument ¶
func (gex *GoatExperiment) Instrument()
Instrument Goat-experiment
func (*GoatExperiment) PrintCoverageReport ¶
func (gex *GoatExperiment) PrintCoverageReport(countNoop bool) float64
func (*GoatExperiment) PrintGlobals ¶
func (gex *GoatExperiment) PrintGlobals()
func (*GoatExperiment) UpdateConcUsage ¶
func (gex *GoatExperiment) UpdateConcUsage(stacks map[uint64][]*trace.Frame, lstack map[uint64]string)
after creating lstack (updating gstack), update concUsage with their respective fkeys
func (*GoatExperiment) UpdateCoverageGGTree ¶
func (gex *GoatExperiment) UpdateCoverageGGTree(parseResult *trace.ParseResult, lstack map[uint64]string)
func (*GoatExperiment) UpdateCoverageReport ¶
func (gex *GoatExperiment) UpdateCoverageReport()
func (*GoatExperiment) UpdateGGTree ¶
func (gex *GoatExperiment) UpdateGGTree(parseResult *trace.ParseResult, lstack map[uint64]string)
func (*GoatExperiment) UpdateGStack ¶
Updates GStack and returns compatible LStack
type InstFunc ¶
type InstFunc func(string, string) []*instrument.ConcurrencyUsage
const TERMINATION = "ignoreGDL" const TERMINATION = "thresh"
type Result ¶
type Result struct { Time time.Duration `json:"time"` Desc string `json:"desc,omitempty"` TracePath string `json:"tracePath,omitempty"` // for goat TraceSize int `json:"traceSize,omitempty"` // for goat TotalG int `json:"totalg,omitempty"` // for goat TotalCh int `json:"totalch,omitempty"` // for goat StackSize int `json:"stackSize,omitempty"` // for goat EventsLen int `json:"eventsLen,omitempty"` // for goat Detected bool `json:"detected"` // for goat LStack map[uint64]string `json:"lstack,omitempty"` // for goat (will be reconstructed from replay) Coverage1 float64 `json:"coverage1,omitempty"` // for goat (will be reconstructed from replay) Coverage2 float64 `json:"coverage1,omitempty"` // for goat (will be reconstructed from replay) }
Hold results from experimnets
type RootExperiment ¶
type ToolExperiment ¶
type ToolExperiment struct { Experiment ToolID string `json:"toolid"` }
Struct for Tool experiments
func ReadExperimentResults_tool ¶
func ReadExperimentResults_tool(fname string) (tex *ToolExperiment)
func (*ToolExperiment) Execute ¶
func (tex *ToolExperiment) Execute(i int, race bool) *Result
Execute and analyze Tool-experiment
func (*ToolExperiment) Instrument ¶
func (tex *ToolExperiment) Instrument()
Instrument ToolExperiment