diff options
author | Eduard Zingerman <eddyz87@gmail.com> | 2025-01-15 14:38:35 -0800 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2025-01-16 15:33:58 -0800 |
commit | 7c311b7cb3c7d84c5c342e803c5cb1b2fabbc438 (patch) | |
tree | 44672c606fd07d5cc8011029851b96d8d0ed0caa /scripts/extract-fwblobs | |
parent | a8d1c48d0720140b53063ff23507845bb2078e92 (diff) |
veristat: Load struct_ops programs only once
libbpf automatically adjusts autoload for struct_ops programs,
see libbpf.c:bpf_object_adjust_struct_ops_autoload.
For example, if there is a map:
SEC(".struct_ops.link")
struct sched_ext_ops ops = {
.enqueue = foo,
.tick = bar,
};
Both 'foo' and 'bar' would be loaded if 'ops' autocreate is true,
both 'foo' and 'bar' would be skipped if 'ops' autocreate is false.
This means that when veristat processes object file with 'ops',
it would load 4 programs in total: two programs per each
'process_prog' call.
The adjustment occurs at object load time, and libbpf remembers
association between 'ops' and 'foo'/'bar' at object open time.
The only way to persuade libbpf to load one of two is to adjust map
initial value, such that only one program is referenced.
This patch does exactly that, significantly reducing time to process
object files with big number of struct_ops programs.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250115223835.919989-1-eddyz87@gmail.com
Diffstat (limited to 'scripts/extract-fwblobs')
0 files changed, 0 insertions, 0 deletions