How to manually construct a struct bpf_program instance?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






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!




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux