cover

package
v0.0.0-...-af24b05 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 68

Documentation

Overview

Package cover provides types for working with coverage information (arrays of covered PCs).

Index

Constants

This section is empty.

Variables

View Source
var RestorePC = backend.RestorePC

Functions

func WriteCIJSONLine

func WriteCIJSONLine(w io.Writer, managerCover CoverageInfo, ciDetails CIDetails) error

Types

type CIDetails

type CIDetails struct {
	Version        int    `json:"version"`
	Timestamp      string `json:"timestamp"`
	FuzzingMinutes int    `json:"fuzzing_minutes"`
	Arch           string `json:"arch"`
	BuildID        string `json:"build_id"`
	Manager        string `json:"manager"`
	KernelRepo     string `json:"kernel_repo"`
	KernelBranch   string `json:"kernel_branch"`
	KernelCommit   string `json:"kernel_commit"`
}

CIDetails fields will be added to every CSV line.

type Canonicalizer

type Canonicalizer struct {
	// contains filtered or unexported fields
}

func NewCanonicalizer

func NewCanonicalizer(modules []host.KernelModule, flagSignal bool) *Canonicalizer

func (*Canonicalizer) NewInstance

func (can *Canonicalizer) NewInstance(modules []host.KernelModule) *CanonicalizerInstance

type CanonicalizerInstance

type CanonicalizerInstance struct {
	// contains filtered or unexported fields
}

func (*CanonicalizerInstance) Canonicalize

func (ci *CanonicalizerInstance) Canonicalize(elems []uint32) []uint32

func (*CanonicalizerInstance) Decanonicalize

func (ci *CanonicalizerInstance) Decanonicalize(elems []uint32) []uint32

func (*CanonicalizerInstance) DecanonicalizeFilter

func (ci *CanonicalizerInstance) DecanonicalizeFilter(bitmap map[uint32]uint32) map[uint32]uint32

type Convert

type Convert struct {
	// contains filtered or unexported fields
}

Contains the current conversion maps used.

type Cover

type Cover map[uint32]struct{}

func (*Cover) Merge

func (cov *Cover) Merge(raw []uint32)

func (*Cover) MergeDiff

func (cov *Cover) MergeDiff(raw []uint32) []uint32

Merge merges raw into coverage and returns newly added PCs. Overwrites/mutates raw.

func (Cover) Serialize

func (cov Cover) Serialize() []uint32

type CoverHandlerParams

type CoverHandlerParams struct {
	Progs       []Prog
	CoverFilter map[uint32]uint32
	Debug       bool
	Force       bool
}

type CoverageInfo

type CoverageInfo struct {
	FilePath  string `json:"file_path"`
	FuncName  string `json:"func_name"`
	StartLine int    `json:"sl"`
	StartCol  int    `json:"sc"`
	EndLine   int    `json:"el"`
	EndCol    int    `json:"ec"`
	HitCount  int    `json:"hit_count"`
	Inline    bool   `json:"inline"`
	PC        uint64 `json:"pc"`
}

type Prog

type Prog struct {
	Sig  string
	Data string
	PCs  []uint64
}

type ReportGenerator

type ReportGenerator struct {
	*backend.Impl
	// contains filtered or unexported fields
}

func MakeReportGenerator

func MakeReportGenerator(cfg *mgrconfig.Config, subsystem []mgrconfig.Subsystem,
	modules []host.KernelModule, rawCover bool) (*ReportGenerator, error)

func (*ReportGenerator) DoCSV

func (rg *ReportGenerator) DoCSV(w io.Writer, params CoverHandlerParams) error

func (*ReportGenerator) DoCSVFiles

func (rg *ReportGenerator) DoCSVFiles(w io.Writer, params CoverHandlerParams) error

func (*ReportGenerator) DoCoverJSONL

func (rg *ReportGenerator) DoCoverJSONL(w io.Writer, params CoverHandlerParams) error

DoCoverJSONL is a handler for "/cover?jsonl=1".

func (*ReportGenerator) DoFilterPCs

func (rg *ReportGenerator) DoFilterPCs(w io.Writer, params CoverHandlerParams) error

func (*ReportGenerator) DoHTML

func (rg *ReportGenerator) DoHTML(w io.Writer, params CoverHandlerParams) error

func (*ReportGenerator) DoHTMLTable

func (rg *ReportGenerator) DoHTMLTable(w io.Writer, params CoverHandlerParams) error

func (*ReportGenerator) DoLineJSON

func (rg *ReportGenerator) DoLineJSON(w io.Writer, params CoverHandlerParams) error

func (*ReportGenerator) DoModuleCover

func (rg *ReportGenerator) DoModuleCover(w io.Writer, params CoverHandlerParams) error

func (*ReportGenerator) DoRawCover

func (rg *ReportGenerator) DoRawCover(w io.Writer, params CoverHandlerParams) error

func (*ReportGenerator) DoRawCoverFiles

func (rg *ReportGenerator) DoRawCoverFiles(w io.Writer, params CoverHandlerParams) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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