From bf4fa6f9af3755722d1afd1ad9f563398a6cfff0 Mon Sep 17 00:00:00 2001 From: Ruidong-X Date: Thu, 17 Aug 2023 00:54:34 +0800 Subject: [PATCH] [bootstrap] add some compile infomation (#64) --- src/11-bootstrap/README.md | 1 + src/11-bootstrap/README_en.md | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/11-bootstrap/README.md b/src/11-bootstrap/README.md index 98a7b95..d76a373 100644 --- a/src/11-bootstrap/README.md +++ b/src/11-bootstrap/README.md @@ -602,6 +602,7 @@ sudo dnf install clang elfutils-libelf elfutils-libelf-devel zlib-devel 编译运行上述代码: ```console +$ git submodule update --init --recursive $ make BPF .output/bootstrap.bpf.o GEN-SKEL .output/bootstrap.skel.h diff --git a/src/11-bootstrap/README_en.md b/src/11-bootstrap/README_en.md index 50139ad..c850c14 100644 --- a/src/11-bootstrap/README_en.md +++ b/src/11-bootstrap/README_en.md @@ -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 // reserve sample from BPF ringbuf @@ -515,8 +517,9 @@ In the main() function, we first parse the command line arguments, and then set ```c err = argp_parse(&argp, argc, argv, 0, NULL, NULL); if (err) - return err;```c + return err; 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: @@ -597,6 +600,7 @@ sudo dnf install clang elfutils-libelf elfutils-libelf-devel zlib-devel Compile and run the above code: ```console +$ git submodule update --init --recursive $ make BPF .output/bootstrap.bpf.o GEN-SKEL .output/bootstrap.skel.h