kernel

package
v0.0.0-...-94f4200 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Builds = map[string]Kernel{

	"4.9.0": {
		Version: "4.9.0",
		URL:     "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.tar.xz",
		Params:  params["MarkNFTNat"],
		Probes:  kprobes["acct_v1"],
	},

	"4.9.63": {
		Version: "4.9.63",
		URL:     "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.63.tar.xz",
		Params:  params["MarkNFTNat"],
		Probes:  kprobes["acct_v1"],
	},

	"4.13.0": {
		Version: "4.13.16",
		URL:     "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.13.16.tar.xz",
		Params:  params["MarkNFTNat"],
		Probes:  kprobes["acct_v1"],
	},

	"4.14.0": {
		Version: "4.14.177",
		URL:     "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.177.tar.xz",
		Params:  params["MarkNFTNat"],
		Probes:  kprobes["acct_v1"],
	},

	"4.17.0": {
		Version: "4.17.9",
		URL:     "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.9.tar.xz",
		Params:  params["MarkNFTNat"],
		Probes:  kprobes["acct_v1"],
	},

	"5.3.0": {
		Version: "5.3.14",
		URL:     "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.3.14.tar.xz",
		Params:  params["MarkNFTNat"],
		Probes:  kprobes["acct_v1"],
	},

	"5.5.0": {
		Version: "5.5.10",
		URL:     "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.5.10.tar.xz",
		Params:  params["MarkNFTNat"],
		Probes:  kprobes["acct_v1"],
	},
}

Builds is a list of Kernels that can be built against. We try to stick to one version per minor release. (eg 4.9.x)

Whenever a breaking change is made to any of the structures the bpf program references, this map needs to be updated with the version it's introduced in.

Functions

This section is empty.

Types

type Kernel

type Kernel struct {
	Version string
	URL     string
	Params  Params
	Probes  Probes
}

Kernel represents a kernel object.

func (Kernel) ArchiveName

func (k Kernel) ArchiveName() string

ArchiveName returns the file name of the archive based on its URL.

func (Kernel) ArchivePath

func (k Kernel) ArchivePath() string

ArchivePath returns the path of the archive on disk.

func (Kernel) Configure

func (k Kernel) Configure(params Params) error

Configure configures and prepares the kernel with the requested settings. If params is nil, the parameters defined on the Kernel will be used.

func (Kernel) Directory

func (k Kernel) Directory() string

Directory returns the path on disk where the kernel is extracted.

func (Kernel) Fetch

func (k Kernel) Fetch() error

Fetch ensures that a given kernel is downloaded and extracted to the temp directory.

func (Kernel) Name

func (k Kernel) Name() string

Name returns the name (plain version) of the kernel based on the name of the archive.

type Params

type Params map[string]string

Params is a map of kernel parameters.

type Probe

type Probe struct {
	Kind string
	Name string
}

Probe holds the name and kind of a kprobe/kretprobe.

func (Probe) ProgramName

func (p Probe) ProgramName() string

ProgramName returns the Probe's program (function) name following the BCC convention: <kind>__<ksym_name>, eg. kprobe__nf_conntrack_free.

type Probes

type Probes []Probe

Probes is a list of kprobe/kretprobe entries present in the BPF program.

Jump to

Keyboard shortcuts

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