HomeFreeBSD

addr2line: Cache CU DIEs upon a successful address lookup.

Description

addr2line: Cache CU DIEs upon a successful address lookup.

Previously, addr2line would sequentially search all CUs for each input
address. For some uses, notably syzkaller's code coverage map generator,
this was extremely slow. Add a CU cache into which entries are added
following a successful lookup, and search the cache before falling back
to a scan. When translating a large number of addresses this yields
slightly better performance than GNU addr2line.

Garbage-collect an unused hash table which appears to have been intended
for the same purpose. A hash table doesn't seem particularly suitable
since each CU spans a range of addresses.

Submitted by: Tiger Gao <tig@freebsdfoundation.org>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23418

Details

Provenance
markjAuthored on
Differential Revision
D23418: Added RB_TREE to addr2line
Parents
rS357449: units(1): Refactor the manual page and update usage information
Branches
Unknown
Tags
Unknown