OSDN Git Service

libbpf: Use available_filter_functions_addrs with multi-kprobes
authorJackie Liu <liuyun01@kylinos.cn>
Wed, 5 Jul 2023 09:12:09 +0000 (17:12 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 6 Jul 2023 23:05:08 +0000 (16:05 -0700)
commit56baeeba0a355ecf4d0c71bfbb1d5ba09501dbfc
tree547d48b0aad61f19e5ebc5d8b83f4aa81c9cf114
parent8a3fe76f8718bad4056d665bee1a0c43d128af72
libbpf: Use available_filter_functions_addrs with multi-kprobes

Now that kernel provides a new available_filter_functions_addrs file
which can help us avoid the need to cross-validate
available_filter_functions and kallsyms, we can improve efficiency of
multi-attach kprobes. For example, on my device, the sample program [1]
of start time:

$ sudo ./funccount "tcp_*"

before   after
1.2s     1.0s

  [1]: https://github.com/JackieLiu1/ketones/tree/master/src/funccount

Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230705091209.3803873-2-liu.yun@linux.dev
tools/lib/bpf/libbpf.c