]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita18737d7ba1f017ae800cd52e69bc4736dadf7ba
treeb3a4ddde7d870d4cb6ca403727caf46aacb0f2b4
parentb2a879c7f5fbeb1d2c9716785e61a89d602b8e37
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