Hello.
I found that libbpf can only construct struct bpf_program instances
through skeleton. Can I manually construct struct bpf_program instances?
We now load our eBPF program by putting the eBPF bytecode into the elf
file, and then letting libbpf open the elf file [1]. But adding a map to
an elf file is a more complicated matter [2]. Therefore, we hope to
create a bpf_program instance through something like struct bpf_program
*bpf_program_new(void *insns, int insns_cnt). After creating the struct
bpf_program instance, we can call bpf_program__attach to load our eBPF
program bytecode.
[1] https://github.com/aliyun/coolbpf/blob/master/lwcb/bpfir/src/object.rs
[2] https://github.com/aliyun/coolbpf/issues/38
Thanks in advance!