common

package module
v0.0.0-...-5ed5c24 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 14 Imported by: 31

Documentation

Index

Constants

View Source
const (
	AF_INET  = 2
	AF_INET6 = 10

	SOCK_STREAM = 1
	SOCK_DGRAM  = 2

	IPPROTO_TCP = 6
	IPPROTO_UDP = 17
)
View Source
const (
	EXEC = iota
	DYN
	PERF_MAP
	VDSO
	UNKNOWN
)
View Source
const REQ_BACKGROUND = 1 << __REQ_BACKGROUND
View Source
const REQ_CGROUP_PUNT = 1 << __REQ_CGROUP_PUNT
View Source
const REQ_DRV = 1 << __REQ_DRV
View Source
const REQ_FAILFAST_DEV = 1 << __REQ_FAILFAST_DEV
View Source
const REQ_FAILFAST_DRIVER = 1 << __REQ_FAILFAST_DRIVER
View Source
const REQ_FAILFAST_TRANSPORT = 1 << __REQ_FAILFAST_TRANSPORT
View Source
const REQ_FLAG_BITS = 24
View Source
const REQ_FUA = 1 << __REQ_FUA
View Source
const REQ_HIPRI = 1 << __REQ_HIPRI
View Source
const REQ_IDLE = 1 << __REQ_IDLE
View Source
const REQ_INTEGRITY = 1 << __REQ_INTEGRITY
View Source
const REQ_META = 1 << __REQ_META
View Source
const REQ_NOMERGE = 1 << __REQ_NOMERGE
View Source
const REQ_NOMERGE_FLAGS = REQ_NOMERGE | REQ_PREFLUSH | REQ_FUA
View Source
const REQ_NOUNMAP = 1 << __REQ_NOUNMAP
View Source
const REQ_NOWAIT = 1 << __REQ_NOWAIT
View Source
const REQ_NOWAIT_INLINE = 1 << __REQ_NOWAIT_INLINE
View Source
const REQ_OP_BITS = 8
View Source
const REQ_OP_DISCARD = 3

discard sectors

View Source
const REQ_OP_DRV_IN = 34

Driver private requests

View Source
const REQ_OP_DRV_OUT = 35
View Source
const REQ_OP_FLUSH = 2

flush the volatile write cache

View Source
const REQ_OP_LAST = 36
View Source
const REQ_OP_MASK = ((1 << REQ_OP_BITS) - 1)
View Source
const REQ_OP_READ = 0

read sectors from the device

View Source
const REQ_OP_SCSI_IN = 32

SCSI passthrough using struct scsi_request

View Source
const REQ_OP_SCSI_OUT = 33
View Source
const REQ_OP_SECURE_ERASE = 5

securely erase sectors

View Source
const REQ_OP_WRITE = 1

write sectors to the device

View Source
const REQ_OP_WRITE_SAME = 7

write the same sector many times

View Source
const REQ_OP_WRITE_ZEROES = 9

write the zero filled sector many times

View Source
const REQ_OP_ZONE_CLOSE = 11

Close a zone

View Source
const REQ_OP_ZONE_FINISH = 12

Transition a zone to full

View Source
const REQ_OP_ZONE_OPEN = 10

Open a zone

View Source
const REQ_OP_ZONE_RESET = 6

reset a zone write pointer

View Source
const REQ_OP_ZONE_RESET_ALL = 8

reset all the zone present on the device

View Source
const REQ_PREFLUSH = 1 << __REQ_PREFLUSH
View Source
const REQ_PRIO = 1 << __REQ_PRIO
View Source
const REQ_RAHEAD = 1 << __REQ_RAHEAD
View Source
const REQ_SWAP = 1 << __REQ_SWAP
View Source
const REQ_SYNC = 1 << __REQ_SYNC

Variables

This section is empty.

Functions

func AddrFrom16

func AddrFrom16(family uint16, addr [16]byte) netip.Addr

func Contains

func Contains(items []string, s string) bool

func DumpHash

func DumpHash(bpfMap *bpf.BPFMap) ([][2][]byte, error)

func DumpThenClearHash

func DumpThenClearHash(bpfMap *bpf.BPFMap) ([][2][]byte, error)

func GetCgroupDirFD

func GetCgroupDirFD(cgroupV2DirPath string) (int, error)

func GetErrName

func GetErrName(err syscall.Errno) string

func GoPath

func GoPath(v []byte) string

func GoString

func GoString(v []byte) string

func Htons

func Htons(i uint16) uint16

func InetAton

func InetAton(ip string) (uint32, error)

func InetNtoa

func InetNtoa(ip uint32) string

func Ntohs

func Ntohs(i uint16) uint16

func PrintLinearHist

func PrintLinearHist(vals []int, base, step int, valType string)

func PrintLog2Hist

func PrintLog2Hist(vals []int, valType string)

func SyscallName

func SyscallName(n int) string

Types

type Dso

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

type Ksym

type Ksym struct {
	Name string
	Addr uint64
}

type Ksyms

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

func LoadKsyms

func LoadKsyms() (*Ksyms, error)

func (*Ksyms) GetSymbol

func (k *Ksyms) GetSymbol(name string) *Ksym

func (*Ksyms) MapAddr

func (k *Ksyms) MapAddr(addr uint64) *Ksym

type LoadRange

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

type Partition

type Partition struct {
	Name string
	Dev  int
}

type Partitions

type Partitions struct {
	Items []Partition
	Sz    int
}

func LoadPartitions

func LoadPartitions() (*Partitions, error)

func (Partitions) GetByDev

func (p Partitions) GetByDev(dev int) *Partition

func (Partitions) GetByName

func (p Partitions) GetByName(name string) *Partition

type Sym

type Sym struct {
	Name string
	// contains filtered or unexported fields
}

type Syms

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

func (*Syms) MapAddr

func (s *Syms) MapAddr(addr uint64) *Sym

type SymsCache

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

func NewSymsCache

func NewSymsCache() *SymsCache

func (*SymsCache) GetSyms

func (s *SymsCache) GetSyms(tgid int) (*Syms, error)

type SymsCacheData

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

type Uint128

type Uint128 [16]byte

Jump to

Keyboard shortcuts

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