]> 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)
commit4b88b1ce770b039fde086708946eae1c7c7a499a
treeb3a4ddde7d870d4cb6ca403727caf46aacb0f2b4
parent9643fc61be6910cd9d8e37f18da3afc34476dbbb
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