BCC — eBPF Tracing and Performance Analysis Tools for Linux
A toolkit for creating efficient kernel tracing and manipulation programs using eBPF. BCC includes over 100 ready-to-use tools for performance analysis, networking, and security observability on Linux systems.
What it is
BCC (BPF Compiler Collection) is a toolkit for creating and using eBPF tracing programs on Linux. It includes over 100 ready-to-use tools for performance analysis, networking debugging, and security observability: trace new process execution, monitor file opens, measure disk I/O latency, sniff DNS queries, and more. All without kernel module compilation or system restarts.
BCC targets SREs, performance engineers, kernel developers, and security teams who need deep visibility into Linux system behavior at the kernel level.
How it saves time or tokens
Traditional Linux debugging involves combining strace, perf, tcpdump, and custom scripts. Each tool covers one dimension. BCC provides purpose-built tools that answer specific questions immediately: which processes are consuming the most disk I/O, what syscalls are failing, which TCP connections have high latency. One command gives you answers that would take multiple tools and post-processing scripts.
How to use
- Install BCC tools:
sudo apt-get install bpfcc-tools linux-headers-$(uname -r)
- Run built-in tools (requires root):
sudo execsnoop-bpfcc # Trace new process execution
sudo opensnoop-bpfcc # Trace file opens
sudo biolatency-bpfcc # Disk I/O latency histogram
sudo tcpconnect-bpfcc # Trace TCP connections
- Each tool outputs real-time data. Use Ctrl+C to stop and see summaries.
Example
# Find which processes are doing the most disk I/O
sudo biotop-bpfcc
# Trace DNS queries
sudo dnssnoop-bpfcc
# Measure function latency in a running process
sudo funclatency-bpfcc -p $(pidof myapp) 'malloc'
# Count syscalls by process
sudo syscount-bpfcc -p $(pidof nginx)
Each command provides kernel-level insights with minimal overhead.
Related on TokRepo
- Monitoring Tools -- System observability and monitoring tools
- Security Tools -- Security analysis and observability
Common pitfalls
- BCC tools require root access and kernel headers. Missing kernel headers is the most common installation failure. Ensure
linux-headers-$(uname -r)is installed. - eBPF programs run in kernel space. A buggy custom eBPF program can impact system stability. Stick to the pre-built tools unless you understand eBPF verification.
- BCC has higher startup overhead than bpftrace because it compiles BPF programs at runtime. For frequently run tools, consider pre-compiled alternatives.
Frequently Asked Questions
BCC works on Linux kernels 4.1+ with eBPF support. Most modern distributions (Ubuntu 18.04+, RHEL 8+, Debian 10+) include eBPF support. Older kernels may lack required eBPF features.
BCC provides Python and Lua APIs for writing eBPF programs plus 100+ pre-built tools. bpftrace is a higher-level tracing language for one-liners. Use BCC tools for ready-made analysis; use bpftrace for custom ad-hoc queries.
eBPF programs add minimal overhead because they run in the kernel with JIT compilation. The overhead is typically less than 1% for most tracing tools. However, high-frequency tracepoints can add measurable cost.
Yes. BCC provides Python and C APIs for writing custom eBPF programs. You write the eBPF code in C (runs in kernel) and the control logic in Python (runs in userspace).
Yes. The pre-built BCC tools are widely used in production at major companies. The eBPF verifier in the kernel ensures programs cannot crash the system. Always test custom tools in staging first.
Citations (3)
- BCC GitHub— 100+ eBPF tracing tools for Linux
- eBPF Documentation— eBPF technology for kernel tracing
- Brendan Gregg BPF Tools— Linux performance analysis with BPF tools
Related on TokRepo
Discussion
Related Assets
Moodle — Open-Source Learning Management System
The most widely used open-source learning platform, providing course management, assessments, and collaboration tools for educators and organizations worldwide.
Sylius — Headless E-Commerce Framework on Symfony
An open-source headless e-commerce platform built on Symfony and API Platform, designed for developers who need a customizable and API-first commerce solution.
Akaunting — Free Self-Hosted Accounting Software
A free, open-source online accounting application built on Laravel for small businesses and freelancers to manage invoices, expenses, and financial reports.