#bpf #bindings #bcc


Idiomatic Rust bindings for BPF Compiler Collection (BCC)

17 releases

✓ Uses Rust 2018 edition

0.0.17 Mar 20, 2020
0.0.15 Jan 10, 2020
0.0.14 Dec 10, 2019
0.0.13 Oct 7, 2019
0.0.3 Feb 8, 2018

#30 in Development tools

Download history 193/week @ 2020-01-25 392/week @ 2020-02-01 644/week @ 2020-02-08 178/week @ 2020-02-15 589/week @ 2020-02-22 670/week @ 2020-02-29 547/week @ 2020-03-07 738/week @ 2020-03-14 614/week @ 2020-03-21 437/week @ 2020-03-28 393/week @ 2020-04-04 264/week @ 2020-04-11 161/week @ 2020-04-18 156/week @ 2020-04-25 164/week @ 2020-05-02 345/week @ 2020-05-09

2,002 downloads per month

MIT license



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.


  • bcc v0.4.0-v0.10.0

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.


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.



~101K SLoC