[bootstrap] add some compile infomation (#64)

This commit is contained in:
Ruidong-X
2023-08-17 00:54:34 +08:00
committed by GitHub
parent 4b558464b0
commit bf4fa6f9af
2 changed files with 7 additions and 2 deletions

View File

@@ -602,6 +602,7 @@ sudo dnf install clang elfutils-libelf elfutils-libelf-devel zlib-devel
编译运行上述代码: 编译运行上述代码:
```console ```console
$ git submodule update --init --recursive
$ make $ make
BPF .output/bootstrap.bpf.o BPF .output/bootstrap.bpf.o
GEN-SKEL .output/bootstrap.skel.h GEN-SKEL .output/bootstrap.skel.h

View File

@@ -191,7 +191,9 @@ int handle_exec(struct trace_event_raw_sched_process_exec *ctx)
// ... // ...
} }
```Then, we reserve an event structure from the circular buffer map `rb` and fill in the relevant data, such as the process ID, parent process ID, and process name. Afterwards, we send this data to the user-mode program for processing. ```
Then, we reserve an event structure from the circular buffer map `rb` and fill in the relevant data, such as the process ID, parent process ID, and process name. Afterwards, we send this data to the user-mode program for processing.
```c ```c
// reserve sample from BPF ringbuf // reserve sample from BPF ringbuf
@@ -515,8 +517,9 @@ In the main() function, we first parse the command line arguments, and then set
```c ```c
err = argp_parse(&argp, argc, argv, 0, NULL, NULL); err = argp_parse(&argp, argc, argv, 0, NULL, NULL);
if (err) if (err)
return err;```c return err;
libbpf_set_print(libbpf_print_fn); libbpf_set_print(libbpf_print_fn);
```
Next, we open the eBPF skeleton file, pass the minimum duration parameter to the eBPF program, and load and attach the eBPF program: Next, we open the eBPF skeleton file, pass the minimum duration parameter to the eBPF program, and load and attach the eBPF program:
@@ -597,6 +600,7 @@ sudo dnf install clang elfutils-libelf elfutils-libelf-devel zlib-devel
Compile and run the above code: Compile and run the above code:
```console ```console
$ git submodule update --init --recursive
$ make $ make
BPF .output/bootstrap.bpf.o BPF .output/bootstrap.bpf.o
GEN-SKEL .output/bootstrap.skel.h GEN-SKEL .output/bootstrap.skel.h