Documentation ¶
Index ¶
- Variables
- type CacheOptions
- type ElfCache
- func (e *ElfCache) CacheByBuildID(buildID elf.BuildID, v SymbolNameResolver)
- func (e *ElfCache) CacheByStat(s Stat, v SymbolNameResolver)
- func (e *ElfCache) Cleanup()
- func (e *ElfCache) DebugInfo() ElfCacheDebugInfo
- func (e *ElfCache) GetSymbolsByBuildID(buildID elf.BuildID) SymbolNameResolver
- func (e *ElfCache) GetSymbolsByStat(s Stat) SymbolNameResolver
- func (e *ElfCache) NextRound()
- func (e *ElfCache) Update(buildIDCacheOptions GCacheOptions, sameFileCacheOptions GCacheOptions)
- type ElfCacheDebugInfo
- type ElfDebugInfo
- type ElfTable
- type ElfTableOptions
- type GCache
- func (g *GCache[K, V]) Cache(k K, v V)
- func (g *GCache[K, V]) Cleanup()
- func (g *GCache[K, V]) Each(f func(k K, v V, round int))
- func (g *GCache[K, V]) EachLRU(f func(k K, v V, round int))
- func (g *GCache[K, V]) EachRound(f func(k K, v V, round int))
- func (g *GCache[K, V]) Get(k K) V
- func (g *GCache[K, V]) LRUSize() int
- func (g *GCache[K, V]) NextRound()
- func (g *GCache[K, V]) Remove(k K)
- func (g *GCache[K, V]) RoundSize() int
- func (g *GCache[K, V]) Update(options GCacheOptions)
- type GCacheDebugInfo
- type GCacheOptions
- type PidKey
- type ProcMap
- type ProcMapPermissions
- type ProcMaps
- type ProcTable
- type ProcTableDebugInfo
- type ProcTableOptions
- type Resource
- type Stat
- type Sym
- type SymTab
- type Symbol
- type SymbolCache
- func (sc *SymbolCache) Cleanup()
- func (sc *SymbolCache) ElfCacheDebugInfo() ElfCacheDebugInfo
- func (sc *SymbolCache) GetKallsyms() SymbolTable
- func (sc *SymbolCache) GetProcTableCached(pid PidKey) *ProcTable
- func (sc *SymbolCache) NewProcTable(pid PidKey, symbolOptions *SymbolOptions) *ProcTable
- func (sc *SymbolCache) NextRound()
- func (sc *SymbolCache) PidCacheDebugInfo() GCacheDebugInfo[ProcTableDebugInfo]
- func (sc *SymbolCache) RemoveDeadPID(pid PidKey)
- func (sc *SymbolCache) UpdateOptions(options CacheOptions)
- type SymbolNameResolver
- type SymbolOptions
- type SymbolTab
- type SymbolTable
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSymbolOptions = &SymbolOptions{ GoTableFallback: false, }
Functions ¶
This section is empty.
Types ¶
type CacheOptions ¶
type CacheOptions struct { PidCacheOptions GCacheOptions BuildIDCacheOptions GCacheOptions SameFileCacheOptions GCacheOptions }
type ElfCache ¶
type ElfCache struct { BuildIDCache *GCache[elf.BuildID, SymbolNameResolver] SameFileCache *GCache[Stat, SymbolNameResolver] }
func NewElfCache ¶
func NewElfCache(buildIDCacheOptions GCacheOptions, sameFileCacheOptions GCacheOptions) (*ElfCache, error)
func (*ElfCache) CacheByBuildID ¶
func (e *ElfCache) CacheByBuildID(buildID elf.BuildID, v SymbolNameResolver)
func (*ElfCache) CacheByStat ¶
func (e *ElfCache) CacheByStat(s Stat, v SymbolNameResolver)
func (*ElfCache) DebugInfo ¶
func (e *ElfCache) DebugInfo() ElfCacheDebugInfo
func (*ElfCache) GetSymbolsByBuildID ¶
func (e *ElfCache) GetSymbolsByBuildID(buildID elf.BuildID) SymbolNameResolver
func (*ElfCache) GetSymbolsByStat ¶
func (e *ElfCache) GetSymbolsByStat(s Stat) SymbolNameResolver
func (*ElfCache) Update ¶
func (e *ElfCache) Update(buildIDCacheOptions GCacheOptions, sameFileCacheOptions GCacheOptions)
type ElfCacheDebugInfo ¶
type ElfCacheDebugInfo struct { BuildIDCache GCacheDebugInfo[elf.SymTabDebugInfo] `river:"build_id_cache,attr,optional"` SameFileCache GCacheDebugInfo[elf.SymTabDebugInfo] `river:"same_file_cache,attr,optional"` }
type ElfDebugInfo ¶
type ElfTable ¶
type ElfTable struct {
// contains filtered or unexported fields
}
func NewElfTable ¶
func (*ElfTable) DebugInfo ¶
func (et *ElfTable) DebugInfo() elf2.SymTabDebugInfo
type ElfTableOptions ¶
type ElfTableOptions struct { ElfCache *ElfCache Metrics *metrics.SymtabMetrics SymbolOptions *SymbolOptions }
type GCache ¶
type GCache[K comparable, V Resource] struct { // contains filtered or unexported fields }
func NewGCache ¶
func NewGCache[K comparable, V Resource](options GCacheOptions) (*GCache[K, V], error)
func (*GCache[K, V]) Update ¶
func (g *GCache[K, V]) Update(options GCacheOptions)
type GCacheDebugInfo ¶
type GCacheDebugInfo[T any] struct { LRUSize int `river:"lru_size,attr,optional"` RoundSize int `river:"round_size,attr,optional"` CurrentRound int `river:"current_round,attr,optional"` LRUDump []T `river:"lru_dump,block,optional"` RoundDump []T `river:"round_dump,block,optional"` }
func DebugInfo ¶
func DebugInfo[K comparable, V Resource, D any](g *GCache[K, V], ff func(K, V, int) D) GCacheDebugInfo[D]
type GCacheOptions ¶
type ProcMap ¶
type ProcMap struct { // The start address of current mapping. StartAddr uint64 // The end address of the current mapping EndAddr uint64 // The permissions for this mapping Perms *ProcMapPermissions // The current offset into the file/fd (e.g., shared libs) Offset int64 // Device owner of this mapping (major:minor) in Mkdev format. Dev uint64 // The inode of the device above Inode uint64 // The file or psuedofile (or empty==anonymous) Pathname string }
ProcMap contains the process memory-mappings of the process read from `/proc/[pid]/maps`.
func FindLastRXMap ¶
func FindReadableMap ¶
FindReadableMap return a map entry that is readable and not writable or nil
func ParseProcMapLine ¶
ParseProcMapLine will attempt to parse a single line within a proc/[pid]/maps buffer. 7f5822ebe000-7f5822ec0000 r--p 00000000 09:00 533429 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 returns nil if entry is not executable
type ProcMapPermissions ¶
type ProcMapPermissions struct { // mapping has the [R]ead flag set Read bool // mapping has the [W]rite flag set Write bool // mapping has the [X]ecutable flag set Execute bool Shared bool // mapping is marked as [P]rivate (copy on write) Private bool }
ProcMapPermissions contains permission settings read from `/proc/[pid]/maps`.
func (*ProcMapPermissions) String ¶
func (p *ProcMapPermissions) String() string
type ProcTable ¶
type ProcTable struct {
// contains filtered or unexported fields
}
func NewProcTable ¶
func NewProcTable(logger log.Logger, options ProcTableOptions) *ProcTable
func (*ProcTable) DebugInfo ¶
func (p *ProcTable) DebugInfo() ProcTableDebugInfo
type ProcTableDebugInfo ¶
type ProcTableOptions ¶
type ProcTableOptions struct { Pid int ElfTableOptions }
type SymTab ¶ added in v0.7.1
type SymTab struct { Symbols []Sym // contains filtered or unexported fields }
type SymbolCache ¶
type SymbolCache struct {
// contains filtered or unexported fields
}
SymbolCache is responsible for resolving PC address to Symbol maintaining a pid -> ProcTable cache resolving kernel symbols
func NewSymbolCache ¶
func NewSymbolCache(logger log.Logger, options CacheOptions, metrics *metrics.SymtabMetrics) (*SymbolCache, error)
func (*SymbolCache) Cleanup ¶
func (sc *SymbolCache) Cleanup()
func (*SymbolCache) ElfCacheDebugInfo ¶
func (sc *SymbolCache) ElfCacheDebugInfo() ElfCacheDebugInfo
func (*SymbolCache) GetKallsyms ¶
func (sc *SymbolCache) GetKallsyms() SymbolTable
func (*SymbolCache) GetProcTableCached ¶
func (sc *SymbolCache) GetProcTableCached(pid PidKey) *ProcTable
func (*SymbolCache) NewProcTable ¶
func (sc *SymbolCache) NewProcTable(pid PidKey, symbolOptions *SymbolOptions) *ProcTable
func (*SymbolCache) NextRound ¶
func (sc *SymbolCache) NextRound()
func (*SymbolCache) PidCacheDebugInfo ¶
func (sc *SymbolCache) PidCacheDebugInfo() GCacheDebugInfo[ProcTableDebugInfo]
func (*SymbolCache) RemoveDeadPID ¶
func (sc *SymbolCache) RemoveDeadPID(pid PidKey)
func (*SymbolCache) UpdateOptions ¶
func (sc *SymbolCache) UpdateOptions(options CacheOptions)
type SymbolNameResolver ¶
type SymbolNameResolver interface { Refresh() Cleanup() DebugInfo() elf.SymTabDebugInfo IsDead() bool Resolve(addr uint64) string }
type SymbolOptions ¶
type SymbolTab ¶
type SymbolTab struct {
// contains filtered or unexported fields
}
func NewKallsyms ¶
func NewKallsymsFromData ¶
func NewKallsymsFromFile ¶
func NewSymbolTab ¶
func (*SymbolTab) DebugString ¶
type SymbolTable ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.