]> git.baikalelectronics.ru Git - kernel.git/commit
btf: allow to customize dedup hash table size
authorAndrii Nakryiko <andriin@fb.com>
Thu, 28 Feb 2019 23:31:23 +0000 (15:31 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Mar 2019 00:31:47 +0000 (01:31 +0100)
commit2d0153bb170e71d7f9e06bed47d7755d7c85d534
treef62542a11348c36a6e3ef331659a7d17f0e6806c
parentb7bf042d6cb2030949f17153c127f89f4d8316ac
btf: allow to customize dedup hash table size

Default size of dedup table (16k) is good enough for most binaries, even
typical vmlinux images. But there are cases of binaries with huge amount
of BTF types (e.g., allyesconfig variants of kernel), which benefit from
having bigger dedup table size to lower amount of unnecessary hash
collisions. Tools like pahole, thus, can tune this parameter to reach
optimal performance.

This change also serves double purpose of allowing tests to force hash
collisions to test some corner cases, used in follow up patch.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h