diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2023-03-27 21:52:00 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-30 03:22:01 +0300 |
commit | d6e6286a12e7b8a4ddc66237c4ccf6f531ef1c82 (patch) | |
tree | 5c7001ce51c15d89048d48672f91fe6c230ff458 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 8b52cc2a2fef541d605debb7efc7dc1bae7b2876 (diff) | |
download | linux-d6e6286a12e7b8a4ddc66237c4ccf6f531ef1c82.tar.xz |
libbpf: disassociate section handler on explicit bpf_program__set_type() call
If user explicitly overrides programs's type with
bpf_program__set_type() API call, we need to disassociate whatever
SEC_DEF handler libbpf determined initially based on program's SEC()
definition, as it's not goind to be valid anymore and could lead to
crashes and/or confusing failures.
Also, fix up bpf_prog_test_load() helper in selftests/bpf, which is
force-setting program type (even if that's completely unnecessary; this
is quite a legacy piece of code), and thus should expect auto-attach to
not work, yet one of the tests explicitly relies on auto-attach for
testing.
Instead, force-set program type only if it differs from the desired one.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230327185202.1929145-2-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions