Fix verified eBPF tutorial examples and instructions (#211)

* docs: fix XDP stub compile command

* docs: link hardirqs example headers

* fix: capture the actual TCP header length

* docs: refresh generated tutorial index

* Revert "docs: refresh generated tutorial index"

This reverts commit 6a2418a277.

* fix: print TCP header length as unsigned

* docs: sync TCP header debug format

* fix: address final tutorial portability review

* docs: auto-generate documentation

* Revert "docs: auto-generate documentation"

This reverts commit be93763602.

---------

Co-authored-by: LinuxDev9002 <i@littlefisher.me>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
云微
2026-07-14 14:14:09 -07:00
committed by GitHub
parent 929aec4441
commit c054586a39
9 changed files with 205 additions and 100 deletions

View File

@@ -35,6 +35,8 @@ By following the above approach, we can use hardirqs and softirqs in eBPF to cap
The main purpose of the hardirqs program is to obtain the name, execution count, and execution time of interrupt handlers and display the distribution of execution time in the form of a histogram. Let's analyze this code step by step.
The custom headers used below are part of the complete example rather than system headers. Build from the `src/10-hardirqs` directory, which contains [`hardirqs.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/hardirqs.h), [`bits.bpf.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/bits.bpf.h), and [`maps.bpf.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/maps.bpf.h) alongside the source file.
```c
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2020 Wenbo Zhang

View File

@@ -26,6 +26,8 @@ softirqs 是软件中断处理程序。它们是内核中的一种底层异步
hardirqs 程序的主要目的是获取中断处理程序的名称、执行次数和执行时间,并以直方图的形式展示执行时间的分布。让我们一步步分析这段代码。
下面引用的自定义头文件属于完整示例,并不是系统头文件。请在 `src/10-hardirqs` 目录中编译,该目录在源码旁提供了 [`hardirqs.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/hardirqs.h)、[`bits.bpf.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/bits.bpf.h) 和 [`maps.bpf.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/maps.bpf.h)。
```c
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2020 Wenbo Zhang