|
2 | 2 |
|
3 | 3 | This tutorial uses https://github.com/haolipeng/libbpf-ebpf-beginer |
4 | 4 |
|
5 | | - |
| 5 | + |
6 | 6 |
|
7 | 7 | 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. |
8 | 8 |
|
9 | | - |
| 9 | + |
10 | 10 |
|
11 | 11 | eBPF code is divided into kernel space and user space components. |
12 | 12 |
|
@@ -85,7 +85,7 @@ sudo bpftrace -l 'tracepoint:syscalls:*' |
85 | 85 |
|
86 | 86 | Using bpftrace to view the sys_enter_write function tracepoint, as shown below: |
87 | 87 |
|
88 | | - |
| 88 | + |
89 | 89 |
|
90 | 90 | # 3. eBPF User Space Programming |
91 | 91 |
|
@@ -188,27 +188,27 @@ Execute directly in the project root directory: |
188 | 188 |
|
189 | 189 | **1. Project compilation - libbpf library compilation** |
190 | 190 |
|
191 | | - |
| 191 | + |
192 | 192 |
|
193 | 193 | **2. Project compilation - bpftool library compilation** |
194 | 194 |
|
195 | | - |
| 195 | + |
196 | 196 |
|
197 | 197 | **3. Project compilation - eBPF program code compilation** |
198 | 198 |
|
199 | | - |
| 199 | + |
200 | 200 |
|
201 | 201 | After successful compilation, an executable program named `helloworld` will be generated in the src directory. |
202 | 202 |
|
203 | 203 | ## 4.2 Execution Results |
204 | 204 |
|
205 | 205 | After running the program in the src directory, you can see the program running normally. |
206 | 206 |
|
207 | | - |
| 207 | + |
208 | 208 |
|
209 | 209 | Check the process PID of the helloworld program, which is 17659: |
210 | 210 |
|
211 | | - |
| 211 | + |
212 | 212 |
|
213 | 213 | Where can you view the output results of the eBPF program? |
214 | 214 |
|
|
0 commit comments