Re: [PATCH bpf-next v5 4/9] tools: bpftool: add probes for eBPF program types
From: Quentin Monnet <hidden>
Date: 2019-01-24 08:55:47
2019-01-23 23:44 UTC+0000 ~ Andrey Ignatov [off-list ref]
Quentin Monnet [off-list ref] [Thu, 2019-01-17 07:28 -0800]:quoted
Introduce probes for supported BPF program types in libbpf, and call it from bpftool to test what types are available on the system. The probe simply consists in loading a very basic program of that type and see if the verifier complains or not. Sample output: # bpftool feature probe kernel ... Scanning eBPF program types... eBPF program_type socket_filter is available eBPF program_type kprobe is available eBPF program_type sched_cls is available ... # bpftool --json --pretty feature probe kernel { ... "program_types": { "have_socket_filter_prog_type": true, "have_kprobe_prog_type": true, "have_sched_cls_prog_type": true, ... } }Hi Quentin, Awesome work! I wondef if you have plan to add similar functionality for attach types? For example BPF_CGROUP_INET{4,6}_CONNECT were added in 4.17 but BPF_CGROUP_UDP{4,6}_SENDMSG later in 4.18 even though they correspond to same prog type (BPF_PROG_TYPE_CGROUP_SOCK_ADDR).
Hi Andrey, thanks! And yeah adding probes for the attach types would be one of the next logical steps, although to be honest it is not at the top of my to-do list right now. I'll probably add them eventually, but if you have a need for such probes today feel free to give it a go! Best regards, Quentin