Appendix D. C BPF
This appendix shows examples of BPF tools implemented in C, either as compiled C programs or executed via the perf(1) utility. This appendix is optional material for those readers who are interested in developing a deeper understanding of how BPF works, as well as other BPF interfaces that are supported by the Linux kernel.
Chapter 5 covers how to develop tools in bpftrace, a higher-level language that is expected to be sufficient and preferred in many cases, and Appendix C covers the BCC interface as another preferred option. This appendix is a follow-on from the BPF sections in Chapter 2.
This appendix begins with a discussion on C programming and five tips before you begin. The first program included is hello_world.c, for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access