Closed brianwitte closed 1 month ago
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). The following contributors of this PR have not signed the OCA:
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.
When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.
If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.
These appear to be what the gcc bpf backend is throwing warnings about:
bpf-gcc -g -O2 -g -fno-stack-protector -Wall -D__TARGET_ARCH_x86 -gbtf -mcpu=v3 -Wno-error=attributes -Wno-error=address-of-packed-member -Wno-compare-distinct-pointer-types -I../include -I/usr/include -I/usr/include/libnl3 -I../include/uapi -c tcp_buffer_tuner.bpf.c \
-o tcp_buffer_tuner.bpf.o
In file included from ../include/bpftune/bpftune.bpf.h:36,
from tcp_buffer_tuner.bpf.c:20:
../include/bpftune/vmlinux_x86_64.h:5: warning: ignoring ‘#pragma clang attribute’ [-Wunknown-pragmas]
5 | #pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)
../include/bpftune/vmlinux_x86_64.h:121955: warning: ignoring ‘#pragma clang attribute’ [-Wunknown-pragmas]
121955 | #pragma clang attribute pop
]
Here are the files grepped from project root:
$ rg "#pragma clang"
include/bpftune/bpftune.bpf.h
284:#pragma clang loop unroll(full)
include/bpftune/vmlinux_x86_64.h
5:#pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)
121955:#pragma clang attribute pop
include/bpftune/vmlinux_aarch64.h
5:#pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)
135255:#pragma clang attribute pop
Let me know how I can help with this! :smiley:
Thank you for signing the OCA.
your efforts are greatly appreciated, thanks Brian! On the subject of the warnings, the push attribute for Compile Once, Run Everywhere (CO-RE) is in the bpftool-generated vmlinux files as you've observed. That attribute is not supported in gcc so there are efforts upstream to support a gcc-friendly vmlinux.h generation. That said, gcc-bpf does support CO-Re so I think we should be able to get BTF relocations to work regardless. I suggest we regenerate our vmlinux.h files once the upstream efforts are complete.
Ok, got it! Thank you for getting back to the PR so quickly. That was awesome.
I will look into what the upstream situation is and see if I can get clarity on options available for bpftune
.
thanks for working on this! see this thread for more on the bpftool stuff: https://lore.kernel.org/bpf/20240507095011.15867-1-jose.marchesi@oracle.com/
Hey, Alan.
Thanks for all the work on bpftune (and your informative talks on BTF :smile: ).
I wanted to begin the process of porting
bpftune
to support the BPF backend for gcc.I started with the Makefile(s).
On my fork, you can:
It compiles successfully (and throws warnings due to ignoring unkown clang #pragmas).
Then you can run
bpftune
in legacy mode:Below are the specifications for the machine I am testing on. I use upstream Debian for my work as much as possible:
I was wondering how I could help
bpftune
support the gcc backend for BPF and getbpftune
to work "fully" out of the box with it.