Prerequisites
BPF Compiler Collection (BCC)
eBPF Event Interceptor requires the BCC framework to compile and run eBPF programs. The CMake build system can automatically set up BCC on Ubuntu, or you can install it manually.- Ubuntu 20.04 / 18.04
- Other Distributions
The included CMake configuration will automatically install BCC if not found:If you prefer to install BCC manually:
Build Dependencies
Install the required build tools:Minimum versions:
- CMake 3.10 or later
- GCC with C++11 support
Build and Install
Configure with CMake
Generate build files. Add Expected output:
-DSETUP_TESTS=ON to build test executables:If BCC is not found, the build system will automatically run installation scripts for Ubuntu. This requires an internet connection and may take several minutes.
Compile the libraries
Build using all available CPU cores:This compiles:
libtcpEvent.so- TCP event interceptor librarylibudpEvent.so- UDP event interceptor library- Test executables (if
SETUP_TESTS=ON)
Build Options
Customize the build with CMake options:| Option | Description | Default |
|---|---|---|
-DSETUP_TESTS=ON | Build test executables | OFF |
Example: Full Build with Tests
Verify Installation
Run test programs (optional)
If you built with tests, run the test executables:You should see TCP events from active connections on your system:For UDP monitoring:
Test programs run indefinitely and print events in real-time. Press
Ctrl+C to exit.Troubleshooting
BCC Not Found
Error:BCC not found
Solution: The build system will attempt automatic installation on Ubuntu. For other distributions, install BCC manually following the official guide.
Missing Kernel Headers
Error:fatal error: linux/bpf.h: No such file or directory
Solution: Install kernel headers:
Permission Denied
Error:Operation not permitted when running test programs
Solution: eBPF operations require root privileges. Run with sudo:
Library Not Found at Runtime
Error:error while loading shared libraries: libtcpEvent.so
Solution: Add the installation path to your library search path:
/etc/ld.so.conf.d/realtimekql.conf:
Next Steps
Quick Start Guide
Learn how to use the libraries in your own applications