bpf_trace_filter: support bpf filter optimization and dump 43/40443/3
authorVladislav Grishenko <themiron@yandex-team.ru>
Sat, 2 Mar 2024 16:04:14 +0000 (21:04 +0500)
committerMohammed HAWARI <momohawari@gmail.com>
Mon, 4 Mar 2024 09:29:12 +0000 (09:29 +0000)
commit5be4b869a450530052f31e3325dfcfee49ac2178
tree22b30d0a8bd39412bbd005b9be776a3cffdb2be2
parent4b6614030f384f7c8d847360cacf5c7f7560c6be
bpf_trace_filter: support bpf filter optimization and dump

BPF filter w/o optimization can take x2 - x3 more instructions,
causing significant slow down in fast path.

Enable pcap optimization by default via cli and introduce api v2
with pcap optimization control, keep v1 for a while as it exists
in previous release already.
Intriduce bpf filter cli dump, similar to tcpdump -d.

Also fix memleak, function name typo, cli pcap format hint and
add related tests.

Type: improvement
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I92b2b519e92326f1b8e1a4dda6a3e3edc52f87ad
src/plugins/bpf_trace_filter/api.c
src/plugins/bpf_trace_filter/bpf_trace_filter.api
src/plugins/bpf_trace_filter/bpf_trace_filter.c
src/plugins/bpf_trace_filter/bpf_trace_filter.h
src/plugins/bpf_trace_filter/cli.c
test/test_bpf_trace_filter.py