The raw BCC bindings generated by jextract for libbcc on 64-bit systems and the generation code wrapping jextract. This library is used by hello-ebpf to access the BCC library.
These bindings are regularly updated and published on Maven Central:
<dependency>
<groupId>me.bechberger</groupId>
<artifactId>rawbcc</artifactId>
<version>0.1.4</version>
</dependency>
The bindings include the headers listed in misc/bcc_headers.h.
The bindings are located in the me.bechberger.ebpf.bcc.raw
package,
with the main classes being Lib
and Lib_1
.
To load the libbcc, there is a helper class LibraryLoader
:
LibraryLoader.load()
loads the library from the classpath and exits the JVM if it failsLibraryLoader.isInstalled()
checks if the library is installed on the system
- Java 22
- Linux 64-bit
- libbcc (see bcc installation instructions, be sure to install the libbpfcc-dev package)
- I know that the packages there are outdated for some distributions, but installing the packages from other repositories crashed my system...
- e.g.
apt install bpfcc-tools libbpfcc-dev linux-tools-common linux-tools-$(uname -r)
on Ubuntu
Additional Requirements:
- Python 3.8+
- clang (for jextract)
- Maven 3.6.3 (or newer to build the project)
Build the project with mvn package
.
Be sure to update the version both in the README and the pom and then run mvn clean deploy
.
Apache 2.0, Copyright 2023 SAP SE or an SAP affiliate company, Johannes Bechberger and contributors