cover

package
v0.0.0-...-a1feae0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 19 Imported by: 73

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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 []KernelModule, flagSignal bool) *Canonicalizer

func (*Canonicalizer) NewInstance

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

type CanonicalizerInstance

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

func (*CanonicalizerInstance) Canonicalize

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

func (*CanonicalizerInstance) Decanonicalize

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

func (*CanonicalizerInstance) DecanonicalizeFilter

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

type Convert

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

Contains the current conversion maps used.

type Cover

type Cover map[uint64]struct{}

func FromRaw

func FromRaw(raw []uint64) Cover

func (*Cover) Merge

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

func (*Cover) MergeDiff

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

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

func (Cover) Serialize

func (cov Cover) Serialize() []uint64

type CoverHandlerParams

type CoverHandlerParams struct {
	Progs       []Prog
	CoverFilter map[uint64]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 KernelModule

type KernelModule = backend.KernelModule

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 []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