Live data from Hacker News

How Do I Profile eBPF Code?

naveensrinivasan.com

1–10 of 10 posts

Re: How Do I Profile eBPF Code?

#2
Here are some complementary resources/papers:

1. Performance of eBPF LSM Hooks: https://dl.acm.org/doi/10.1145/3672197.3673431 (Analyzes the overhead introduced by LSM/tracing hooks on the kernel).

2. Performance of eBPF Maps: https://dl.acm.org/doi/10.1145/3672197.3673430 (Useful context for the htab_map_hash bottleneck shown in the perf report).

3. Network eBPF performance: https://blog.apnic.net/2026/03/25/demystifying-performance-o... (Great broader context on eBPF overhead).

Re: How Do I Profile eBPF Code?

#3
post #2

Here are some complementary resources/papers: 1. Performance of eBPF LSM Hooks: https://dl.acm.org/doi/10.1145/3672197.3673431 (Analyzes the overhead introduced by LSM/tracing hooks on the kernel). 2. Performance of eBPF Maps: https://dl.acm.org/doi/10.1145/3672197.3673430 (Useful context for the htab_map_hash bottleneck shown in the perf report). 3. Network eBPF performance: https://blog.apnic.net/2026/03/25/demysti…

Thank you for these references! I wasn't aware of these papers.

Re: How Do I Profile eBPF Code?

#4
In addition to cycles, I suggest gathering TLB miss rates. eBPF isn't magical and any maps of significant size may pollute your virtual address translation caches. The last time someone asked me to profile eBPF at work, over 90% of the cycle time was attributable to page table walks, and this also had severe collateral impact on the applications.

Re: How Do I Profile eBPF Code?

#5
post #4

In addition to cycles, I suggest gathering TLB miss rates. eBPF isn't magical and any maps of significant size may pollute your virtual address translation caches. The last time someone asked me to profile eBPF at work, over 90% of the cycle time was attributable to page table walks, and this also had severe collateral impact on the applications.

Thank you for the additional insights.

Re: How Do I Profile eBPF Code?

#7
post #2

Here are some complementary resources/papers: 1. Performance of eBPF LSM Hooks: https://dl.acm.org/doi/10.1145/3672197.3673431 (Analyzes the overhead introduced by LSM/tracing hooks on the kernel). 2. Performance of eBPF Maps: https://dl.acm.org/doi/10.1145/3672197.3673430 (Useful context for the htab_map_hash bottleneck shown in the perf report). 3. Network eBPF performance: https://blog.apnic.net/2026/03/25/demysti…

[dead]

Re: How Do I Profile eBPF Code?

#8
Last month I wrote a tool called "brr" - eBPF Runtime Reporter and Profiler. It displays a bpftop-like eBPF program summary, but you can also zoom into any program to see its source code lines (if available) and profile the eBPF program activity and any kernel code activity called/caused by the eBPF program for the full picture of where your eBPF program time/latency is spent.

I wrote it mostly with Codex for my own use, but just pushed the latest release to GitHub (with screenshots) in case anyone else is interested:

https://github.com/tanelpoder/brr

Re: How Do I Profile eBPF Code?

#10

Last month I wrote a tool called "brr" - eBPF Runtime Reporter and Profiler. It displays a bpftop -like eBPF program summary, but you can also zoom into any program to see its source code lines (if available) and profile the eBPF program activity and any kernel code activity called/caused by the eBPF program for the full picture of where your eBPF program time/latency is spent. I wrote it mostly with Codex for my own…

Thanks for sharing this - its very interesting! I'll poke at it during my next BPF lab session ..