-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: Allow union argument in trampoline based programs #5965
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: Allow union argument in trampoline based programs #5965
Conversation
|
Upstream branch: b13448d |
|
Upstream branch: b13448d |
c1146cb to
c5e771e
Compare
|
Upstream branch: b13448d |
c5e771e to
b8fd965
Compare
2b3c471 to
2211108
Compare
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 in verifier.
Signed-off-by: Leon Hwang <[email protected]>
Reviewed-by: Amery Hung <[email protected]>
As verifier allows functions with 'union' argument can be traced, add 'union' arguments support in trampoline if the argument's size is in range '(8, 16]'. Signed-off-by: Leon Hwang <[email protected]>
By referencing commit 1642a39 ("selftests/bpf: Add struct argument tests with fentry/fexit programs."), test the following cases for union argument support: * 8B union argument. * 16B union argument. cd tools/testing/selftests/bpf ./test_progs -t tracing_struct/union_args 472/3 tracing_struct/union_args:OK 472 tracing_struct:OK Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Leon Hwang <[email protected]>
|
Upstream branch: 180a46b |
b8fd965 to
f0a942c
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1002979 expired. Closing PR. |
Pull request for series with
subject: bpf: Allow union argument in trampoline based programs
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1002979