job

package
v0.0.0-...-13344a5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBTF

func GenerateBTF(ctx context.Context, vmlinux string, out string) error

GenerateBTF generates a BTF file from a vmlinux file

func StartWorker

func StartWorker(ctx context.Context, jobchan <-chan Job) error

Types

type BTFGenerationJob

type BTFGenerationJob struct {
	VmlinuxPath string
	BTFPath     string
	BTFTarPath  string
}

func (*BTFGenerationJob) Do

func (job *BTFGenerationJob) Do(ctx context.Context) error

Do implements the Job interface, and is called by the worker. It generates a BTF file from a vmlinux file, compresses it into a .tar.xz file, and removes the vmlinux file.

func (*BTFGenerationJob) Reply

func (job *BTFGenerationJob) Reply() chan<- interface{}

type Job

type Job interface {
	Do(context.Context) error
	Reply() chan<- interface{}
}

type KernelExtractionJob

type KernelExtractionJob struct {
	Pkg       pkg.Package
	WorkDir   string
	ReplyChan chan interface{}
	Force     bool
}

func (*KernelExtractionJob) Do

Do implements the Job interface, and is called by the worker. It downloads the kernel package, extracts the vmlinux file, and replies with the path to the vmlinux file in the reply channel.

func (*KernelExtractionJob) Reply

func (job *KernelExtractionJob) Reply() chan<- interface{}

Jump to

Keyboard shortcuts

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