Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProcessMapNotFound = errors.New("perf-map not found") ErrProcNotFound = errors.New("process not found") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v0.20.0
type Cache[K comparable, V any] interface { Add(K, V) Get(K) (V, bool) Peek(K) (V, bool) Remove(K) }
type DebuginfoManager ¶ added in v0.20.0
type Info ¶ added in v0.20.0
type Info struct { // TODO(kakkoyun): Put all the necessary (following) references in this struct. // - PerfMaps, JITDUMP, etc. // * "/proc/%d/root/tmp/perf-%d.map" or "/proc/%d/root/tmp/perf-%d.dump" for PerfMaps // * "/proc/%d/root/jit-%d.dump" for JITDUMP // - Unwind Information Interpreter *runtime.Interpreter Mappings Mappings // contains filtered or unexported fields }
type InfoManager ¶ added in v0.20.0
type InfoManager struct {
// contains filtered or unexported fields
}
func NewInfoManager ¶ added in v0.20.0
func NewInfoManager( logger log.Logger, tracer trace.Tracer, reg prometheus.Registerer, proceFS procfs.FS, objFilePool *objectfile.Pool, mm *MapManager, dim DebuginfoManager, lm LabelManager, profilingDuration time.Duration, cacheTTL time.Duration, fetchInterpreterInfo bool, ) *InfoManager
func (*InfoManager) Close ¶ added in v0.20.0
func (im *InfoManager) Close() error
type LabelManager ¶ added in v0.20.0
type LabelManager interface { Fetch(ctx context.Context, pid int) error LabelSet(ctx context.Context, pid int) (model.LabelSet, error) }
TODO: Unify PID types.
type MapManager ¶ added in v0.20.0
func NewMapManager ¶ added in v0.20.0
func NewMapManager( reg prometheus.Registerer, fs procfs.FS, objFilePool *objectfile.Pool, ) *MapManager
func (*MapManager) MappingsForPID ¶ added in v0.20.0
func (mm *MapManager) MappingsForPID(pid int) (Mappings, error)
MappingsForPID returns all the mappings for the given PID.
func (*MapManager) NewUserMapping ¶ added in v0.24.0
newUserMapping makes sure the mapped file is open and computes the kernel offset.
type Mapping ¶
type Mapping struct { *procfs.ProcMap // Process related fields. PID int // This will be populated if mappping has executable and symbolizable. // We intentionally do NOT use an ObjectFile here. // So that it could be GCed and closed. // This is needed for pprof conversion. BuildID string IsJitDump bool // This mapping had no path associated with it. Usually this means the // mapping is a JIT compiled section. NoFileMapping bool // contains filtered or unexported fields }
func (*Mapping) AbsolutePath ¶ added in v0.20.0
AbsolutePath returns path relative to the root namespace of the system.
func (*Mapping) ExecutableInfo ¶ added in v0.24.0
func (m *Mapping) ExecutableInfo(addr uint64) (*profilestorepb.ExecutableInfo, error)
Normalize converts the given address to the address relative to the start of the object file.
type Mappings ¶ added in v0.20.0
type Mappings []*Mapping
func (Mappings) ConvertToPprof ¶ added in v0.20.0
func (Mappings) ExecutableSections ¶ added in v0.20.0
func (Mappings) MappingForAddr ¶ added in v0.20.0
MappingForAddr returns the executable mapping that contains the given address.
type Tree ¶ added in v0.13.0
type Tree struct {
// contains filtered or unexported fields
}
func NewTree ¶ added in v0.13.0
NewTree returns a new process tree with current state of all the processes on the system.
func (*Tree) FindAllAncestorProcessIDsInSameCgroup ¶ added in v0.13.0
FindAllAncestorProcessIDsInSameCgroup returns all ancestor process IDs for a given PID in the same cgroup.
Click to show internal directories.
Click to hide internal directories.