On Fri, 2023-12-08 at 15:35 +0000, Alan Maguire wrote: [...] > > Tbh, I like the decl tag approach a bit more too. > > Although macro definition would be somewhat ridiculous: > > > > #if __has_attribute(preserve_static_offset) && defined(__bpf__) > > #define __bpf_ctx __attribute__((preserve_static_offset)) \ > > __attribute__((btf_decl_tag("preserve_static_offset"))) > > #else > > #define __bpf_ctx > > #endif > > > > As macro definitions go, that's not that ridiculous ;-) Fair enough :) > If we add it to vmlinux.h, would be good to have a > > #ifdef BPF_NO_PRESERVE_STATIC_OFFSET > #undef __bpf_ctx > #define __bpf_ctx > #endif > > ...too, just in case the user wanted to use CO-RE with any of the types > covered. Thanks! Will do. Thanks, Eduard.