Appendix E. BPF Instructions

This appendix is a summary of selected BPF instructions, and is provided to aid in reading instruction listings from tracing tools and the source to the hello_world.c program in Appendix D. Developing BPF tracing programs from scratch directly using instructions is not recommended and not covered here.

The BPF instructions included in this appendix are only a selection. For a complete reference, see the following header files in the Linux source and the references at the end of this appendix:

  • Classic BPF: include/uapi/linux/filter.h and include/uapi/linux/bpf_common.h

  • Extended BPF: include/uapi/linux/bpf.h and include/uapi/linux/bpf_common.h

The bpf_common.h is shared between them as the encodings are mostly the ...

Get BPF Performance Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.