Notes on BPF and eBPF

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • mysqld-bpf

  • BPF is indeed a pretty interesting technology. As the knowledge about it becomes more widespread, I anticipate that we will unlock some new capabilities both in terms of tracing. Brendan Gregg's book (https://www.brendangregg.com/bpf-performance-tools-book.html) serves as a good intro to this, although you probably only need to read a small chunk of it as a lot of it is reference-book-style material.

    The author's mentioned that you can trace MySQL with USDT, which is a tracepoint inserted by the developer at select locations in the code. Unfortunately, this feature has been removed in MySQL 8.0. This makes it significantly more difficult to trace MySQL, although it's not impossible. I've done a proof of concept of this in this repo with uprobe[1], which indeed allow you to hook into any userspace function. This is not stable tho, as any MySQL upgrade risks incompatibilities, while USDT would be stable. My appeal to Oracle to re-add this functionality[2] has been unfortunately rejected, which I think is a mistake.

    [1]: https://github.com/shuhaowu/mysqld-bpf

    [2]: https://bugs.mysql.com/bug.php?id=105741

    Another thing that I've been recently thinking of is using BPF to validate programs written for real-time Linux (via PREEMPT_RT). To my understanding, one of the main thing to avoid is page faults [3]. With the proper BPF tracing scripts, I think we can validate that programs indeed avoids page faults in integration testing. I'm not sure if it is super useful yet, but as I'm trying to write a few RT programs, it's something that came to my mind.

    [3]: https://lwn.net/Articles/837019/

    In addition to tracing (so bpftrace-based/bcc-based tools), I've recently discovered that there there are:

    1. ebpfsnitch (https://github.com/harporoeder/ebpfsnitch): which is an application-level firewall without kernel modules.

    2. ebpf-traffic-monitor (https://source.android.com/devices/tech/datausage/ebpf-traff...): which appears to be using BPF to account for traffic for different apps on Android.

    There are apparently also use cases in the context of security, but I'm not familiar with it.

  • ebpfsnitch

    Linux Application Level Firewall based on eBPF and NFQUEUE.

  • BPF is indeed a pretty interesting technology. As the knowledge about it becomes more widespread, I anticipate that we will unlock some new capabilities both in terms of tracing. Brendan Gregg's book (https://www.brendangregg.com/bpf-performance-tools-book.html) serves as a good intro to this, although you probably only need to read a small chunk of it as a lot of it is reference-book-style material.

    The author's mentioned that you can trace MySQL with USDT, which is a tracepoint inserted by the developer at select locations in the code. Unfortunately, this feature has been removed in MySQL 8.0. This makes it significantly more difficult to trace MySQL, although it's not impossible. I've done a proof of concept of this in this repo with uprobe[1], which indeed allow you to hook into any userspace function. This is not stable tho, as any MySQL upgrade risks incompatibilities, while USDT would be stable. My appeal to Oracle to re-add this functionality[2] has been unfortunately rejected, which I think is a mistake.

    [1]: https://github.com/shuhaowu/mysqld-bpf

    [2]: https://bugs.mysql.com/bug.php?id=105741

    Another thing that I've been recently thinking of is using BPF to validate programs written for real-time Linux (via PREEMPT_RT). To my understanding, one of the main thing to avoid is page faults [3]. With the proper BPF tracing scripts, I think we can validate that programs indeed avoids page faults in integration testing. I'm not sure if it is super useful yet, but as I'm trying to write a few RT programs, it's something that came to my mind.

    [3]: https://lwn.net/Articles/837019/

    In addition to tracing (so bpftrace-based/bcc-based tools), I've recently discovered that there there are:

    1. ebpfsnitch (https://github.com/harporoeder/ebpfsnitch): which is an application-level firewall without kernel modules.

    2. ebpf-traffic-monitor (https://source.android.com/devices/tech/datausage/ebpf-traff...): which appears to be using BPF to account for traffic for different apps on Android.

    There are apparently also use cases in the context of security, but I'm not familiar with it.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Dear ImGui version v1.90.6 released

    1 project | news.ycombinator.com | 8 May 2024
  • Qt and C++ Trivial Relocation (Part 1)

    3 projects | news.ycombinator.com | 7 May 2024
  • Kubernetes and Docker Desktop for Fast Local Development

    2 projects | dev.to | 8 May 2024
  • Building composable applications: Playing with building blocks

    2 projects | dev.to | 8 May 2024
  • Dotsig: A powerful tool to create or verify digital signatures on-the-fly

    1 project | news.ycombinator.com | 8 May 2024