Documentation
¶
Index ¶
- Variables
- type ExecutableInfo
- type ExecutableInfoManager
- func (mgr *ExecutableInfoManager) AddOrIncRef(fileID host.FileID, elfRef *pfelf.Reference) (ExecutableInfo, error)
- func (mgr *ExecutableInfoManager) AddSynthIntervalData(fileID host.FileID, data sdtypes.IntervalData) error
- func (mgr *ExecutableInfoManager) NumInterpreterLoaders() int
- func (mgr *ExecutableInfoManager) RemoveOrDecRef(fileID host.FileID) error
- func (mgr *ExecutableInfoManager) UpdateMetricSummary(summary metrics.Summary)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDeferredFileID indicates that handling of stack deltas for a file ID failed // and should only be tried again at a later point. ErrDeferredFileID = errors.New("deferred FileID") )
Functions ¶
This section is empty.
Types ¶
type ExecutableInfo ¶
type ExecutableInfo struct { // Data stores per-executable interpreter information if the file ID that this // instance belongs to was previously identified as an interpreter. Otherwise, // this field is nil. Data interpreter.Data // TSDInfo stores TSD information if the executable is libc, otherwise nil. TSDInfo *tpbase.TSDInfo }
ExecutableInfo stores information about an executable (ELF file).
type ExecutableInfoManager ¶
type ExecutableInfoManager struct {
// contains filtered or unexported fields
}
ExecutableInfoManager manages all per-executable (FileID) information that we require to perform our native and interpreter unwinding. Executable information is de-duplicated between processes and is kept around as long as there is at least one process that is known to have the corresponding FileID loaded (reference counting). Tracking loaded executables is left to the caller.
The manager is synchronized internally and all public methods can be called from an arbitrary number of threads simultaneously.
The manager is responsible for managing entries in the following BPF maps:
- stack_delta_page_to_info - exe_id_to_%d_stack_deltas - unwind_info_array - interpreter_offsets
All of these maps can be read by anyone, but are written to exclusively by this manager.
func NewExecutableInfoManager ¶
func NewExecutableInfoManager( sdp nativeunwind.StackDeltaProvider, ebpf pmebpf.EbpfHandler, includeTracers types.IncludedTracers, ) (*ExecutableInfoManager, error)
NewExecutableInfoManager creates a new instance of the executable info manager.
func (*ExecutableInfoManager) AddOrIncRef ¶
func (mgr *ExecutableInfoManager) AddOrIncRef(fileID host.FileID, elfRef *pfelf.Reference) (ExecutableInfo, error)
AddOrIncRef either adds information about an executable to the internal cache (when first encountering it) or increments the reference count if the executable is already known.
The return value is copied instead of returning a pointer in order to spare us the use of getters and more complicated locking semantics.
func (*ExecutableInfoManager) AddSynthIntervalData ¶
func (mgr *ExecutableInfoManager) AddSynthIntervalData( fileID host.FileID, data sdtypes.IntervalData, ) error
AddSynthIntervalData should only be called once for a given file ID. It will error if it or AddOrIncRef has been previously called for the same file ID. Interpreter detection is skipped.
func (*ExecutableInfoManager) NumInterpreterLoaders ¶
func (mgr *ExecutableInfoManager) NumInterpreterLoaders() int
NumInterpreterLoaders returns the number of interpreter loaders that are enabled.
func (*ExecutableInfoManager) RemoveOrDecRef ¶
func (mgr *ExecutableInfoManager) RemoveOrDecRef(fileID host.FileID) error
RemoveOrDecRef decrements the reference counter of the executable being tracked. Once the RC reaches zero, information about the file is removed from the manager and the corresponding BPF maps.
func (*ExecutableInfoManager) UpdateMetricSummary ¶
func (mgr *ExecutableInfoManager) UpdateMetricSummary(summary metrics.Summary)
UpdateMetricSummary updates the metrics in the given metric map.