summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/task-analyzer.py
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-09-02 11:17:13 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-09 18:58:25 +0200
commit203719d82999b70832f1d6e72c53968a347edd93 (patch)
tree87e9edf0488c4cd3be6dde5c1013eee49fdcfeb5 /tools/perf/scripts/python/task-analyzer.py
parent150101bbe24ab9841f39e661bd8ddb1070aa7d3f (diff)
perf bpf-utils: Harden get_bpf_prog_info_linear
[ Upstream commit 01be43f2a0eaeed83e94dee054742f37625c86d9 ] In get_bpf_prog_info_linear two calls to bpf_obj_get_info_by_fd are made, the first to compute memory requirements for a struct perf_bpil and the second to fill it in. Previously the code would warn when the second call didn't match the first. Such races can be common place in things like perf test, whose perf trace tests will frequently load BPF programs. Rather than a debug message, return actual errors for this case. Out of paranoia also validate the read bpf_prog_info array value. Change the type of ptr to avoid mismatched pointer type compiler warnings. Add some additional debug print outs and sanity asserts. Closes: https://lore.kernel.org/lkml/CAP-5=fWJQcmUOP7MuCA2ihKnDAHUCOBLkQFEkQES-1ZZTrgf8Q@mail.gmail.com/ Fixes: 6ac22d036f86 ("perf bpf: Pull in bpf_program__get_prog_info_linear()") Reviewed-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250902181713.309797-4-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions