Go to file
Brian Martin 52e29c6661
update readme and prepare for release 0.0.34 (#199)
Update the readme and changelog to prepare for release 0.0.34
2023-10-25 13:00:32 -07:00
.github add bcc 0.23.0 to ci (#187) 2021-11-24 13:33:24 -08:00
build fix #192 (#194) 2022-09-06 15:41:35 -07:00
examples update readme and prepare for release 0.0.34 (#199) 2023-10-25 13:00:32 -07:00
src fix #192 (#194) 2022-09-06 15:41:35 -07:00
tests rename probe 'name' to 'handler' (#117) 2020-08-03 10:59:30 -07:00
.gitignore Run tests under Valgrind to detect memory issues (#133) 2020-09-10 15:19:21 -07:00
CHANGELOG.md update readme and prepare for release 0.0.34 (#199) 2023-10-25 13:00:32 -07:00
Cargo.toml update readme and prepare for release 0.0.34 (#199) 2023-10-25 13:00:32 -07:00
LICENSE Add MIT license 2018-04-17 12:56:17 -04:00
README.md update readme and prepare for release 0.0.34 (#199) 2023-10-25 13:00:32 -07:00
rustfmt.toml rustfmt: format the codebase with modern rustfmt (#31) 2018-09-17 11:26:09 -07:00

README.md

rust-bcc

Warning! Unmaintained!

With the advances in other BPF crates in the Rust ecosystem, this crate is no longer actively maintained. We recommend adopting libbpf-rs

About

Idiomatic Rust bindings for the BPF compiler collection. The goal is to mimic the Python BCC bindings in https://github.com/iovisor/bcc in a Rusty way.

The C bcc API (as exposed in bcc-sys) is very powerful, but it's fairly nontrivial to try to use it by itself and manage all the resources it allocates safely.

This crate is currently experimental and has several things in it which are either unsafe or not particularly idiomatic for Rust. Pull requests very much appreciated.

Prerequisites

  • bcc v0.4.0-v0.23.0

Static linking

This crate allows for statically linking libbpf/libbcc which enables the creation of tools which have no runtime dependency on matching versions being present on target systems. To statically link, you may need to compile several dependencies from source. See the build/ci.sh script for how those dependencies are built and how we build and run statically linked examples in CI.

Getting Started

The best way to learn about how to use this crate right now is to read the examples. The exciting thing about these examples is that the Rust version isn't really more verbose than the Python version. In some ways the Rust code is more legible because it's much more natural to work with C data structure in Rust than it is in Python.

Building

This library uses features to allow support for multiple versions of bcc. Depending on what version of bcc you have installed, you may need to use a feature flag while building the examples in-order to match the expected version of bcc with the version you have installed on your system.

Examples