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/bench
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
..
bench.h perf bench uprobe: Add uretprobe variant of uprobe benchmarks 2024-04-12 17:54:02 -03:00
breakpoint.c perf bench breakpoint: Skip run if no breakpoints available 2023-08-23 08:39:02 -03:00
Build tools/perf: Allow to select the number of hash buckets 2025-05-03 12:02:10 +02:00
epoll-ctl.c tools/perf: Fix perf bench epoll to enable the run when some CPU's are offline 2024-06-13 21:27:26 -07:00
epoll-wait.c perf bench: Fix undefined behavior in cmpworker() 2025-01-18 10:14:36 -08:00
evlist-open-close.c perf bench evlist-open-close: Reduce scope of 2 variables 2025-04-25 12:32:13 -03:00
find-bit-bench.c perf bench: Avoid NDEBUG warning 2023-04-04 09:39:56 -03:00
futex-hash.c perf bench futex: Fix prctl include in musl libc 2025-06-17 18:29:42 -03:00
futex-lock-pi.c tools/perf: Allow to select the number of hash buckets 2025-05-03 12:02:10 +02:00
futex-requeue.c tools/perf: Allow to select the number of hash buckets 2025-05-03 12:02:10 +02:00
futex-wake-parallel.c tools/perf: Allow to select the number of hash buckets 2025-05-03 12:02:10 +02:00
futex-wake.c tools/perf: Allow to select the number of hash buckets 2025-05-03 12:02:10 +02:00
futex.c perf bench futex: Fix prctl include in musl libc 2025-06-17 18:29:42 -03:00
futex.h tools/perf: Allow to select the number of hash buckets 2025-05-03 12:02:10 +02:00
inject-buildid.c perf bench: Remove reference to cmd_inject 2024-12-18 16:24:33 -03:00
kallsyms-parse.c perf bench: Add kallsyms parsing 2020-05-05 16:35:32 -03:00
mem-functions.c perf bench mem: Always memset source before memcpy 2020-08-13 09:34:26 -03:00
mem-memcpy-arch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memcpy-x86-64-asm-def.h tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memcpy-x86-64-asm.S tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memset-arch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memset-x86-64-asm-def.h tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memset-x86-64-asm.S tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
numa.c perf header: Move is_cpu_online to numa bench 2024-11-16 16:36:47 -03:00
pmu-scan.c perf pmu: Abstract alias/event struct 2023-08-24 10:42:46 -03:00
sched-messaging.c perf bench messaging: Kill child processes when exit abnormally in process mode 2023-09-26 21:47:12 -07:00
sched-pipe.c perf bench sched pipe: fix enforced blocking reads in worker_thread 2025-03-23 23:20:37 -07:00
sched-seccomp-notify.c perf bench sched-seccomp-notify: Fix spelling mistake "synchronious" -> "synchronous" 2023-12-05 15:48:52 -03:00
synthesize.c perf tool: Constify tool pointers 2024-08-12 18:05:14 -03:00
syscall.c perf bench: Fix perf bench syscall loop count 2025-03-05 09:19:23 -08:00
uprobe.c perf bench uprobe: Add uretprobe variant of uprobe benchmarks 2024-04-12 17:54:02 -03:00