logo
logo

老乡,内核 3.10 的机器可以跑 eBPF 了!

向阳 2024-02-04

DeepFlow 的 eBPF 特性支持 RedHat/CentOS 的 3.10 内核了!

0x0: RedHat/CentOS 做了什么

日前,DeepFlow 一名潜在客户提到红帽在 3.10 内核中移植了一部分 eBPF 特性,让我司研发评估 DeepFlow 适配的可能性。在红帽的文章中提到:

eBPF in Red Hat Enterprise Linux 7.6 is enabled only for tracing purposes, which allows attaching eBPF programs to probes, tracepoints and perf events. Other use cases such as eBPF socket filters or eXpress DataPath (XDP) are not enabled at this stage.

好巧不巧,对于可观测性场景来讲恰好也够用了!这个评估工作早年我们实际上有过心动,但考虑到发行版的限制以及红帽的免责声明最终放弃了在 DeepFlow 中进行支持。此次由于得到了客户的鼓励,我们正式开启了严谨的评估、适配、测试的工作,并且于近日 DeepFlow 6.4 LTS 发布前顺利完成。

0x1: DeepFlow 做了什么

总结来讲,目前 DeepFlow 中的 eBPF 能力(AutoTracing、AutoProfiling)对内核版本的要求如下:

体系架构 发行版 内核版本 kprobe [4] Golang uprobe OpenSSL uprobe perf
X86 CentOS 7.9 3.10.0 [1] Y Y [2] Y [2] Y
RedHat 7.6 3.10.0 [1] Y Y [2] Y [2] Y
* 4.9-4.13 Y
* 4.14 [3] Y Y [2] Y
* 4.15 Y Y [2] Y
* 4.16 Y Y Y
* 4.17+ Y Y Y Y
ARM CentOS 8 4.18 Y Y Y Y
EulerOS 5.10+ Y Y Y Y
麒麟 KylinOS V10 SP3+ 4.19.90-52.25+ Y Y Y Y
其他发行版 5.8+ Y Y Y Y

上表中对内核版本的额外说明:

  • [1]: 在这两个发行版中,DeepFlow 支持版本号高于 3.10.0-940 的内核
  • [2]: 目前尚不支持使用 uprobe hook 在容器内部运行的 Golang/OpenSSL 进程
  • [3]: 在内核 4.14 版本中,一个 tracepoint 不能被多个 eBPF program attach(如:不能同时运行两个或多个 deepflow-agent),其他版本不存在此问题
  • [4]: 包括 kprobe 和 tracepoint

0x2: 注意事项

虽然红帽有下述免责声明,但目前我们已经测试了 3.10.0-940 之上的几个小版本内核,若对 DeepFlow 中零侵扰的分布式追踪能力有强烈需求,可以一试:

The eBPF in Red Hat Enterprise Linux 7.6 is provided as Tech Preview and thus doesn’t come with full support and is not suitable for deployment in production. It is provided with the primary goal to gain wider exposure, and potentially move to full support in the future. eBPF in Red Hat Enterprise Linux 7.6 is enabled only for tracing purposes, which allows attaching eBPF programs to probes, tracepoints and perf events.

对于 Preview 类新特性,这时候 eBPF 的核心优势就能体现价值了:安全,不崩

0x3: 什么是 DeepFlow

DeepFlow 是云杉网络开发的一款可观测性产品,旨在为复杂的云基础设施及云原生应用提供深度可观测性。DeepFlow 基于 eBPF 实现了应用性能指标、分布式追踪、持续性能剖析等观测信号的零侵扰(Zero Code)采集,并结合智能标签(SmartEncoding)技术实现了所有观测信号的全栈(Full Stack)关联和高效存取。使用 DeepFlow,可以让云原生应用自动具有深度可观测性,从而消除开发者不断插桩的沉重负担,并为 DevOps/SRE 团队提供从代码到基础设施的监控及诊断能力。

GitHub 地址:https://github.com/deepflowio/deepflow

访问 DeepFlow Demo,体验零插桩、全覆盖、全关联的可观测性。