2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/tools/lib/perf
James Clark 8988c4b919 perf tools: Fix in-source libperf build
When libperf is built alone in-source, $(OUTPUT) isn't set. This causes
the generated uapi path to resolve to '/../arch' which results in a
permissions error:

  mkdir: cannot create directory '/../arch': Permission denied

Fix it by removing the preceding '/..' which means that it gets
generated either in the tools/lib/perf part of the tree or the OUTPUT
folder. Some other rules that rely on OUTPUT further refine this
conditionally depending on whether it's an in-source or out-of-source
build, but I don't think we need the extra complexity here. And this
rule is slightly different to others because the header is needed by
both libperf and Perf. This is further complicated by the fact that Perf
always passes O=... to libperf even for in source builds, meaning that
OUTPUT isn't set consistently between projects.

Because we're no longer going one level up to try to generate the file
in the tools/ folder, Perf's include rule needs to descend into libperf.
Also fix the clean rule while we're here.

Reported-by: Thorsten Leemhuis <linux@leemhuis.info>
Closes: https://lore.kernel.org/linux-perf-users/7703f88e-ccb7-4c98-9da4-8aad224e780f@leemhuis.info/
Fixes: bfb713ea53 ("perf tools: Fix arm64 build by generating unistd_64.h")
Signed-off-by: James Clark <james.clark@linaro.org>
Tested-by: Thorsten Leemhuis <linux@leemhuis.info>
Link: https://lore.kernel.org/r/20250429-james-perf-fix-libperf-in-source-build-v1-1-a1a827ac15e5@linaro.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2025-04-29 12:32:31 -07:00
..
Documentation libperf cpumap: Remove perf_cpu_map__read() 2024-12-09 17:52:41 -03:00
include perf cpumap: Reduce cpu size from int to int16_t 2025-02-27 08:47:25 -08:00
tests libperf cpumap: Replace usage of perf_cpu_map__new(NULL) with perf_cpu_map__new_online_cpus() 2023-12-12 14:55:13 -03:00
.gitignore libperf: Add gitignore 2024-08-01 12:11:33 -03:00
Build libperf: Change tests to single static and shared binaries 2021-07-07 11:41:58 -03:00
core.c
cpumap.c perf cpumap: Reduce cpu size from int to int16_t 2025-02-27 08:47:25 -08:00
evlist.c Merge remote-tracking branch 'torvalds/master' into perf-tools-next 2024-12-13 11:53:27 -03:00
evsel.c tools/perf: Correctly calculate sample period for inherited SAMPLE_READ values 2024-10-02 14:58:03 -07:00
internal.h
lib.c libperf: Add preadn() 2022-05-23 10:11:12 -03:00
libperf.map libperf cpumap: Remove perf_cpu_map__read() 2024-12-09 17:52:41 -03:00
libperf.pc.template
Makefile perf tools: Fix in-source libperf build 2025-04-29 12:32:31 -07:00
mmap.c perf record: Fix comment misspellings 2024-04-26 22:13:10 -03:00
threadmap.c libperf: Add API for allocating new thread map array 2022-02-23 14:40:23 -03:00
xyarray.c