Documentation ¶
Index ¶
- Constants
- Variables
- func FindBTFFileWithPath(path string) (string, error)
- func GetAddrStr(proto uint16, addr [16]byte) string
- func GetBtfFile() (string, error)
- func GetCommString(comm [20]int8) string
- func GetHumanTimes(ns uint64) string
- func GetProtoStr(proto uint8) string
- func GetSkcStateStr(state uint8) string
- func GetSymsStrByStack(stack uint32, stackmap *ebpf.Map) ([]string, error)
- func GetTCPState(_ uint8) string
- func IsMounted() (bool, error)
- func IsMountedAt(mountpoint string) (bool, error)
- func KernelArch() (string, error)
- func KernelRelease() (string, error)
- func LoadBTFFromFile(file string) (*btf.Spec, error)
- func LoadBTFSpecOrNil() *btf.Spec
- func Mount() error
- func MountAt(mountpoint string) error
- func MustLoadPin(name string) (*ebpf.Map, error)
- func MustPin(m *ebpf.Map, name string) error
- type KernelSymbol
Constants ¶
View Source
const BPFFSPath = "/sys/fs/bpf"
View Source
const (
BTFPATH = "/etc/net-exporter/"
)
Variables ¶
View Source
var ( FsMagicBPFFS int32 INSP_PINNED_PATH = fmt.Sprintf("%s/inspector", BPFFSPath) // nolint )
Functions ¶
func FindBTFFileWithPath ¶ added in v0.1.1
func GetAddrStr ¶
GetAddrStr get string format ip address,default in ipv4
func GetBtfFile ¶
func GetCommString ¶
func GetHumanTimes ¶
func GetSkcStateStr ¶
enum { TCP_ESTABLISHED = 1, TCP_SYN_SENT, TCP_SYN_RECV, TCP_FIN_WAIT1, TCP_FIN_WAIT2, TCP_TIME_WAIT, TCP_CLOSE, TCP_CLOSE_WAIT, TCP_LAST_ACK, TCP_LISTEN, TCP_CLOSING, TCP_NEW_SYN_RECV, TCP_MAX_STATES };
func GetTCPState ¶
func IsMountedAt ¶
IsMountedAt checks if the BPF fs is mounted already in the custom location
func KernelArch ¶ added in v0.1.1
func KernelRelease ¶
func LoadBTFSpecOrNil ¶
LoadBTFSpecOrNil once error occurs in load process, return nil and use system raw spec instead
func Mount ¶
func Mount() error
Mount mounts the BPF fs in the default location (if not already mounted)
Types ¶
type KernelSymbol ¶
type KernelSymbol struct {
// contains filtered or unexported fields
}
func GetSymByPt ¶
func GetSymByPt(addr string) (*KernelSymbol, error)
func GetSymPtFromBpfLocation ¶
func GetSymPtFromBpfLocation(pt uint64) (*KernelSymbol, error)
GetSymPtFromBpfLocation return symbol struct/offset/error with bpf location
func GetSymsByStack ¶
func GetSymsByStack(stack uint32, stackmap *ebpf.Map) ([]KernelSymbol, error)
func (*KernelSymbol) GetAddr ¶
func (k *KernelSymbol) GetAddr() uint64
func (*KernelSymbol) GetExpr ¶
func (k *KernelSymbol) GetExpr() string
func (*KernelSymbol) GetName ¶
func (k *KernelSymbol) GetName() string
Click to show internal directories.
Click to hide internal directories.