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/perf
Arnaldo Carvalho de Melo 1c85c94b37 perf bench futex: Fix prctl include in musl libc
Namhyung Kim reported:

  I've updated the perf-tools-next to v6.16-rc1 and found a build error
  like below on alpine linux 3.18.

    In file included from bench/futex.c:6:
    /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
       88 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
    In file included from bench/futex.c:5:
    /linux/tools/include/uapi/linux/prctl.h:134:8: note: originally defined here
      134 | struct prctl_mm_map {
          |        ^~~~~~~~~~~~
    make[4]: *** [/linux/tools/build/Makefile.build:86: /build/bench/futex.o] Error 1

  git bisect says it's the first commit introduced the failure.

So both /usr/include/sys/prctl.h and /linux/tools/include/uapi/linux/prctl.h
provide struct prctl_mm_map but their include guard must be different.

/usr/include/sys/prctl.h provided by glibc contains the
prctl() declaration. It includes also linux/prctl.h.

The /usr/include/sys/prctl.h on alpine linux is different. This is
probably coming from musl. It contains the PR_* definition and the
prctl() declaration.  So it clashes here because now the one struct is
available twice.

The man page for prctl(2) says:

|       #include <linux/prctl.h>  /* Definition of PR_* constants */
|       #include <sys/prctl.h>

so musl doesn't follow this.

So don't include linux/prctl.h explicitely and add some new defines
needed if they aren't available.

Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reported-by: Namhyung Kim <namhyung@kernel.org>
Closes: https://lore.kernel.org/r/20250611092542.F4ooE2FL@linutronix.de
Link: https://www.openwall.com/lists/musl/2025/06/12/11
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2025-06-17 18:29:42 -03:00
..
arch perf pmu intel: Adjust cpumaks for sub-NUMA clusters on graniterapids 2025-05-22 23:15:48 -03:00
bench perf bench futex: Fix prctl include in musl libc 2025-06-17 18:29:42 -03:00
check-header_ignore_hunks/lib perf tools: update expected diff for lib/list_sort.c 2024-11-05 17:12:33 -08:00
dlfilters perf tools: Simplify evsel__add_modifier() 2024-10-22 09:52:11 -07:00
Documentation perf mem: Document new output fields (op, cache, mem, dtlb, snoop) 2025-06-16 14:05:10 -03:00
include/perf
jvmti
pmu-events perf metricgroup: Binary search when resolving referred to metrics 2025-05-13 16:36:51 -03:00
python perf python: Add counting.py as example for counting perf events 2025-05-22 22:24:58 -03:00
scripts perf scripts python: exported-sql-viewer.py: Fix pattern matching with Python 3 2025-05-12 14:18:16 -03:00
tests perf test: Directory file descriptor leak 2025-06-17 18:29:42 -03:00
trace perf beauty: Update copy of linux/socket.h with the kernel sources 2025-06-16 14:05:11 -03:00
ui perf mem: Show absolute percent in mem_stat output 2025-05-28 14:42:20 -03:00
util perf evsel: Missed close() when probing hybrid core PMUs 2025-06-17 16:55:24 -03:00
.gitignore perf tools: Add the empty-pmu-events build to .gitignore 2024-11-07 10:51:56 -08:00
Build perf build: Add pylint build tests 2025-03-24 09:38:20 -07:00
builtin-annotate.c perf annotate: Add --code-with-type option. 2025-03-13 00:19:51 -07:00
builtin-bench.c
builtin-buildid-cache.c perf dso: Add reference count checking and accessor functions 2024-05-06 15:28:49 -03:00
builtin-buildid-list.c perf buildid-list: Use perf_tool__init 2024-08-12 18:07:10 -03:00
builtin-c2c.c perf hist: Set levels in output_field_add() 2025-04-25 12:31:54 -03:00
builtin-check.c perf check: Add tip about building with libbfd using BUILD_NONDISTRO=1 2025-04-10 10:45:15 -03:00
builtin-config.c perf config: Add a function to set one variable in .perfconfig 2025-01-14 15:05:56 -03:00
builtin-daemon.c perf daemon: Fix the build on more 32-bit architectures 2024-08-19 21:44:30 -03:00
builtin-data.c
builtin-diff.c perf stream: Use evsel rather than evsel->idx 2024-12-23 13:53:08 -03:00
builtin-evlist.c perf evlist: Print hint for group 2024-09-11 13:08:45 -03:00
builtin-ftrace.c perf ftrace: Use process/session specific trace settings 2025-05-20 13:11:09 -03:00
builtin-help.c perf tools: Remove dependency on libaudit 2025-01-10 10:59:42 -03:00
builtin-inject.c perf inject: Fix use without initialization of local variables 2025-01-14 14:57:19 -03:00
builtin-kallsyms.c perf dso: Add reference count checking and accessor functions 2024-05-06 15:28:49 -03:00
builtin-kmem.c perf evsel: Add/use accessor for tp_format 2024-12-09 17:52:42 -03:00
builtin-kvm.c perf kvm: Move functions used in util out of builtin 2024-12-18 16:24:32 -03:00
builtin-kwork.c perf kwork: Make perf_kwork_add_work a callback 2024-12-18 16:24:33 -03:00
builtin-list.c perf list: Display the PMU name associated with a perf metric in JSON 2025-05-13 17:06:14 -03:00
builtin-lock.c perf lock contention: Reject more than 10ms delays for safety 2025-05-31 08:45:24 -03:00
builtin-mem.c perf mem: Don't leak mem event names 2025-03-10 14:26:45 -07:00
builtin-probe.c perf build: Rename HAVE_DWARF_SUPPORT to HAVE_LIBDW_SUPPORT 2024-10-18 10:17:40 -07:00
builtin-record.c perf record: Fix incorrect --user-regs comments 2025-05-28 14:10:56 -03:00
builtin-report.c perf mem: Display sort order only if it's available 2025-05-28 14:41:42 -03:00
builtin-sched.c perf cpumap: Reduce transitive dependencies on libperf MAX_NR_CPUS 2024-12-09 17:52:41 -03:00
builtin-script.c perf script: Display off-cpu samples correctly 2025-05-05 21:51:31 -03:00
builtin-stat.c perf metricgroup: Binary search when resolving referred to metrics 2025-05-13 16:36:51 -03:00
builtin-timechart.c perf timechart: Remove redundant variable assignment 2024-11-13 16:27:35 -03:00
builtin-top.c perf evlist: Make uniquifying counter names consistent 2025-05-14 09:36:21 -03:00
builtin-trace.c perf trace: Set errpid to false for rseq and set_robust_list 2025-05-29 22:09:37 -03:00
builtin-version.c perf check: Share the feature status printing routine with 'perf version' 2025-04-10 10:44:04 -03:00
builtin.h perf check: Allow showing a tip for opt-in features not built into perf 2025-04-10 10:44:42 -03:00
check-headers.sh tools arch amd ibs: Sync ibs.h with the kernel sources 2025-06-17 16:53:22 -03:00
command-list.txt
CREDITS
design.txt
Makefile perf tools: Fix wrong message when running "make JOBS=1" 2024-08-01 12:11:33 -03:00
Makefile.config Merge remote-tracking branch 'torvalds/master' into perf-tools-next 2025-05-07 12:51:38 -03:00
Makefile.perf perf tests: Fix 'perf report' tests installation 2025-05-09 14:10:08 -03:00
MANIFEST perf tools: Fix arm64 source package build 2025-05-13 17:26:35 -03:00
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf tools: Remove dependency on libaudit 2025-01-10 10:59:42 -03:00
perf.h perf: Increase MAX_NR_CPUS to 4096 2024-12-09 17:52:41 -03:00