You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Five BPF attributes are restricted to C in clang (LangOpts = [COnly] in clang/include/clang/Basic/Attr.td): preserve_access_index, preserve_static_offset, btf_decl_tag, btf_type_tag and bpf_fastcall. In C++ they are dropped with a -Wignored-attributes warning.
Effects:
The #pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record) in vmlinux.h has no effect, so plain field accesses get fixed offsets instead of CO-RE relocations.
__kptr, __percpu_kptr, __contains, __arg_ctx, __arg_nonnull and similar tags are missing from BTF, so kptrs in maps, lists, rbtrees and global functions with tagged arguments are rejected by the verifier.
struct__attribute__((preserve_access_index)) task { int pid; int tgid; };
intf(structtask *t) { return t->tgid; }
In C this gives CO-RE <byte_off> struct task::tgid; in C++ it compiles to a plain load at offset 4.
Activity