-
Notifications
You must be signed in to change notification settings - Fork 165
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
new(driver/bpf): added bpf configure system similar to the kmod one. #1729
Conversation
Then, added fix for rss_stat becoming an array in kernel 6.2. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Please double check driver/API_VERSION file. See versioning. /hold |
// struct mm_struct declaration | ||
#include <linux/mm_types.h> | ||
|
||
#ifdef BPF_SUPPORTS_RAW_TRACEPOINTS |
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.
Below follows the same macro found in probe.c
.
/unhold |
/hold |
Kernel tests against this branch:
|
/unhold |
/milestone next-driver |
/milestone 0.15.0 |
Now we are able to build bpf probe from installed path. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
$(info [configure-bpf] Including $(MAKEFILE_INC_FILES)) | ||
include $(MAKEFILE_INC_FILES) | ||
endif | ||
|
||
$(obj)/probe.o: $(src)/probe.c \ |
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.
probe.o
target must be visible when our makefile is called by kernel's makefile, ie: when we fall in the else
branch now.
# MIT.txt or GPL.txt for full copies of the license. | ||
# | ||
|
||
always-y += test.o |
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.
In this makefile we want to build a stupidly simple bpf probe.
Note: for bpf we don't need the changes from #1734. |
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.
Seems quite nice! Love all these improvements.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@@ -27,16 +27,6 @@ or GPL2.txt for full copies of the license. | |||
#include "fillers.h" | |||
#include "builtins.h" | |||
|
|||
#ifdef BPF_SUPPORTS_RAW_TRACEPOINTS |
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.
Moved to types.h
.
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP, jasondellaluce The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
/kind feature
Any specific area of the project related to this PR?
/area driver-bpf
Does this PR require a change in the driver versions?
What this PR does / why we need it:
This is the corrispettive of #1452 for bpf.
Moreover, it also adds a fix for rss_stat becoming an array in kernel 6.2 (this was backported in centos 5.14: https://falcosecurity.github.io/libs/matrix_X64/#centos-514-bpf-probe_build).
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
While we could somehow reuse same code used for kmod, i preferred to duplicate it a bit but at the same time making the code driver-dependent since we might have to add very specific/different test cases in the future (imagine if eg: some kernel backported
BPF_FUNC_ktime_get_boot_ns
or if we want to enableBPF_SUPPORTS_RAW_TRACEPOINTS
by checking that the kernel has backported some features...)Indeed the very first test case added, ie: checking for
rss_stat
field being an array inmm_struct
kernel structure, could also be made as a simpler kmod configure module and then its define added to bpf driver too, somehow.Does this PR introduce a user-facing change?: