Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler error on riscv64 by regenerating vmlinux.h #74

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

kxxt
Copy link
Contributor

@kxxt kxxt commented Sep 1, 2024

Fixes https://archriscv.felixc.at/.status/log.htm?url=logs/retsnoop/retsnoop-0.10-1.log

calib_feat.bpf.c:86:74: error: no member named 'cookie' in 'struct bpf_attr::(unnamed at riscv/vmlinux.h:3603:2)'
   86 |         has_rawtp_cookie = bpf_core_field_exists(union bpf_attr, raw_tracepoint.cookie);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
.output/include/bpf/bpf_core_read.h:188:49: note: expanded from macro 'bpf_core_field_exists'
  188 |         __builtin_preserve_field_info(___bpf_field_ref(field), BPF_FIELD_EXISTS)
      |                                       ~~~~~~~~~~~~~~~~~^~~~~~
.output/include/bpf/bpf_core_read.h:173:52: note: expanded from macro '___bpf_field_ref'
  173 |         ___bpf_apply(___bpf_field_ref, ___bpf_narg(args))(args)
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
.output/include/bpf/bpf_core_read.h:167:62: note: expanded from macro '___bpf_field_ref2'
  167 | #define ___bpf_field_ref2(type, field)  (___bpf_typeof(type)->field)
      |                                          ~~~~~~~~~~~~~~~~~~~~~^~~~~
1 error generated.

It should also fix this bug for aarch64 and other architectures as it appears only x86 vmlinux.h is regenerated recently and has cookie field.

Signed-off-by: kxxt <rsworktech@outlook.com>
Signed-off-by: kxxt <rsworktech@outlook.com>
@kxxt
Copy link
Contributor Author

kxxt commented Sep 1, 2024

BTW the headers are generated based on linux v6.10.7

@anakryiko
Copy link
Owner

Note, I mitigated this particular problem with 05dd738, but having updated vmlinux.h is great, thanks!

@anakryiko anakryiko merged commit d06e008 into anakryiko:master Sep 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants