Crates.io | bcc |
lib.rs | bcc |
version | 0.0.34 |
source | src |
created_at | 2018-02-05 15:27:03.74253 |
updated_at | 2023-10-25 20:01:03.722662 |
description | Idiomatic Rust bindings for BPF Compiler Collection (BCC) |
homepage | https://github.com/rust-bpf/rust-bcc |
repository | https://github.com/rust-bpf/rust-bcc |
max_upload_size | |
id | 49740 |
size | 272,155 |
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
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.
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.
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.
strlen
is run on. Port of strlen_count.py to Rust.