git clone https://github.com/bpftools/linux-observability-with-bpf.git ~/linux-observability-with-bpf IMPORTANT NOTE: The examples assume that you clone the repo in your home folder~/linux-observability-with-bpf, if you didn't do please remember to change your commands!
BPF Map是可以与BPF程序分离的,即当创建一个BPF Map的BPF程序运行结束后,该BPF Map还能存在,而不是随着程序一起消亡 基于上面两个特点,意味着我们可以利用BPF Map持久化数据,在不丢失重要数据的同时,更新BPF程序逻辑,实现在不同程序之间共享信息,在收集统计信息或指标等场景下,尤其有用。 BPF超功能的核心技能点—...
《Linux Observability with BPF》,作者David Calavera和Lorenzo Fontana, 这本书篇幅不长,是来自sysdig的两位大佬写的BPF手册书,推荐入门阅读 《Linux内核观测技术BPF》,是最近刚出版的第一本BPF中文书籍,为上面英文书的翻译版本,由范彬和狄卫华两位翻译 《BPF Performance Tools》,这是Brendan Gregg大神对于BPF技术如何...
当前涉及的 BPF 工具就属于可观测性工具,它们使用BPF 技术进行可编程型跟踪分析。 BCC、bpftrace和IO Visor 直接通过BPF 指令编写BPF程序是非常烦琐的,开发了可以提供高级语言编程支持的BPF前端;在跟踪用途方面,主要的前端是BCC和bpftrace。 BCC BCC(BPF 编译器集合,BPF Compiler Collection)是最早用于开发 BPF 跟踪程...
BPF全称是「Berkeley Packet Filter」,翻译过来是「伯克利包过滤器」,顾名思义,它是在伯克利大学诞生的,1992年Steven McCanne 和 Van Jacobson 写了一篇《The BSD Packet Filter: A New Architecture for User-level Packet Capture》论文,第一次提出了BPF技术,在文中,作者描述了他们如何在Unix内核实现网络数据包过...
Chapter 4. Tracing with BPF In software engineering, tracing is a method to collect data for profiling and debugging. The objective is to provide useful information at runtime for future … - Selection from Linux Observability with BPF [Book]
可观测性(observability) 指通过全面观测来理解一个系统,可以实现这一目标的工具就可以归类为可观测性工具。这其中包括跟踪工具、采样工具和基于固定计数器的工具。但不包括基准测量 (benchmark) 工具,基准测量工具在系统上模拟业务负载会更改系统的状态。 当前涉及的 BPF 工具就属于可观测性工具,它们使用 BPF 技术进行...
$ gitclonehttps://github.com/libbpf/libbpf $cdlibbpf/src$ make -j8 && make install 原生C Hello world 参考:https://github.com/bpftools/linux-observability-with-bpf/tree/master/code/chapter-2/hello_world $ gitclonehttps://github.com/bpftools/linux-observability-with-bpf ...
编译bpf helloworld 切换到https://github.com/bpftools/linux-observability-with-bpf的helloworld目录 sed -i 's;/kernel-src;/root/linux;' Makefilemake 有报错: 参考:http://www.helight.info/blog/2021/build-kernel-ebpf-sample/解决 cp /root/linux/include/uapi/linux/bpf.h /usr/include/linux/bpf...
5.编译成功,可以执行samples/bpf中的可执行文件。 编译运行自己开发的代码 1. 下载linux source code,编译内核并升级 git clonehttps://github.com/torvalds/linux.git cd linux/ git checkout -b v5.0 v5.0 配置文件 cp -a /boot/config-4.14.81.bm.15-amd64 ./.config ...