Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Benchmarks] - Create/Find useful short benchmarks #54

Open
Dwctor opened this issue Mar 4, 2025 · 4 comments
Open

[Benchmarks] - Create/Find useful short benchmarks #54

Dwctor opened this issue Mar 4, 2025 · 4 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Dwctor
Copy link
Collaborator

Dwctor commented Mar 4, 2025

Honey Potion keeps benchmarks in the benchmarks folder. As it stands, we have a few examples from BPFabric and IOVisor. Some of those are already implemented into Honey Potion, namely HelloWorld, CountSysCalls, ForceKill, TrafficCount and DropUDP. You could imagine the benchmarks folder as an eventual "Target".

Currently we are seeking for more benchmarks that have a real-world usage and that are simple. As an example, CountSysCalls Counts system calls (and prints), but doesn't do anything else with it, as it's objective is solely one functionality of what could be a useful full program.

These benchmarks should follow the same convention as the others:

/bench_name/
|_ Makefile
|_ README.md
|_ prog.bpf.c
|_ prog.c
|_ prog.h (Optional)

If you have ideas for benchmarks, but aren't sure if it's worth implementing or adding, feel free to comment on this issue!

@Dwctor Dwctor added good first issue Good for newcomers help wanted Extra attention is needed labels Mar 4, 2025
@pronesto
Copy link
Contributor

Hi guys! I would like to suggest four monitors as new benchmarks, in case anyone is willing to work on this issue:

  • CPU Monitor: an eBPF program that profiles CPU usage by recording timestamps and stack traces at regular intervals. For instance, the eBPF program can sample CPU usage periodically and calculate metrics such as CPU utilization percentage, breakdown of CPU time spent on user-space versus kernel-space, and top processes consuming CPU time.
  • Memory Monitor: an eBPF program that tracks memory allocations and deallocations, monitors memory usage per process, and provides metrics such as total memory usage, memory fragmentation, and memory leak detection.
  • Disk Monitor: an eBPF program that monitors disk I/O operations (reads and writes), tracks disk I/O latency, and provides statistics on disk usage per process and file.
  • Network Monitor: an eBPF program that captures network packets, classifies traffic based on protocols or applications, measures network bandwidth usage, and detects anomalies such as excessive network traffic or suspicious network activity.

Below there is an example of some output that I think it would be nice to have:

{
  "cpu_usage": {
    "total_utilization": 75.3,
    "user_space_utilization": 45.2,
    "kernel_space_utilization": 30.1,
    "top_processes": [
      {"pid": 1234, "name": "nginx", "cpu_usage": 25.0},
      {"pid": 5678, "name": "mysql", "cpu_usage": 20.3}
    ]
  },
  "memory_usage": {
    "total_memory": 8 GB,
    "used_memory": 6 GB,
    "free_memory": 2 GB,
    "top_processes": [
      {"pid": 1234, "name": "nginx", "memory_usage": 2.5 GB},
      {"pid": 5678, "name": "mysql", "memory_usage": 1.8 GB}
    ]
  },
  "disk_io": {
    "read_ops": 1000,
    "write_ops": 800,
    "average_latency": 5 ms
  },
  "network_traffic": {
    "total_packets": 10000,
    "total_bytes": 10 MB,
    "top_applications": [
      {"name": "httpd", "packets": 5000, "bytes": 5 MB},
      {"name": "ssh", "packets": 3000, "bytes": 3 MB}
    ]
  }
}

@sleipnir
Copy link
Collaborator

This remind me of Bayla Project

@ChrystianMSC
Copy link

Hi everyone!

I'll be working on this issue for now. If you need anything or have any advice or suggestions, feel free to reach out to me anytime.

@Dwctor
Copy link
Collaborator Author

Dwctor commented Mar 18, 2025

Honey Potion, especially the Elixir side, is extremely well documented in the markdown files. Here's a few I suggest you look (in order) into to have an overview of the project!

  • README.md -> General description and user guide
  • docs/README.md -> Explanation of the folder structure of the project and it's purpose
  • docs/Honey.md -> Quick description of all main modules of Elixir (helps to skim the code later without needing to read deeper into it)
  • docs/Language.md -> Short explanation of the permitted user language in Honey Potion
  • docs/Makefile.md -> Arguably the most important for your task, it explains how our makefile that compiles the code in C into eBPF works.

Other benchmarks can be found in benchmarks/<benchmark_name> , try and compile a few of them and execute it. Also feel free to use them as template to build more advanced versions (such as borrowing the HelloWorld).

If you have any doubts or have any issues, feel free to contact me or open an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants