A real-time system call monitoring and optimization tool using eBPF, Flask, and optional AI (Groq API) for performance analysis and smart recommendations.
- 🟢 Real-time monitoring with eBPF
- 📊 Execution time & resource metrics (CPU, memory, I/O)
- 📁 Categorization of syscalls: File I/O, Process, Memory, IPC, etc.
- 🤖 AI-generated optimization tips (Groq API)
- 🛠️ Rule-based fallback suggestions
- 🌐 Clean Flask web UI with auto-refresh
- 🔍 API endpoints for programmatic access
- Linux with eBPF support (Kernel ≥ 4.1)
- Python 3.6+
- BCC (BPF Compiler Collection)
git clone https://github.com/yourusername/ai-system-call-optimizer.git
cd ai-system-call-optimizerpip install -r requirements.txt🔸 Note: The
bccPython package requires BCC system packages. Install them first.
sudo apt-get install bpfcc-tools linux-headers-$(uname -r)Refer to the official BCC installation guide.
To enable AI optimization:
export GROQ_API_KEY=your_api_key_herepython app.pyexport PORT=8080
python app.pyVisit: http://localhost:5000 (The page auto-refreshes every 5 seconds.)
| Endpoint | Description |
|---|---|
/performance |
Get live syscall performance data |
/recommendations |
Get AI-based or rule-based optimization suggestions |
/categories |
View syscall categories and groupings |
/syscall/<syscall> |
Get detailed metrics for a specific syscall |
Example:
curl http://localhost:5000/syscall/write- Groq API Key: Set
GROQ_API_KEYas an environment variable. - Performance Threshold: Defined in
AISystemCallOptimizer(default:0.05s) - Refresh Interval: Modify
REFRESH_INTERVAL(default:5seconds)
- eBPF overhead is minimal but can slightly impact very high-load systems.
- Groq API calls are async/lightweight and do not block real-time monitoring.
- Requires root to attach eBPF probes:
sudo python app.py- Ensure the host system is secure. eBPF can access kernel-level metrics.
We love contributions! Here’s how to get started:
- Fork the repo
- Create a new branch (
git checkout -b feature-name) - Commit your changes
- Push to your branch (
git push origin feature-name) - Open a Pull Request 🚀
You can also:
- Open Issues for bugs or feature suggestions
- Discuss ideas via GitHub Discussions
This project is licensed under the MIT License.
See the LICENSE file for full details.
- 📷 Screenshot Placeholder: Replace
path/to/screenshot.pngabove with your image file or a hosted URL. - 📦 requirements.txt:
Flask
groq
psutil
bcc
numpy
python-dotenv


