Documentation ¶
Index ¶
- Constants
- func Bugtool(outFname string, bpftool string, gops string) 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 SaveInitInfo(info *InitInfo) error
- func TotalMemlockBytes(infos []bpf.ExtendedMapInfo) int
- type AggregatedMap
- type DiffMap
- type InitInfo
- type MapsChecksOutput
- type MultiLog
- func (ml *MultiLog) Info(args ...interface{})
- func (ml *MultiLog) Infof(format string, args ...interface{})
- func (ml *MultiLog) Warn(args ...interface{})
- func (ml *MultiLog) Warnf(format string, args ...interface{})
- func (ml *MultiLog) WithError(err error) *MultiLogEntry
- func (ml *MultiLog) WithField(key string, value interface{}) *MultiLogEntry
- type MultiLogEntry
- func (mle *MultiLogEntry) Info(args ...interface{})
- func (mle *MultiLogEntry) Infof(format string, args ...interface{})
- func (mle *MultiLogEntry) Warn(args ...interface{})
- func (mle *MultiLogEntry) Warnf(format string, args ...interface{})
- func (mle *MultiLogEntry) WithError(err error) *MultiLogEntry
- func (mle *MultiLogEntry) WithField(key string, value interface{}) *MultiLogEntry
Constants ¶
const TetragonBPFFS = "/sys/fs/bpf/tetragon"
Variables ¶
This section is empty.
Functions ¶
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 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 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 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"` 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,omitempty"` 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,omitempty"` 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 []logrus.FieldLogger
}
MultiLog maintains multiple loggers
func (*MultiLog) WithError ¶
func (ml *MultiLog) WithError(err error) *MultiLogEntry
WithError adds err as a single field (using ErrorKey)
func (*MultiLog) WithField ¶
func (ml *MultiLog) WithField(key string, value interface{}) *MultiLogEntry
WithField creates a new entry and adds a field to it.
type MultiLogEntry ¶
MultiLogEntry maintains entries generated using a MultiLog
func (*MultiLogEntry) Info ¶
func (mle *MultiLogEntry) Info(args ...interface{})
Info logs at the Info level
func (*MultiLogEntry) Infof ¶
func (mle *MultiLogEntry) Infof(format string, args ...interface{})
func (*MultiLogEntry) Warn ¶
func (mle *MultiLogEntry) Warn(args ...interface{})
Warn logs at the Warning level
func (*MultiLogEntry) Warnf ¶
func (mle *MultiLogEntry) Warnf(format string, args ...interface{})
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 interface{}) *MultiLogEntry
WithField creates a new entry by adding a field to an existing one