rust-bpf / bcc-sys Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
BCC 0.16.0 is out, we should generate bindings and release a new version.
One line summary of the issue here
Missing ring buffer API.
briefly answer these questions:
what did you expect?
To use BPF ring buffer with rust-bpf
what actually happened?
Currently bcc-sys doesn't have ring buffer related API, but bcc does.
The ring buffer API definition in bcc is here.
what steps can we take to reproduce the behavior you saw?
bpf_new_ringbuf
, bpf_free_ringbuf
, bpf_add_ringbuf
, bpf_poll_ringbuf
, bpf_consume_ringbuf
are not defined bcc-sys.
When trying to build a static library using cargo build --features v0_10_0 static
I would have expected that cargo would try to link against a statically compiled LLVM.
Instead cargo tried linking against a dynamically compiled LLVM. The error message I got was:
vagrant@ubuntu-bionic:~/rust-bpf/bcc-sys$ cargo build --features v0_10_0 static
Compiling bcc-sys v0.10.3-alpha.0 (/home/vagrant/rust-bpf/bcc-sys)
error: could not find native static library 'LLVM-6.0', perhaps an -L flag is missing?
error: aborting due to previous error
error: Could not compile 'bcc-sys'.
To learn more, run the command again with --verbose.
There is no libllvm-6.0.a file and from what I understand from running llvm-config --libs --link-static
you need to compile against all the static libraries that this command outputs. Adding .args(--link-static)
to the build.rs
fixed the issue for me. I'm happy to open a PR with this fix.
I'm running ubuntu 18.04 with version 6.0 of the LLVM toolchain. Other steps are described above.
Looks like the bcc 0.16.0 bindings (which were generated with bindgen 0.55.1 have size_t defined as pub type size_t = ::std::os::raw::c_ulong;
where previous bindings had usize
parameters.
Ran into this trying to add bcc 0.16.0 support to the main bcc crate. Need to figure out what the right solution is here.
See rust-lang/rust-bindgen#1671 for more details on the underlying bindgen change and discussion
i found that kernel code has been supporting bpf batch update for a while, and i found bpf_map_update_batch and other methods in iovisor/bcc, when using objdump to locate symbol in the libbcc, i also find symbols which contain 'batch'
objdump -S usr/lib/libbcc.so | grep batch
The smoketest segfaults when built with the x86_64-unknown-linux-musl target. This would block support on Alpine and other musl libc based distributions or when building with musl toolchain on "normal" glibc based distributions.
Reported in rust-bpf/rust-bcc#166
x86_64-unknown-linux-musl is currently a tier 2 target for Rust (https://forge.rust-lang.org/release/platform-support.html)
I'd take a PR that addresses this, but I don't think we're going to support x86_64-unknown-linux-musl as tier 1 for the rust-bpf projects at this time.
bcc 0.12.0 was released yesterday. This issue is being opened to add bindings for the new version
bcc-sys could have bindings for bcc's User Statically-Defined Tracing (USDT) probes.
@brayniac mentioned:
It looks like we don't have anything in the bcc-sys bindings for USDT yet (searching in the repo for 'usdt' shows nothing). It's possible that some simple change is needed in the bindgen config (build.rs file) to allow USDT related bindings to be generated.
These bindings would allow to add USDT support to rust-bcc (see rust-bpf/rust-bcc#167).
I might take this on myself and report progress here depending on time and motivation.
I've searched high and low through issues and PRs and I've struggled to identify an answer, so figured I'd reach out here...
Is there a special trick to repeatably generating bindings? I'm able to run the command locally, using Ubuntu 20.04 and a system-managed installation of the BCC suite. That's on a local development machine where I've installed countless packages/dependencies over time, though.
However, attempting the same thing on a clean Ubuntu install, following the same steps as the CI scripts, results in a useless error from bindgen
about missing layout information, which I'm lead to believe indicates that I'm missing a dependency, either directly or indirectly by having a fubar'd library/package path.
I tried looking at the latest clean run of the CI for this repo itself, but it was so long ago that Github Actions doesn't even have the logs anymore. Thus, I'm here. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.