Skip to content

Commit ad926d8

Browse files
author
lipeng hao
committed
fix: download images locally to avoid Gitee hotlink protection
1 parent b68e146 commit ad926d8

10 files changed

Lines changed: 16 additions & 16 deletions

docs/guide/lesson-1-helloworld.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
This tutorial uses https://github.com/haolipeng/libbpf-ebpf-beginer
44

5-
![image-20250502173859376](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021739894.png)
5+
![eBPF Architecture](/images/lesson1-ebpf-arch.png)
66

77
This template naturally integrates libbpf, bpftool, vmlinux, and other essential components for developing eBPF programs. As eBPF developers, we only need to focus on the src source code directory.
88

9-
![image-20250502174137823](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021741038.png)
9+
![eBPF Workflow](/images/lesson1-ebpf-workflow.png)
1010

1111
eBPF code is divided into kernel space and user space components.
1212

@@ -85,7 +85,7 @@ sudo bpftrace -l 'tracepoint:syscalls:*'
8585

8686
Using bpftrace to view the sys_enter_write function tracepoint, as shown below:
8787

88-
![image-20250502181548461](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021815671.png)
88+
![eBPF Components](/images/lesson1-ebpf-components.png)
8989

9090
# 3. eBPF User Space Programming
9191

@@ -188,27 +188,27 @@ Execute directly in the project root directory:
188188
189189
**1. Project compilation - libbpf library compilation**
190190
191-
![image-20250502174937954](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021749111.png)
191+
![Hello World Code](/images/lesson1-helloworld-code.png)
192192
193193
**2. Project compilation - bpftool library compilation**
194194
195-
![image-20250502175105526](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021751776.png)
195+
![BPF Program](/images/lesson1-bpf-program.png)
196196
197197
**3. Project compilation - eBPF program code compilation**
198198
199-
![image-20250502175158625](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021752029.png)
199+
![User Program](/images/lesson1-user-program.png)
200200
201201
After successful compilation, an executable program named `helloworld` will be generated in the src directory.
202202
203203
## 4.2 Execution Results
204204
205205
After running the program in the src directory, you can see the program running normally.
206206
207-
![image-20250502180332591](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021803504.png)
207+
![Run Output](/images/lesson1-run-output.png)
208208
209209
Check the process PID of the helloworld program, which is 17659:
210210
211-
![image-20250502180224071](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021802580.png)
211+
![bpftool](/images/lesson1-bpftool.png)
212212
213213
Where can you view the output results of the eBPF program?
214214
102 KB
Loading
12.5 KB
Loading
270 KB
Loading
12.6 KB
Loading
121 KB
Loading
78.1 KB
Loading
287 KB
Loading
39.3 KB
Loading

docs/zh/guide/lesson-1-helloworld.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
采用的https://github.com/haolipeng/libbpf-ebpf-beginer
44

5-
![image-20250502173859376](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021739894.png)
5+
![eBPF 架构](/images/lesson1-ebpf-arch.png)
66

77
里面天然的引入了libbpf、bpftool、vmlinux等一系列开发ebpf程序的必备组件,我们作为编写ebpf代码的人,只需要关注src源代码目录即可。
88

9-
![image-20250502174137823](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021741038.png)
9+
![eBPF 工作流程](/images/lesson1-ebpf-workflow.png)
1010

1111
ebpf的代码是分为内核态和用户态的。
1212

@@ -95,7 +95,7 @@ sudo bpftrace -l 'tracepoint:syscalls:*'
9595

9696
使用bpftrace查看sys_enter_write这个函数跟踪点的情况,如下图所示:
9797

98-
![image-20250502181548461](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021815671.png)
98+
![eBPF 组件](/images/lesson1-ebpf-components.png)
9999

100100

101101

@@ -216,29 +216,29 @@ cleanup:
216216

217217
**1、项目编译之libbpf库编译**
218218

219-
![image-20250502174937954](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021749111.png)
219+
![Hello World 代码](/images/lesson1-helloworld-code.png)
220220

221221
**2、项目编译之bpftool库编译**
222222

223-
![image-20250502175105526](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021751776.png)
223+
![BPF 程序](/images/lesson1-bpf-program.png)
224224

225225
**3、项目编译之ebpf程序代码编译**
226226

227-
![image-20250502175158625](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021752029.png)
227+
![用户程序](/images/lesson1-user-program.png)
228228

229229
编译成功后,在src目录会生成名为helloworld的可执行程序
230230

231231
## 4、2 运行结果
232232

233233
在src目录下运行程序后,可以看到程序运行正常。
234234

235-
![image-20250502180332591](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021803504.png)
235+
![运行输出](/images/lesson1-run-output.png)
236236

237237

238238

239239
查看helloworld程序的进程pid为17659
240240

241-
![image-20250502180224071](https://gitee.com/codergeek/picgo-image/raw/master/image/202505021802580.png)
241+
![bpftool](/images/lesson1-bpftool.png)
242242

243243
在哪里查看ebpf程序的输出结果呢?
244244

0 commit comments

Comments
 (0)