All Projects → trailofbits → ebpfpub

trailofbits / ebpfpub

Licence: Apache-2.0 license
ebpfpub is a generic function tracing library for Linux that supports tracepoints, kprobes and uprobes.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to ebpfpub

Bpftrace
High-level tracing language for Linux eBPF
Stars: ✭ 4,526 (+5162.79%)
Mutual labels:  tracing, ebpf, bpf, tracepoints
pwru
Packet, where are you? -- Linux kernel networking debugger
Stars: ✭ 694 (+706.98%)
Mutual labels:  tracing, ebpf, bpf
Ebpf exporter
Prometheus exporter for custom eBPF metrics
Stars: ✭ 829 (+863.95%)
Mutual labels:  tracing, ebpf, bpf
Bpfd
Framework for running BPF programs with rules on Linux as a daemon. Container aware.
Stars: ✭ 396 (+360.47%)
Mutual labels:  tracing, ebpf, bpf
ebpfault
A BPF-based syscall fault injector
Stars: ✭ 65 (-24.42%)
Mutual labels:  llvm, ebpf, bpf
libebpf
Experiemental userspace eBPF library
Stars: ✭ 14 (-83.72%)
Mutual labels:  llvm, ebpf, bpf
Hubble
Hubble - Network, Service & Security Observability for Kubernetes using eBPF
Stars: ✭ 1,245 (+1347.67%)
Mutual labels:  tracing, ebpf
Tracepkt
Trace a ping packet journey across network interfaces and namespace on recent Linux. Supports IPv4 and IPv6.
Stars: ✭ 176 (+104.65%)
Mutual labels:  tracing, ebpf
Ebpf
eBPF Utilities, Maps, and more
Stars: ✭ 238 (+176.74%)
Mutual labels:  tracing, ebpf
Ipftrace2
A packet oriented Linux kernel function call tracer
Stars: ✭ 193 (+124.42%)
Mutual labels:  tracing, ebpf
KubeArmor
Cloud-native Runtime Security Enforcement System
Stars: ✭ 434 (+404.65%)
Mutual labels:  ebpf, bpf
libbpf-sys
Rust bindings to libbpf from the Linux kernel
Stars: ✭ 103 (+19.77%)
Mutual labels:  ebpf, bpf
portablebpf
You came here so you could have a base code to serve you as an example on how to develop a BPF application, compatible to BCC and/or LIBBPF, specially LIBBPF, having the userland part made in C or PYTHON.
Stars: ✭ 32 (-62.79%)
Mutual labels:  ebpf, bpf
Weaver
Trace Go program execution with uprobes and eBPF
Stars: ✭ 174 (+102.33%)
Mutual labels:  tracing, ebpf
Libbpf
Automated upstream mirror for libbpf stand-alone build.
Stars: ✭ 353 (+310.47%)
Mutual labels:  tracing, bpf
ebpf
eBPF package for Go
Stars: ✭ 25 (-70.93%)
Mutual labels:  ebpf, bpf
uprobe-http-tracer
uprobe-based HTTP tracer for Go binaries
Stars: ✭ 45 (-47.67%)
Mutual labels:  tracing, ebpf
bpfps
A tool to list and diagnose bpf programs. (Who watches the watchers..? :)
Stars: ✭ 93 (+8.14%)
Mutual labels:  tracing, bpf
rbbcc
BCC port for MRI - this is unofficial bonsai project.
Stars: ✭ 45 (-47.67%)
Mutual labels:  tracing, ebpf
alon
Remix for Solana.
Stars: ✭ 87 (+1.16%)
Mutual labels:  llvm, bpf

ebpfpub

ebpfpub is a generic function tracing library for Linux that supports tracepoints, kprobes and uprobes.

CI Status

Building

Prerequisites

  • A recent libc++ or stdc++ library, supporting C++17
  • CMake >= 3.16.2. A pre-built binary can be downloaded from the CMake's download page.
  • Linux kernel >= 4.18 (Ubuntu 18.10, CentOS 8, Red Hat Enterprise Linux 8).
    • Test for the support: grep BPF /boot/config-`uname -r` and check the output for CONFIG_BPF=y and CONFIG_BPF_SYSCALL=y
  • The package libz-dev, needed during linking.
  • Optional, but highly recommended: download and install the osquery-toolchain (see below).
    • This should work fine on any recent Linux distribution. The binaries generated with this toolchain are portable and can be deployed on any distro >= CentOS 6/Ubuntu 16.04
  • If not using the osquery-toolchain (if building with the system toolchain):
    • Clang and the C++ library must both support C++17. Recent distributions should be compatible (tested on Arch Linux, Ubuntu 19.10 and above).
    • A recent Clang/LLVM installation (8.0 or better), compiled with BPF support.
      • Test for the support: llc --version | grep bpf and check that BPF is listed as a registered target.
      • Please note that LLVM itself must be compiled with libc++ when enabling the EBPF_COMMON_ENABLE_LIBCPP option, since ebfpub will directly link against the LLVM libraries.
    • The packages llvm-devel (for LLVMConfig.cmake files), llvm-static (for additional LLVM libraries), and ncurses-devel (for libtinfo)

Installing the osquery-toolchain

As root:

cd /tmp
wget https://github.com/osquery/osquery-toolchain/releases/download/1.1.0/osquery-toolchain-1.1.0-x86_64.tar.xz 
tar -xf /tmp/ebpfpub/build/osquery-toolchain-1.1.0-x86_64.tar.xz -C /opt

Dependencies (retrieved with git)

Steps to Build

  1. Obtain the source code: git clone --recursive https://github.com/trailofbits/ebpfpub
  2. If you cloned the repo without the --recursive flag, run git submodule update --init --recursive
  3. Enter the source folder: cd ebpfpub
  4. If you intend to build the project using the osquery-toolchain: export TOOLCHAIN_PATH="/opt/osquery-toolchain", then add -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake to step 6
  5. Configure the project: cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DEBPFPUB_ENABLE_INSTALL=true -DEBPFPUB_ENABLE_EXAMPLES=true -DEBPF_COMMON_ENABLE_TESTS=true
  6. Build the project: cmake --build build -j $(($(nproc) + 1))
  7. Run the tests: cmake --build build --target run-ebpf-common-tests

Building the package

Prerequisites for packaging

  • DEB: dpkg command
  • RPM: rpm command
  • TGZ: tar command

Steps to package

Make sure that the -DEBPFPUB_ENABLE_INSTALL:BOOL=true parameter has been passed at configure time, then run the following commands inside the build folder:

mkdir install
export DESTDIR=`realpath install`

cd build
cmake --build . --target install

Configure the packaging project:

mkdir package
cd package

cmake -DEBPFPUB_INSTALL_PATH:PATH="${DESTDIR}" /path/to/source_folder/package_generator
cmake --build . --target package
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].