eunomia-bpf / btf-relocate-demo

Using btf to relocate bpf code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An example to show how to use libbpf for bpf relocate

License: MIT Build and publish GitHub stars

An example to show how to use libbpf for bpf relocate.

For other related examples, please refer to Expanding eBPF Compile Once, Run Everywhere(CO-RE) to Userspace Compatibility

How to use

Clone your new repository

Clone your newly created repository to your local machine:

git clone https://github.com/your_username/your_new_repository.git --recursive

Or after clone the repo, you can update the git submodule with following commands:

git submodule update --init --recursive

Install dependencies

For dependencies, it varies from distribution to distribution. You can refer to shell.nix and dockerfile for installation.

On Ubuntu, you may run make install or

sudo apt-get install -y --no-install-recommends \
        libelf1 libelf-dev zlib1g-dev \
        make clang llvm

to install dependencies.

Build the project

To build the project, run the following command:

make build

This will compile your code and create the necessary binaries. You can you the Github Code space or Github Action to build the project as well.

Run the Project

You can run the binary with:

sudo src/relo

7. GitHub Actions

This template also includes a GitHub action that will automatically build and publish your project when you push to the repository. To customize this action, edit the .github/workflows/publish.yml file.

Contributing

We welcome contributions to improve this template! If you have any ideas or suggestions, feel free to create an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

About

Using btf to relocate bpf code

License:MIT License


Languages

Language:C 100.0%Language:Makefile 0.0%Language:Nix 0.0%Language:Dockerfile 0.0%