Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bpf-internals-2.md #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bpf-internals-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ This inturn calls [`map_update_elem()`](http://lxr.free-electrons.com/source/ker

So probably, things will start falling into pieces now from the [earlier post](http://www.brendangregg.com/blog/2015-05-15/ebpf-one-small-step.html) by Brendan Gregg where he was updating a map from the BPF program (using the `BPF_CALL` instruction which calls the internal [kernel helpers](http://lxr.free-electrons.com/source/kernel/bpf/helpers.c)) and then concurrently accessing it from userspace to generate a beautiful histogram (through the syscall I just mentioned above). BPF Maps are indeed a very powerful addition to the system. You can also checkout more detailed and complete [examples](https://github.com/iovisor/bcc/tree/master/examples) now that you know what is going on. To summarize, this is how an example BPF program written in restricted C for kernel part (`foo_kern.c`) and normal C for userspace part (`foo_user.c`) would run these days:

[![img] (https://suchakra.files.wordpress.com/2015/08/ebpf-session.png)](https://suchakra.files.wordpress.com/2015/08/ebpf-session.png)
[![img](https://suchakra.files.wordpress.com/2015/08/ebpf-session.png)](https://suchakra.files.wordpress.com/2015/08/ebpf-session.png)

In the next BPF post, I will discuss the eBPF verifier in detail. This is the most crucial part of BPF and deserves detailed attention I think. There is also something cool happening these days on the Plumgrid side I think - the [BPF Compiler Collection](https://github.com/iovisor/bcc). There was a very interesting demo using such tools and the power of eBPF at the recent Red Hat Summit. I got BCC working and tried out some examples with probes - where I could easily compile and load BPF programs from my Python scripts! How cool is that :) Also, I have been digging through the LTTng's interpreter lately so probably another post detailing how the BPF and LTTng's interpreters work would be nice to know. That's all for now. Run BPF.