summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/task-analyzer.py
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2023-05-15 16:37:47 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-05-17 08:09:23 +0300
commit10cb8622b6958c2d47961d6a42c76e6c9f1c08f3 (patch)
treef63562bbb75646e53aa233cd40d9563bd9ba2275 /tools/perf/scripts/python/task-analyzer.py
parentde58ef414d8d7a0a635cd331b3b013d8216c4e60 (diff)
downloadlinux-10cb8622b6958c2d47961d6a42c76e6c9f1c08f3.tar.xz
libbpf: Store zero fd to fd_array for loader kfunc relocation
When moving some of the test kfuncs to bpf_testmod I hit an issue when some of the kfuncs that object uses are in module and some in vmlinux. The problem is that both vmlinux and module kfuncs get allocated btf_fd_idx index into fd_array, but we store to it the BTF fd value only for module's kfunc, not vmlinux's one because (it's zero). Then after the program is loaded we check if fd_array[btf_fd_idx] != 0 and close the fd. When the object has kfuncs from both vmlinux and module, the fd from fd_array[btf_fd_idx] from previous load will be stored in there for vmlinux's kfunc, so we close unrelated fd (of the program we just loaded in my case). Fixing this by storing zero to fd_array[btf_fd_idx] for vmlinux kfuncs, so the we won't close stale fd. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20230515133756.1658301-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions