OSDN Git Service

libbpf: Unify and speed up BTF string deduplication
authorAndrii Nakryiko <andriin@fb.com>
Thu, 5 Nov 2020 04:33:53 +0000 (20:33 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 6 Nov 2020 02:37:30 +0000 (18:37 -0800)
commit88a82c2a9ab5b2ce533c3de3f4517853c2f67f53
treeb3a4ddde7d870d4cb6ca403727caf46aacb0f2b4
parentd9448f94962bd28554df7d9a342d37c7f13d6232
libbpf: Unify and speed up BTF string deduplication

Revamp BTF dedup's string deduplication to match the approach of writable BTF
string management. This allows to transfer deduplicated strings index back to
BTF object after deduplication without expensive extra memory copying and hash
map re-construction. It also simplifies the code and speeds it up, because
hashmap-based string deduplication is faster than sort + unique approach.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20201105043402.2530976-4-andrii@kernel.org
tools/lib/bpf/btf.c