You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+11-114
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,19 @@
2
2
# BPF Compiler Collection (BCC)
3
3
4
4
BCC is a toolkit for creating efficient kernel tracing and manipulation
5
-
programs, and includes several useful tools and examples. It makes use of eBPF
6
-
(Extended Berkeley Packet Filters), a new feature that was first added to
7
-
Linux 3.15. Much of what BCC uses requires Linux 4.1 and above.
5
+
programs, and includes several useful tools and examples. It makes use of
6
+
extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7
+
that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
8
+
and above.
8
9
9
10
eBPF was [described by](https://lkml.org/lkml/2015/4/14/232) Ingo Molnár as:
10
11
11
12
> One of the more interesting features in this cycle is the ability to attach eBPF programs (user-defined, sandboxed bytecode executed by the kernel) to kprobes. This allows user-defined instrumentation on a live kernel image that can never crash, hang or interfere with the kernel negatively.
12
13
13
-
BCC makes eBPF programs easier to write, with kernel instrumentation in C
14
-
and a front-end in Python. It is suited for many tasks, including performance
15
-
analysis and network traffic control.
14
+
BCC makes BPF programs easier to write, with kernel instrumentation in C
15
+
(and includes a C wrapper around LLVM), and front-ends in Python and lua.
16
+
It is suited for many tasks, including performance analysis and network
17
+
traffic control.
16
18
17
19
## Screenshot
18
20
@@ -170,46 +172,10 @@ The features of this toolkit include:
170
172
In the future, more bindings besides python will likely be supported. Feel free
171
173
to add support for the language of your choice and send a pull request!
172
174
173
-
## Tutorial
175
+
## Tutorials
174
176
175
-
The BCC toolchain is currently composed of two parts: a C wrapper around LLVM,
176
-
and a Python API to interact with the running program. Later, we will go into
177
-
more detail of how this all works.
178
-
179
-
### Hello, World
180
-
181
-
First, we should include the BPF class from the bpf module:
182
-
```python
183
-
from bcc importBPF
184
-
```
185
-
186
-
Since the C code is so short, we will embed it inside the python script.
187
-
188
-
The BPF program always takes at least one argument, which is a pointer to the
189
-
context for this type of program. Different program types have different calling
190
-
conventions, but for this one we don't care so `void *` is fine.
0 commit comments