A cache of symbolized frames, keyed by instruction address.

Synopsis

Declared in <folly/debugging/symbolizer/SymbolCache.h>

class SymbolCacheBase;

Description

Symbolizing an address costs tens of microseconds, a linear scan of an ELF symbol table plus a DWARF lookup, so a hit is worth orders of magnitude more than whatever the lookup costs. Implementations should optimize for hit rate and for scaling across threads, not for the cost of a single operation.

The cache is a pure optimization: dropping a lookup or an insertion is always safe.

Entries are keyed by address alone, so a cache may only be shared between symbolizers using the same LocationInfoMode, since a DISABLED entry carries no file and line information where a FAST one does, and using the same ElfCacheBase, since a cached frame holds a shared_ptr to the ElfFile it was resolved from and its name points into that file's mapped string table.

Implementations are thread‐safe.

Member Functions

Name

Description

~SymbolCacheBase [destructor] [virtual]

Virtual destructor.

find [virtual]

Copies the frames cached for address into out and returns true, or leaves out untouched and returns false.

insert [virtual]

Best effort: the entry may be dropped or evicted at any point.

Non-Member Functions

Name

Description

getSharedSymbolCache

The process‐wide cache for mode.

makeGenerationalSymbolCache

A cache of roughly capacity entries, backed by a folly::GenerationalCacheMap: lookups are lock‐free, and an address that stops appearing in stack traces is eventually evicted in favour of one that does.

makeLruSymbolCache

An LRU cache of capacity entries, backed by a Synchronized EvictingCacheMap.

makeNullSymbolCache

A cache that stores nothing.

Created with MrDocs