How Do I Profile eBPF Code?

(naveensrinivasan.com)

67 points | by snaveen 2 hours ago

3 comments

  • okzgn 1 hour ago
    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).

    • snaveen 1 hour ago
      Thank you for these references! I wasn't aware of these papers.
    • tanelpoder 16 minutes ago
      [dead]
  • jeffbee 58 minutes ago
    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.
    • snaveen 33 minutes ago
      Thank you for the additional insights.
  • 000000001 26 minutes ago
    Lob and Mob.