https://github.com/rogercoll/learningebpf
Examples of C++ programs that generates BPF bytecodes
https://github.com/rogercoll/learningebpf
ebpf kprobes learing
Last synced: about 2 months ago
JSON representation
Examples of C++ programs that generates BPF bytecodes
- Host: GitHub
- URL: https://github.com/rogercoll/learningebpf
- Owner: rogercoll
- Created: 2020-09-22T13:07:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-20T16:09:59.000Z (over 4 years ago)
- Last Synced: 2025-10-08T20:19:53.503Z (9 months ago)
- Topics: ebpf, kprobes, learing
- Language: C++
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Learing eBPF
## Prerequisits
In Debian systems we can easily install the needed libs with:
```
sudo apt install libelf-dev libbpfcc-dev bpfcc-tools clang
```
## Usage
To generate and attach the BPF probes to the kernel we just need to compile and run the desired program:
```
make APP=file_name_without_cpp
sudo ./file_name_without_cpp
```
## Kprobes
- [Hello clone syscall](./hello_clone.cpp): Insert a hello world message for every clone syscall.
- [mmap syscall](./mmap1.cpp): Insert a hello world message for every mmap syscall.