Commit eafcaa1
bpf: Allow union argument in trampoline based programs
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]>1 parent 2b3c471 commit eafcaa1
3 files changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
1122 | 1125 | | |
1123 | 1126 | | |
1124 | 1127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
407 | 412 | | |
408 | 413 | | |
409 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6762 | 6762 | | |
6763 | 6763 | | |
6764 | 6764 | | |
6765 | | - | |
| 6765 | + | |
6766 | 6766 | | |
6767 | 6767 | | |
6768 | 6768 | | |
| |||
7334 | 7334 | | |
7335 | 7335 | | |
7336 | 7336 | | |
7337 | | - | |
| 7337 | + | |
7338 | 7338 | | |
7339 | 7339 | | |
7340 | 7340 | | |
| |||
7347 | 7347 | | |
7348 | 7348 | | |
7349 | 7349 | | |
| 7350 | + | |
| 7351 | + | |
7350 | 7352 | | |
7351 | 7353 | | |
7352 | 7354 | | |
| |||
7384 | 7386 | | |
7385 | 7387 | | |
7386 | 7388 | | |
7387 | | - | |
| 7389 | + | |
7388 | 7390 | | |
7389 | 7391 | | |
7390 | 7392 | | |
| |||
0 commit comments