-
Notifications
You must be signed in to change notification settings - Fork 94
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
makefile: fix vmlinuxh rule #239
Conversation
f7bb083
to
4151df8
Compare
@if [ ! $(BPFTOOL) ]; then \ | ||
echo "ERROR: could not find bpftool"; \ | ||
exit 1; \ | ||
fi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite what was suggested in #239 (comment), this remains for now. Whether we keep an up-to-date vmlinux.h in the tree or build (and make available for consumer) the latest bpftool can be discussed in #177.
My thoughts anyway: the consumer of this library needs, for better experience, an updated tooling (bpftool in this case), which is not offered in common distros, but those that are rolling release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: why to "fix" this instead of simply adding a vmlinux.h file to the repository (from a recent enough kernel, like 5.15 or so. We can have the file "tar.bz2" and uncompressed by Makefile to save space even. @grantseltzer WDYT ? Obligating the user to have bpftool is complicated. If we pick Ubuntu distribution, for example, it depends on having package named "linux-tools-XXXX" (depending on the kernel version), and is error-prone (sometimes bpftool in a container has wrong version due to host kernel being different, and things like that).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind that by 'user' here, we're talking people who are running the selftests, not consumers of libbpfgo (where they provide their own vmlinux.h file). With that in mind, I can see it being reasonable to expect someone to have their own bpftool if their advanced enough to be running tests. On the other hand, they may be exploring bpf code for learning purposes (I think a major reason for selftests) and using a pre-made vmlinux.h would help with that.
I'm leaning towards us having an existing vmlinux.h file, but not to tar/zip it to make it more obvious what's going on. This is also what we do in tracee.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreeing with you both. I think it demands its own issue, but first let's decides the requirements.
- Remove libbpfgo Makefile bpftool requirement.
- Make available an updated pre-made vmlinux.h (I think it can be one extracted from Arch/Manjaro - due to its freshness) in the libbpfgo tree for static and dynamic compilations (format to be defined).
- Add a Makefile flag (env var) to one specify its own vmlinux.h overriding the offered by libbpfgo.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geyslan That sounds great to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: #242.
As #242 was created, I think this PR is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes: #238