]> git.ipfire.org Git - thirdparty/linux.git/commit
perf symbol: Fix ENOENT case for filename__read_build_id
authorIan Rogers <irogers@google.com>
Sun, 7 Dec 2025 02:23:45 +0000 (18:23 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 17 Dec 2025 15:30:51 +0000 (07:30 -0800)
commit5c5f6fe32df2edb4f72bdca62ec2b9f20b7c5ba4
treebf351ba9a25b63397ce6d8d5e9ac74cb98958096
parent800ad1f0e27792cddf5928f590d3f2d4ab3c68ee
perf symbol: Fix ENOENT case for filename__read_build_id

Some callers of filename__read_build_id assume the error value must be
-1, fix by making them handle all < 0 values.

If is_regular_file fails in filename__read_build_id then it could be
the file is missing (ENOENT) and it would be wrong to return
-EWOULDBLOCK in that case. Fix the logic so -EWOULDBLOCK is only
reported if other errors with stat haven't occurred.

Fixes: 834ebb5678d7 ("perf tools: Don't read build-ids from non-regular files")
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-buildid-cache.c
tools/perf/util/libbfd.c
tools/perf/util/symbol-elf.c
tools/perf/util/symbol-minimal.c