Commit be15077
libbpf-cargo: Simplify build_btf_mmap() test helper
The build_btf_mmap() function 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>1 parent 3b30d20 commit be15077
2 files changed
+21
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
| |||
1174 | 1179 | | |
1175 | 1180 | | |
1176 | 1181 | | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
1184 | 1186 | | |
1185 | 1187 | | |
1186 | 1188 | | |
1187 | | - | |
| 1189 | + | |
1188 | 1190 | | |
1189 | 1191 | | |
1190 | | - | |
1191 | | - | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
1192 | 1195 | | |
1193 | | - | |
| 1196 | + | |
1194 | 1197 | | |
1195 | | - | |
1196 | | - | |
| 1198 | + | |
| 1199 | + | |
1197 | 1200 | | |
1198 | 1201 | | |
1199 | 1202 | | |
1200 | | - | |
| 1203 | + | |
1201 | 1204 | | |
1202 | 1205 | | |
1203 | 1206 | | |
| |||
0 commit comments