On Tue, Jul 11, 2023 at 9:20 AM Lorenz Bauer <lmb@xxxxxxxxxxxxx> wrote: > > On Thu, Jul 6, 2023 at 10:07 PM Andrii Nakryiko > <andrii.nakryiko@xxxxxxxxx> wrote: > > > > I think it's better the other way around: make BTF_TYPE_ID_LOCAL strip > > const/volatile/restrict modifiers. For all other relocations we rely > > on having named types, so const/volatile makes no sense and will fail > > relocation. It's hard to come up with the situation where recording > > const/volatile/restrict in BTF_TYPE_ID_LOCAL would make sense, so I'd > > say that it should behave just like all the other relos. > > Would the relocation then point at the stripped type instead of the > start of the qualifier chain? I found this by running our unit tests yep, I think it makes most sense. Important is to not skip typedef, it's not really a modifier (and libbpf code base makes it very explicit, unlike in-kernel handling of typedef as a modifier). > which essentially check that the compiler generated local ID from the > instruction stream matches what the lib generates. I'd like to be able > to keep doing this.