CVSROOT: /cvs Module name: src Changes by: chel...@cvs.openbsd.org 2024/03/16 11:42:37
Modified files: usr.sbin/btrace: ksyms.c Log message: btrace(8): cache ELF symbols in sorted array Currently, every kelf_snprintsym() call performs a linear search through the .symtab for a symbol matching the given PC. The search is expensive and seems to be a major source of dropped profiling events. Storing all STT_FUNC .symtab entries and their names in a sorted array cuts search time from O(n) to O(lg n). In practice, the faster lookups seem to dramatically reduce the profiling drop rate. With tweaks from mpi@. Thread: https://marc.info/?l=openbsd-tech&m=170830125132105&w=2 ok mpi@