Commit 94416da
committed
libbpf-rs: BTF custom path setter in ObjectBuilder
Allowing to set a custom BTF path in the object builder will
reduce the boilerplate that's currently necessary. Making libbpf
use a separate BTF file is incredibly important in systems that
don't ship it. Looking at you, Nvidia and Raspberry Pi official
kernels.
It also can be very helpeful when testing for ABI changes in kernels
and it would have been quite helpful for a few investigations where
kernel changes have prevented the loading of BPF programs as they either
exposed bugs in our code.
Several users libbpf-rs that set this option currently leak memory
(which might not be a big deal since it's a one-off and not a lot of memory)
but having this as a blessed, leak-free way to do it would be great.
Test Plan
=========
Updated javierhonduco/lightswitch#367 with these
changes and verified test pass (which exercise setting an alternative
BTF path) and that ASAN reports no issues.
Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>1 parent 0f877dd commit 94416da
2 files changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| |||
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| |||
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
174 | 191 | | |
175 | 192 | | |
176 | 193 | | |
| |||
0 commit comments