diff options
author | 2024-03-06 12:45:22 +0200 | |
---|---|---|
committer | 2024-03-06 15:18:15 -0800 | |
commit | fe9d049c3da06373a1a35914b7f695509e4cb1fe (patch) | |
tree | 6c12581c804da865f4d0f7bf2b224e1d0543f90a /tools/perf/scripts/python/export-to-postgresql.py | |
parent | selftests/bpf: Test autocreate behavior for struct_ops maps (diff) | |
download | wireguard-linux-fe9d049c3da06373a1a35914b7f695509e4cb1fe.tar.xz wireguard-linux-fe9d049c3da06373a1a35914b7f695509e4cb1fe.zip |
libbpf: Sync progs autoload with maps autocreate for struct_ops maps
Automatically select which struct_ops programs to load depending on
which struct_ops maps are selected for automatic creation.
E.g. for the BPF code below:
SEC("struct_ops/test_1") int BPF_PROG(foo) { ... }
SEC("struct_ops/test_2") int BPF_PROG(bar) { ... }
SEC(".struct_ops.link")
struct test_ops___v1 A = {
.foo = (void *)foo
};
SEC(".struct_ops.link")
struct test_ops___v2 B = {
.foo = (void *)foo,
.bar = (void *)bar,
};
And the following libbpf API calls:
bpf_map__set_autocreate(skel->maps.A, true);
bpf_map__set_autocreate(skel->maps.B, false);
The autoload would be enabled for program 'foo' and disabled for
program 'bar'.
During load, for each struct_ops program P, referenced from some
struct_ops map M:
- set P.autoload = true if M.autocreate is true for some M;
- set P.autoload = false if M.autocreate is false for all M;
- don't change P.autoload, if P is not referenced from any map.
Do this after bpf_object__init_kern_struct_ops_maps()
to make sure that shadow vars assignment is done.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240306104529.6453-9-eddyz87@gmail.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions