mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-12 14:45:49 +08:00
20 lines
329 B
C
20 lines
329 B
C
#ifndef BPF_NO_PRESERVE_ACCESS_INDEX
|
|
#pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)
|
|
#endif
|
|
|
|
struct data {
|
|
int a;
|
|
int c;
|
|
int d;
|
|
};
|
|
|
|
#ifndef BPF_NO_PRESERVE_ACCESS_INDEX
|
|
#pragma clang attribute pop
|
|
#endif
|
|
|
|
|
|
int add_test(struct data *d) {
|
|
return d->a + d->c;
|
|
}
|
|
|