Skip to content

Commit

Permalink
cleanup(docs): update README testing instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Melissa Kilby <[email protected]>
  • Loading branch information
incertum authored and poiana committed Aug 25, 2023
1 parent a0d1359 commit c670f57
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,14 @@ This repository includes convenient test example binaries for both `scap` and `s

When developing new features, you would run either one depending on what you're working on, in order to test and validate your changes.

> __NOTE:__ When you're working on driver development, it can be quite useful to make use of the kernel's built-in `printk` functionality. We also provide build flags to enable `BPF_DEBUG`. However, for the traditional bpf driver, you'll need to uncomment a line in the [bpf Makefile](driver/bpf/Makefile) first. Any logs generated by `bpf_printk()` will be written to `/sys/kernel/debug/tracing/trace_pipe`. Just make sure you have the right permissions set up for this.
> __NOTE:__ When you're working on driver development, it can be quite useful to make use of the kernel's built-in `printk` functionality. However, for the traditional bpf driver, you'll need to uncomment a line in the [bpf Makefile](driver/bpf/Makefile) first and use a dedicated build flag `BPF_DEBUG`. For modern BPF, use the build flag `MODERN_BPF_DEBUG_MODE`. Any logs generated by `bpf_printk()` will be written to `/sys/kernel/debug/tracing/trace_pipe`. Just make sure you have the right permissions set up for this.
Here's an example of a `cmake` command that will enable everything you need for all tests and components. By default, the following flags are disabled, with the exception of `USE_BUNDLED_DEPS` and `CREATE_TEST_TARGETS` (they are enabled by default).

```bash
cmake \
-DUSE_BUNDLED_DEPS=ON \
-DBUILD_LIBSCAP_MODERN_BPF=ON \
-DBUILD_MODERN_BPF_TEST=ON \
-DBUILD_LIBSCAP_GVISOR=ON \
-DBUILD_BPF=ON \
-DBUILD_DRIVER=ON \
Expand All @@ -266,7 +265,7 @@ cmake \
-DENABLE_VM_TESTS=ON ../;
```

> __TIP:__ Installing and using the package `ccache`, e.g. `-DCMAKE_CXX_COMPILER_LAUNCHER=ccache` can optimize repeated testing.
> __TIP:__ Installing and using the package `ccache` can optimize repeated testing, but we don't offer official support or testing for it.
```bash
nproc=$(grep processor /proc/cpuinfo | tail -n 1 | awk '{print $3}');
Expand Down

0 comments on commit c670f57

Please sign in to comment.