BPF-Benchmark is a simple testsuit designed to assess the performance of different userspace eBPF (Berkeley Packet Filter) runtimes.
To effectively utilize BPF-Benchmark, follow these steps:
- Install Dependencies: Ensure that
llvmare installed on your system. If you are using
Ubuntu, you can easily install these packages by executing the command:
sudo apt install clang llvm.
- Acquire Runtimes: BPF-Benchmark includes three pre-packaged runtimes:
ubpf. If the provided executables are incompatible with your system, you have the option to manually build these runtimes.
- Install Required Dependencies: The toolkit relies on various dependencies, all of which are listed in the
requirements.txtfile. Install these dependencies to ensure smooth functionality.
- Compile BPF Programs: Execute the command
make -C bpf_progsto compile the BPF programs.
- Run Benchmark: Launch the benchmarking process by running the
- View Results: The results of the benchmark can be observed directly in the console, or you can find graphical representations in the
outputfolder. Additionally, raw data in JSON format is stored in
Adding a New Test
To include a new test within BPF-Benchmark, adhere to these guidelines:
- Create BPF Program: Craft an eBPF program and name it as
XXX.bpf.c, placing it in the
bpf_progsdirectory. The program should contain a function named
unsigned long long bpf_main(void* mem)as its entry point. Any other functions must be inlined using the
- Optional Memory File: You have the choice to create a file named
XXX.memif your eBPF program requires specific memory input during execution.
Included Test Cases
BPF-Benchmark currently incorporates the following BPF code test cases:
Select and execute the tests ending with the
BPF-Benchmark facilitates performance comparison across the following runtimes:
These runtimes are involved in the benchmarking process to evaluate their relative efficiencies.
Enhance your BPF runtime evaluation experience using BPF-Benchmark! If you encounter any issues or need further assistance, feel free to reach out to us. Your feedback is invaluable in refining this toolkit.