-
Notifications
You must be signed in to change notification settings - Fork 380
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
tetragon: Use static funcs in few places #2453
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
olsajiri
added
the
release-note/minor
This PR introduces a minor user-visible change
label
May 20, 2024
Add support to mark some functions as static, local and not inlined. That will give us faster verification on recent kernels. Enabling this for v6.1 onwards for now. Signed-off-by: Jiri Olsa <[email protected]>
Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ------------ --------- --------- --------------- ---------- ---------- -------------- event_execve 58536 64755 +6219 (+10.62%) 1462 1691 +229 (+15.66%) execve_rate 196 196 +0 (+0.00%) 12 12 +0 (+0.00%) execve_send 1026 1026 +0 (+0.00%) 66 66 +0 (+0.00%) bpf_generic_kprobe_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ----------------------------- --------- --------- ----------------- ---------- ---------- --------------- generic_fmodret_override 18 18 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_actions 86858 86858 +0 (+0.00%) 2724 2724 +0 (+0.00%) generic_kprobe_event 404 404 +0 (+0.00%) 29 29 +0 (+0.00%) generic_kprobe_filter_arg 181622 181622 +0 (+0.00%) 6252 6252 +0 (+0.00%) generic_kprobe_output 409 409 +0 (+0.00%) 31 31 +0 (+0.00%) generic_kprobe_override 20 20 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_process_event 129477 28117 -101360 (-78.28%) 2488 870 -1618 (-65.03%) generic_kprobe_process_filter 178641 178641 +0 (+0.00%) 7346 7346 +0 (+0.00%) generic_kprobe_setup_event 76647 30362 -46285 (-60.39%) 1731 1022 -709 (-40.96%) bpf_multi_kprobe_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ----------------------------- --------- --------- ----------------- ---------- ---------- --------------- generic_fmodret_override 18 18 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_actions 86858 86858 +0 (+0.00%) 2724 2724 +0 (+0.00%) generic_kprobe_event 419 419 +0 (+0.00%) 30 30 +0 (+0.00%) generic_kprobe_filter_arg 181622 181622 +0 (+0.00%) 6252 6252 +0 (+0.00%) generic_kprobe_output 409 409 +0 (+0.00%) 31 31 +0 (+0.00%) generic_kprobe_override 20 20 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_process_event 129477 28117 -101360 (-78.28%) 2488 870 -1618 (-65.03%) generic_kprobe_process_filter 178641 178641 +0 (+0.00%) 7346 7346 +0 (+0.00%) generic_kprobe_setup_event 76647 30362 -46285 (-60.39%) 1731 1022 -709 (-40.96%) Signed-off-by: Jiri Olsa <[email protected]>
Passing maps in exatr object for generic_actions, which will allow us to save some argument and make some functions static in following changes . Signed-off-by: Jiri Olsa <[email protected]>
bpf_generic_kprobe_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ----------------------------- --------- --------- ---------------- ---------- ---------- --------------- generic_fmodret_override 18 18 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_actions 86858 27758 -59100 (-68.04%) 2724 1013 -1711 (-62.81%) generic_kprobe_event 404 404 +0 (+0.00%) 29 29 +0 (+0.00%) generic_kprobe_filter_arg 181622 181622 +0 (+0.00%) 6252 6252 +0 (+0.00%) generic_kprobe_output 409 409 +0 (+0.00%) 31 31 +0 (+0.00%) generic_kprobe_override 20 20 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_process_event 28117 28117 +0 (+0.00%) 870 870 +0 (+0.00%) generic_kprobe_process_filter 178641 178641 +0 (+0.00%) 7346 7346 +0 (+0.00%) generic_kprobe_setup_event 30362 30362 +0 (+0.00%) 1022 1022 +0 (+0.00%) bpf_generic_retkprobe_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ---------------------------- --------- --------- ---------------- ---------- ---------- --------------- generic_retkprobe_actions 76370 26393 -49977 (-65.44%) 2380 970 -1410 (-59.24%) generic_retkprobe_event 30157 30157 +0 (+0.00%) 2148 2148 +0 (+0.00%) generic_retkprobe_filter_arg 181597 181597 +0 (+0.00%) 6252 6252 +0 (+0.00%) generic_retkprobe_output 41 41 +0 (+0.00%) 3 3 +0 (+0.00%) bpf_generic_tracepoint_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) -------------------------------- --------- --------- ---------------- ---------- ---------- --------------- generic_tracepoint_actions 90074 27431 -62643 (-69.55%) 2743 999 -1744 (-63.58%) generic_tracepoint_arg 181622 181622 +0 (+0.00%) 6252 6252 +0 (+0.00%) generic_tracepoint_event 1776 1776 +0 (+0.00%) 86 86 +0 (+0.00%) generic_tracepoint_filter 178641 178641 +0 (+0.00%) 7346 7346 +0 (+0.00%) generic_tracepoint_output 409 409 +0 (+0.00%) 31 31 +0 (+0.00%) generic_tracepoint_process_event 5544 5544 +0 (+0.00%) 390 390 +0 (+0.00%) bpf_generic_uprobe_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ----------------------------- --------- --------- ---------------- ---------- ---------- --------------- generic_uprobe_actions 76370 26393 -49977 (-65.44%) 2380 970 -1410 (-59.24%) generic_uprobe_event 281 281 +0 (+0.00%) 17 17 +0 (+0.00%) generic_uprobe_filter_arg 181622 181622 +0 (+0.00%) 6252 6252 +0 (+0.00%) generic_uprobe_output 409 409 +0 (+0.00%) 31 31 +0 (+0.00%) generic_uprobe_process_event 5544 5544 +0 (+0.00%) 390 390 +0 (+0.00%) generic_uprobe_process_filter 178641 178641 +0 (+0.00%) 7346 7346 +0 (+0.00%) generic_uprobe_setup_event 5419 5419 +0 (+0.00%) 382 382 +0 (+0.00%) bpf_multi_kprobe_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ----------------------------- --------- --------- ---------------- ---------- ---------- --------------- generic_fmodret_override 18 18 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_actions 86858 27758 -59100 (-68.04%) 2724 1013 -1711 (-62.81%) generic_kprobe_event 419 419 +0 (+0.00%) 30 30 +0 (+0.00%) generic_kprobe_filter_arg 181622 181622 +0 (+0.00%) 6252 6252 +0 (+0.00%) generic_kprobe_output 409 409 +0 (+0.00%) 31 31 +0 (+0.00%) generic_kprobe_override 20 20 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_process_event 28117 28117 +0 (+0.00%) 870 870 +0 (+0.00%) generic_kprobe_process_filter 178641 178641 +0 (+0.00%) 7346 7346 +0 (+0.00%) generic_kprobe_setup_event 30362 30362 +0 (+0.00%) 1022 1022 +0 (+0.00%) bpf_multi_retkprobe_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ---------------------------- --------- --------- ---------------- ---------- ---------- --------------- generic_retkprobe_actions 76370 26393 -49977 (-65.44%) 2380 970 -1410 (-59.24%) generic_retkprobe_event 28135 28135 +0 (+0.00%) 1923 1923 +0 (+0.00%) generic_retkprobe_filter_arg 181597 181597 +0 (+0.00%) 6252 6252 +0 (+0.00%) generic_retkprobe_output 41 41 +0 (+0.00%) 3 3 +0 (+0.00%) bpf_multi_uprobe_v61.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ----------------------------- --------- --------- ---------------- ---------- ---------- --------------- generic_uprobe_actions 76370 26393 -49977 (-65.44%) 2380 970 -1410 (-59.24%) generic_uprobe_event 284 284 +0 (+0.00%) 17 17 +0 (+0.00%) generic_uprobe_filter_arg 169723 169723 +0 (+0.00%) 5358 5358 +0 (+0.00%) generic_uprobe_output 409 409 +0 (+0.00%) 31 31 +0 (+0.00%) generic_uprobe_process_event 5544 5544 +0 (+0.00%) 390 390 +0 (+0.00%) generic_uprobe_process_filter 178641 178641 +0 (+0.00%) 7346 7346 +0 (+0.00%) generic_uprobe_setup_event 5419 5419 +0 (+0.00%) 382 382 +0 (+0.00%) bpf_fork.o.csv: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ---------------------- --------- --------- ------------ ---------- ---------- ------------- event_wake_up_new_task 1536 1536 +0 (+0.00%) 82 82 +0 (+0.00%) Signed-off-by: Jiri Olsa <[email protected]>
olsajiri
force-pushed
the
pr/olsajiri/static_funcs
branch
2 times, most recently
from
May 23, 2024 11:28
6810cb3
to
9f99281
Compare
Passing heap map to generic_process_filter to reduce the number of passed arguments, which results in simpler code generated by clang and allows us to make some calls static. Signed-off-by: Jiri Olsa <[email protected]>
Passing heap object to selector_process_filter to reduce the number of passed arguments, which results in simpler code generated by clang and allows us to make some calls static. Signed-off-by: Jiri Olsa <[email protected]>
olsajiri
force-pushed
the
pr/olsajiri/static_funcs
branch
2 times, most recently
from
May 23, 2024 12:06
0bb01eb
to
b422c22
Compare
…ruct Passing selector_filter object to selector_match to reduce the number of passed arguments, which results in simpler code generated by clang and allows us to make some calls static. Signed-off-by: Jiri Olsa <[email protected]>
Passing heap object to selector_match to reduce the number of passed arguments, which results in simpler code generated by clang and allows us to make some calls static. Signed-off-by: Jiri Olsa <[email protected]>
It's not used. Signed-off-by: Jiri Olsa <[email protected]>
bpf_generic_kprobe_v61.o: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ----------------------------- --------- --------- ---------------- ---------- ---------- --------------- generic_fmodret_override 18 18 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_actions 27387 27387 +0 (+0.00%) 993 993 +0 (+0.00%) generic_kprobe_event 357 357 +0 (+0.00%) 26 26 +0 (+0.00%) generic_kprobe_filter_arg 167281 167281 +0 (+0.00%) 5409 5409 +0 (+0.00%) generic_kprobe_output 281 281 +0 (+0.00%) 21 21 +0 (+0.00%) generic_kprobe_override 20 20 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_process_event 27264 27264 +0 (+0.00%) 773 773 +0 (+0.00%) generic_kprobe_process_filter 178641 145524 -33117 (-18.54%) 7346 5477 -1869 (-25.44%) generic_kprobe_setup_event 27430 27430 +0 (+0.00%) 782 782 +0 (+0.00%) similar stats for: bpf_generic_tracepoint_v61.o bpf_generic_uprobe_v61.o bpf_multi_kprobe_v61.o bpf_multi_uprobe_v61.o Signed-off-by: Jiri Olsa <[email protected]>
bpf_generic_kprobe_v61.o: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ----------------------------- --------- --------- -------------- ---------- ---------- -------------- generic_fmodret_override 18 18 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_actions 27387 27387 +0 (+0.00%) 993 993 +0 (+0.00%) generic_kprobe_event 357 357 +0 (+0.00%) 26 26 +0 (+0.00%) generic_kprobe_filter_arg 167281 159736 -7545 (-4.51%) 5409 4838 -571 (-10.56%) generic_kprobe_output 281 281 +0 (+0.00%) 21 21 +0 (+0.00%) generic_kprobe_override 20 20 +0 (+0.00%) 2 2 +0 (+0.00%) generic_kprobe_process_event 27264 27264 +0 (+0.00%) 773 773 +0 (+0.00%) generic_kprobe_process_filter 145598 145524 -74 (-0.05%) 5485 5477 -8 (-0.15%) generic_kprobe_setup_event 27430 27430 +0 (+0.00%) 782 782 +0 (+0.00%) similar stats for: bpf_generic_tracepoint_v61.o bpf_generic_uprobe_v61.o bpf_multi_kprobe_v61.o bpf_multi_uprobe_v61.o bpf_multi_retkprobe_v61.o: Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF) ---------------------------- --------- --------- --------------- ---------- ---------- -------------- generic_retkprobe_actions 25974 25974 +0 (+0.00%) 946 946 +0 (+0.00%) generic_retkprobe_event 21341 18385 -2956 (-13.85%) 1476 1259 -217 (-14.70%) generic_retkprobe_filter_arg 167256 159771 -7485 (-4.48%) 5409 4835 -574 (-10.61%) generic_retkprobe_output 41 41 +0 (+0.00%) 3 3 +0 (+0.00%) Signed-off-by: Jiri Olsa <[email protected]>
olsajiri
force-pushed
the
pr/olsajiri/static_funcs
branch
from
May 24, 2024 07:11
b422c22
to
775e579
Compare
kkourt
approved these changes
May 27, 2024
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.
Nice, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bpf_generic_kprobe_v61.o:
similar stats for:
bpf_generic_tracepoint_v61.o
bpf_generic_uprobe_v61.o
bpf_multi_kprobe_v61.o
bpf_multi_uprobe_v61.o
bpf_multi_retkprobe_v61.o