forked from libbpf/libbpf-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libbpf-cargo: Simplify build_btf_mmap() test helper
The build_btf_mmap() is almost comically complex in what it does. In order to compile a single .bpf.c file it creates an entire Cargo Rust project and builds that, instead of simply compiling the file directly. Now that we have the BpfObjBuilder type, we can just about accomplish the latter without jumping through dozens of hoops. Do it. As a pleasant side effect of this reduction in complexity, the btf_dump test runtime more than halves: Before: $ time target/debug/deps/libbpf_cargo-37cf1fde780326f7 btf_dump > running 34 tests > [...] > ________________________________________________________ > Executed in 2.09 secs fish external After: $ time target/debug/deps/libbpf_cargo-37cf1fde780326f7 btf_dump > running 34 tests > [...] > ________________________________________________________ > Executed in 810.13 millis fish external Not the motivating factor at this point, but we take it. Signed-off-by: Daniel Müller <deso@posteo.net>
- Loading branch information
Showing
2 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters