Go to file
Brian Martin 3a4483afa5
rename probe 'name' to 'handler' (#117)
Currently, 'name' refers to the BPF function name of the probe
handler. It seems like it would be more clear to call this a
handler.
2020-08-03 10:59:30 -07:00
.github improve ci (#101) 2020-07-22 16:11:00 -07:00
build Feature: PerfEvent support. (#106) 2020-07-29 10:20:32 -07:00
examples rename probe 'name' to 'handler' (#117) 2020-08-03 10:59:30 -07:00
src rename probe 'name' to 'handler' (#117) 2020-08-03 10:59:30 -07:00
tests rename probe 'name' to 'handler' (#117) 2020-08-03 10:59:30 -07:00
.gitignore cargo: remove lock file (#26) 2018-08-02 09:47:15 -07:00
CHANGELOG.md prepare for release 0.0.21 (#103) 2020-07-24 13:12:34 -07:00
Cargo.toml begin next development iteration (#104) 2020-07-24 14:26:22 -07:00
LICENSE Add MIT license 2018-04-17 12:56:17 -04:00
README.md prepare for release 0.0.21 (#103) 2020-07-24 13:12:34 -07:00
rustfmt.toml rustfmt: format the codebase with modern rustfmt (#31) 2018-09-17 11:26:09 -07:00

README.md

rust-bcc

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.15.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