-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: Support fentry/fexit for functions with union args #5902
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
bpf: Support fentry/fexit for functions with union args #5902
Conversation
|
Upstream branch: 9621eb6 |
c979e9f to
2d215b0
Compare
|
Upstream branch: e12873e |
b8b1cff to
fda342c
Compare
2d215b0 to
05282f4
Compare
|
Upstream branch: 93a83d0 |
fda342c to
9efc41f
Compare
05282f4 to
e2bfc81
Compare
|
Upstream branch: 60ef541 |
9efc41f to
f3a953f
Compare
e2bfc81 to
ba991b7
Compare
|
Upstream branch: f859813 |
Currently, functions with 'union' arguments cannot be traced with
fentry/fexit:
bpftrace -e 'fentry:release_pages { exit(); }' -v
AST node count: 6
Attaching 1 probe...
ERROR: Error loading BPF program for fentry_vmlinux_release_pages_1.
Kernel error log:
The function release_pages arg0 type UNION is unsupported.
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
ERROR: Loading BPF object(s) failed.
The type of the 'release_pages' argument is defined as:
typedef union {
struct page **pages;
struct folio **folios;
struct encoded_page **encoded_pages;
} release_pages_arg __attribute__ ((__transparent_union__));
This patch relaxes the restriction by allowing function arguments of type
'union' to be traced.
Signed-off-by: Leon Hwang <[email protected]>
Adding verifier test for accessing union argument in tracing programs. The test program loads 1st argument of bpf_fentry_test11 function which is union and checks that verifier allows that. cd tools/testing/selftests/bpf ./test_progs -t verifier_btf_ctx 501/7 verifier_btf_ctx_access/btf_ctx_access union arg accept:OK 501 verifier_btf_ctx_access:OK Summary: 1/7 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Leon Hwang <[email protected]>
f3a953f to
1e15f4f
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=999345 expired. Closing PR. |
Pull request for series with
subject: bpf: Support fentry/fexit for functions with union args
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=999345