Code Monkey home page Code Monkey logo

ebpf-apps's Introduction

ebpf-apps

eBPF sample apps based on BCC, libbpf and various language bindings.

Contents

  • bcc-apps: eBPF samples with BCC.
  • bpf-apps: eBPF samples with libbpf and CO-RE.
  • bpftrace: eBPF samples with bpftrace.
  • go: eBPF samples with Go bindings.
  • kernel: eBPF samples built with kernel source.
  • rust: eBPF samples with Rust bindings.
  • tools: Tools for eBPF (e.g. bpftool and faddr2line).

Pre-requisites

BCC

BCC and its development libraries should be installed.

Install from packages

Please follow INSTALL.md to see the detailed guides. For example, on Ubuntu or RHEL:

# Ubuntu
sudo apt-get install bpfcc-tools libbpfcc-dev linux-headers-$(uname -r)

# RHEL
sudo yum install bcc-tools bcc-devel

Install from source

Please follow INSTALL.md to see the detailed guides. For example, on Ubuntu 20.04+:

sudo apt install -y bison build-essential cmake flex git libedit-dev llvm-dev libclang-dev python zlib1g-dev libelf-dev libfl-dev python3-distutils

git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 .. # build python3 binding
pushd src/python/
make
sudo make install
popd

libbpf with CO-RE

To use BTF and CO-RE, CONFIG_DEBUG_INFO_BTF=y and CONFIG_DEBUG_INFO_BTF_MODULES=y need to be enabled. If you don't want to rebuild the kernel, the following distos have enabled those options by default:

  • Ubuntu 20.10+
  • Fedora 31+
  • RHEL 8.2+
  • Debian 11+

And to build bpf applications, the following development tools should also be installed:

# Ubuntu
sudo apt-get install -y libbpf-dev make clang llvm libelf-dev linux-tools-$(uname -r)

# RHEL
sudo yum install -y libbpf-devel make clang llvm elfutils-libelf-devel bpftool

Useful Links

ebpf-apps's People

Contributors

feiskyer avatar

Watchers

James Cloos 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.