cover

package
v0.0.0-...-68da6d9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 27 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 DoHeatMapStyleBodyJS

func DoHeatMapStyleBodyJS(ctx context.Context, projectID, ns, subsystem string, periods []coveragedb.TimePeriod,
) (template.CSS, template.HTML, template.HTML, error)

func DoSubsystemsHeatMapStyleBodyJS

func DoSubsystemsHeatMapStyleBodyJS(ctx context.Context, projectID, ns, subsystem string,
	periods []coveragedb.TimePeriod) (template.CSS, template.HTML, template.HTML, error)

func GetMergeResult

func GetMergeResult(c context.Context, ns, repo, forCommit, sourceCommit, filePath string,
	proxy covermerger.FuncProxyURI, tp coveragedb.TimePeriod) (*covermerger.MergeResult, error)

func GetPCBase

func GetPCBase(cfg *mgrconfig.Config) (uint64, error)

func RendFileCoverage

func RendFileCoverage(repo, forCommit, filePath string, proxy covermerger.FuncProxyURI,
	mr *covermerger.MergeResult, renderConfig *CoverageRenderConfig) (string, error)

func RendHTMLLine

func RendHTMLLine(code string, line int, coverage *covermerger.MergeResult, config *CoverageRenderConfig) string

func RendTextLine

func RendTextLine(code string, line int, coverage *covermerger.MergeResult, config *CoverageRenderConfig) string

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

func (*Canonicalizer) NewInstance

func (can *Canonicalizer) NewInstance(modules []*vminfo.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

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 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 CoverageRenderConfig

type CoverageRenderConfig struct {
	RendLine                  lineRender
	ShowLineCoverage          bool
	ShowLineNumbers           bool
	ShowLineSourceExplanation bool
}

func DefaultHTMLRenderConfig

func DefaultHTMLRenderConfig() *CoverageRenderConfig

func DefaultTextRenderConfig

func DefaultTextRenderConfig() *CoverageRenderConfig

type HandlerParams

type HandlerParams struct {
	Progs  []Prog
	Filter map[uint64]struct{}
	Debug  bool
	Force  bool
}

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 []*vminfo.KernelModule, rawCover bool) (*ReportGenerator, error)

func (*ReportGenerator) DoCoverJSONL

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

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

func (*ReportGenerator) DoFileCover

func (rg *ReportGenerator) DoFileCover(w io.Writer, params HandlerParams) error

func (*ReportGenerator) DoFilterPCs

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

func (*ReportGenerator) DoFuncCover

func (rg *ReportGenerator) DoFuncCover(w io.Writer, params HandlerParams) error

func (*ReportGenerator) DoHTML

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

func (*ReportGenerator) DoLineJSON

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

func (*ReportGenerator) DoModuleCover

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

func (*ReportGenerator) DoRawCover

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

func (*ReportGenerator) DoRawCoverFiles

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

func (*ReportGenerator) DoSubsystemCover

func (rg *ReportGenerator) DoSubsystemCover(w io.Writer, params HandlerParams) error

type StyleBodyJS

type StyleBodyJS struct {
	Style template.CSS
	Body  template.HTML
	JS    template.HTML
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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