Documentation
¶
Index ¶
- Constants
- func Bugtool(outFname string, bpftool string, gops string, maxRecvSize int, ...) error
- func FindAllMaps() ([]bpf.ExtendedMapInfo, error)
- func FindCgroupMountPath(unified bool, controller string) (string, error)
- func FindMapsUsedByPinnedProgs(path string) ([]bpf.ExtendedMapInfo, error)
- func FindMemoryCgroupPath() (unified bool, memoryCgroupPath string, err error)
- func FindPinnedMaps(path string) ([]bpf.ExtendedMapInfo, error)
- func LoadExtraFiles() (map[string]string, error)
- func SaveExtraFiles(files map[string]string) error
- func SaveInitInfo(info *InitInfo) error
- func TotalMemlockBytes(infos []bpf.ExtendedMapInfo) int
- type AggregatedMap
- type CommandAction
- type Commander
- type DiffMap
- type GRPCAction
- type GRPCer
- type InitInfo
- type MapsChecksOutput
- type MultiLog
- func (ml *MultiLog) Info(msg string, args ...any)
- func (ml *MultiLog) Infof(format string, args ...any)
- func (ml *MultiLog) Warn(msg string, args ...any)
- func (ml *MultiLog) Warnf(format string, args ...any)
- func (ml *MultiLog) WithError(err error) *MultiLogEntry
- func (ml *MultiLog) WithField(key string, value any) *MultiLogEntry
- type MultiLogEntry
- func (mle *MultiLogEntry) Info(msg string, args ...any)
- func (mle *MultiLogEntry) Infof(format string, args ...any)
- func (mle *MultiLogEntry) Warn(msg string, args ...any)
- func (mle *MultiLogEntry) Warnf(format string, args ...any)
- func (mle *MultiLogEntry) WithError(err error) *MultiLogEntry
- func (mle *MultiLogEntry) WithField(key string, value any) *MultiLogEntry
Constants ¶
const TetragonBPFFS = "/sys/fs/bpf/tetragon"
Variables ¶
This section is empty.
Functions ¶
func Bugtool ¶
func Bugtool(outFname string, bpftool string, gops string, maxRecvSize int, commandActions []CommandAction, grpcActions []GRPCAction) error
Bugtool gathers information and writes it as a tar archive in the given filename. Additional command or grpc calls can be enqueued through last 2 params.
func FindAllMaps ¶ added in v1.2.1
func FindAllMaps() ([]bpf.ExtendedMapInfo, error)
FindAllMaps iterates over all maps loaded on the host using MapGetNextID and parses fdinfo to look for memlock.
func FindCgroupMountPath ¶ added in v1.2.1
func FindMapsUsedByPinnedProgs ¶ added in v1.2.1
func FindMapsUsedByPinnedProgs(path string) ([]bpf.ExtendedMapInfo, error)
FindMapsUsedByPinnedProgs returns all info of maps used by the prog pinned under the path specified as argument. It also retrieve all the maps referenced in progs referenced in program array maps (tail calls).
func FindMemoryCgroupPath ¶ added in v1.2.1
func FindPinnedMaps ¶ added in v1.2.1
func FindPinnedMaps(path string) ([]bpf.ExtendedMapInfo, error)
FindPinnedMaps returns all info of maps pinned under the path specified as argument.
func LoadExtraFiles ¶ added in v1.7.0
LoadExtraFiles reads the map of extra files previously written by SaveExtraFiles. Returns nil (not an error) if the file does not exist, since not all deployments produce extra files.
func SaveExtraFiles ¶ added in v1.7.0
SaveExtraFiles writes a map of extra files (name -> path) to the bugtool extra files JSON file. The daemon calls this at startup so the CLI can discover additional files at bugtool time, even if the daemon has crashed.
func SaveInitInfo ¶
SaveInitInfo saves InitInfo to the info file
func TotalMemlockBytes ¶ added in v1.2.1
func TotalMemlockBytes(infos []bpf.ExtendedMapInfo) int
TotalMemlockBytes iterates over the extend map info and sums the memlock field.
Types ¶
type AggregatedMap ¶ added in v1.2.1
type AggregatedMap struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
KeySize int `json:"key_size,omitempty"`
ValueSize int `json:"value_size,omitempty"`
MaxEntries int `json:"max_entries,omitempty"`
Count int `json:"count,omitempty"`
TotalMemlockBytes int `json:"total_memlock_bytes,omitempty"`
PercentOfTotal float64 `json:"percent_of_total,omitempty"`
}
type CommandAction ¶ added in v1.6.0
type DiffMap ¶ added in v1.2.1
type DiffMap struct {
ID int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
KeySize int `json:"key_size,omitempty"`
ValueSize int `json:"value_size,omitempty"`
MaxEntries int `json:"max_entries,omitempty"`
MemlockBytes int `json:"memlock_bytes,omitempty"`
}
type GRPCAction ¶ added in v1.6.0
type InitInfo ¶
type InitInfo struct {
ExportFname string `json:"export_fname"`
LibDir string `json:"lib_dir"`
BTFFname string `json:"btf_fname"`
ServerAddr string `json:"server_address"`
MetricsAddr string `json:"metrics_address"`
GopsAddr string `json:"gops_address"`
MapDir string `json:"map_dir"`
BpfToolPath string `json:"bpftool_path"`
GopsPath string `json:"gops_path"`
MaxRecvSize int `json:"max_recv_size"`
PID int `json:"pid"`
}
InitInfo contains information about how Tetragon was initialized.
func LoadInitInfo ¶
LoadInitInfo returns the InitInfo by reading the info file from its default location
type MapsChecksOutput ¶ added in v1.2.1
type MapsChecksOutput struct {
TotalMemlockBytes struct {
AllMaps int `json:"all_maps,omitempty"`
PinnedProgsMaps int `json:"pinned_progs_maps,omitempty"`
PinnedMaps int `json:"pinned_maps,omitempty"`
} `json:"total_memlock_bytes"`
MapsStats struct {
PinnedProgsMaps int `json:"pinned_progs_maps,omitempty"`
PinnedMaps int `json:"pinned_maps,omitempty"`
Inter int `json:"inter,omitempty"`
Exter int `json:"exter,omitempty"`
Union int `json:"union,omitempty"`
Diff int `json:"diff,omitempty"`
} `json:"maps_stats"`
DiffMaps []DiffMap `json:"diff_maps,omitempty"`
AggregatedMaps []AggregatedMap `json:"aggregated_maps,omitempty"`
}
func RunMapsChecks ¶ added in v1.2.1
func RunMapsChecks(path string) (*MapsChecksOutput, error)
type MultiLog ¶
type MultiLog struct {
Logs []logger.FieldLogger
}
MultiLog maintains multiple loggers
func (*MultiLog) WithError ¶
func (ml *MultiLog) WithError(err error) *MultiLogEntry
WithError adds err as a single field (using ErrorKey)
type MultiLogEntry ¶
type MultiLogEntry struct {
Entries []logger.FieldLogger
}
MultiLogEntry maintains entries generated using a MultiLog
func (*MultiLogEntry) Info ¶
func (mle *MultiLogEntry) Info(msg string, args ...any)
Info logs at the Info level
func (*MultiLogEntry) Infof ¶
func (mle *MultiLogEntry) Infof(format string, args ...any)
func (*MultiLogEntry) Warn ¶
func (mle *MultiLogEntry) Warn(msg string, args ...any)
Warn logs at the Warning level
func (*MultiLogEntry) Warnf ¶
func (mle *MultiLogEntry) Warnf(format string, args ...any)
func (*MultiLogEntry) WithError ¶
func (mle *MultiLogEntry) WithError(err error) *MultiLogEntry
WithError adds err as a single field (using ErrorKey)
func (*MultiLogEntry) WithField ¶
func (mle *MultiLogEntry) WithField(key string, value any) *MultiLogEntry
WithField creates a new entry by adding a field to an existing one