Giter Club home page Giter Club logo

bpf-benchmark's Introduction

BPF-Benchmark

BPF-Benchmark is a simple testsuit designed to assess the performance of different userspace eBPF (Berkeley Packet Filter) runtimes.

Usage

To effectively utilize BPF-Benchmark, follow these steps:

  1. Install Dependencies: Ensure that clang and llvm are installed on your system. If you are using Debian or Ubuntu, you can easily install these packages by executing the command: sudo apt install clang llvm.
  2. Acquire Runtimes: BPF-Benchmark includes three pre-packaged runtimes: llvm-jit, ebpf, and ubpf. If the provided executables are incompatible with your system, you have the option to manually build these runtimes.
  3. Install Required Dependencies: The toolkit relies on various dependencies, all of which are listed in the requirements.txt file. Install these dependencies to ensure smooth functionality.
  4. Compile BPF Programs: Execute the command make -C bpf_progs to compile the BPF programs.
  5. Run Benchmark: Launch the benchmarking process by running the run_benchmark.py script.
  6. View Results: The results of the benchmark can be observed directly in the console, or you can find graphical representations in the output folder. Additionally, raw data in JSON format is stored in output/data.json.

Adding a New Test

To include a new test within BPF-Benchmark, adhere to these guidelines:

  1. Create BPF Program: Craft an eBPF program and name it as XXX.bpf.c, placing it in the bpf_progs directory. 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 __always_inline attribute.
  2. Optional Memory File: You have the choice to create a file named XXX.mem if your eBPF program requires specific memory input during execution.

Included Test Cases

BPF-Benchmark currently incorporates the following BPF code test cases:

  • log2_int.bpf.c
  • memcpy.bpf.c
  • native_wrapper.c
  • prime.bpf.c
  • simple.bpf.c
  • strcmp_fail.bpf.c
  • strcmp_full.bpf.c
  • switch.bpf.c

Select and execute the tests ending with the .bpf extension.

Supported Runtimes

BPF-Benchmark facilitates performance comparison across the following runtimes:

  • bpftime-llvm
  • bpftime-rbpf
  • bpftime-ubpf

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.

bpf-benchmark's People

Contributors

officeyutong avatar yunwei37 avatar

Stargazers

Yiwei Yang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.