mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
cfdf224d93c6dce972a8def783b0a8363e4326c6
The libbpf API has deprecated a number of functions used by the pping loader. While a couple of functions have simply been renamed, bpf_object__find_program_by_title has been completely deprecated in favor of bpf_object__find_program_by_name. Therefore, change so that BPF programs are found based on the C function names rather than section names. Also remove defines of section names as they are no longer used, and change the section names in pping_kern.c to use "tc" instead of "classifier/ingress" and "classifier/egress". Finally replace the flags json_format and json_ppviz in pping_config with a single enum for the different output formats. This makes the logic for which output format to use clearer compared to relying on multiple (supposedly) mutually exclusive flags (and implicitly assuming standard format if neither flag was set). One potential concern with this commit is that it introduces some "magical strings". In case the function names in pping_kern.c are changed it will require multiple changes in pping.c. Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Practical BPF examples
This git repository contains a diverse set of practical BPF examples that solve (or demonstrate) a specific use-case using BPF.
It is meant to ease doing rapid prototyping and development, writing C-code BPF programs using libbpf. The goal is to make it easier for developers to get started coding.
Many developers struggle to get a working BPF build environment. The repo enviroment makes it easy to build/compile BPF programs by doing the necessary libbpf setup transparently and detect missing compile dependencies (via the configure script). It is a declared goal to make BPF programming more consumable by detecting and reporting issues (when possible).
Description
Languages
C
93.6%
Shell
4.7%
Makefile
1.6%