]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
perf: fix reproducibility issue occasionally
authorhongxu <hongxu.jia@eng.windriver.com>
Tue, 23 Sep 2025 12:58:57 +0000 (20:58 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 24 Sep 2025 10:06:19 +0000 (11:06 +0100)
commite18d697e92b55e57124e80234369d46575226386
tree93b02f1692a631269566623c0c42bc958571d0f3
parenta76154f8351d869fee802124d23f6f573b1c372b
perf: fix reproducibility issue occasionally

Due to commit [1] applied in kernel v6.16 (such as qemux86-64),
perl has reproducibility issue occasionally.

Perf's build process generates two copies of its internal headers,
one at tools/lib/perf/include/internal and one at libperf/include/internal
with files like core.h. Although the files are identical, the binaries including
them would see them at different paths and have different debuginfo data. [2]

The reason is the order of include dir `tools/lib/perf/include' and
`libperf/include' is not stable, such as

$ x86_64-poky-linux-gcc  ... \
   -Ipath-to/tmp/work/qemux86_64-poky-linux/perf/1.0/sources/perf-1.0/tools/lib/perf/include \
   -Ipath-to/tmp/work/qemux86_64-poky-linux/perf/1.0/sources/perf-1.0/libperf/include \
   -c -o path-to/tmp/work/qemux86_64-poky-linux/perf/1.0/sources/perf-1.0/libperf/core.o core.c

$ recipe-sysroot-native/usr/bin/dwarfsrcfiles sources/perf-1.0/libperf/core.o
/usr/src/debug/perf/1.0/tools/lib/perf/core.c
...
        /usr/src/debug/perf/1.0/tools/lib/perf/include/perf/core.h
        /usr/src/debug/perf/1.0/tools/lib/perf/include/internal/lib.h
...

$ x86_64-poky-linux-gcc  ... \
   -Ipath-to/tmp/work/qemux86_64-poky-linux/perf/1.0/sources/perf-1.0/libperf/include \
   -Ipath-to/tmp/work/qemux86_64-poky-linux/perf/1.0/sources/perf-1.0/tools/lib/perf/include \
   -c -o path-to/tmp/work/qemux86_64-poky-linux/perf/1.0/sources/perf-1.0/libperf/core.o core.c

$ recipe-sysroot-native/usr/bin/dwarfsrcfiles sources/perf-1.0/libperf/core.o
/usr/src/debug/perf/1.0/tools/lib/perf/core.c
...
    /usr/src/debug/perf/1.0/libperf/include/perf/core.h
    /usr/src/debug/perf/1.0/libperf/include/internal/lib.h
...

This commit explicitly sets the order of these two include dirs
in EXTRA_CFLAGS.

This commit has no regression for kernel v6.6 (such as genericx86-64)

Also enable verbose for compile to trace the detail of build

[1] https://github.com/torvalds/linux/commit/f5b07010c13c77541e8ade167d05bef3b8a63739
[2] https://git.openembedded.org/openembedded-core/commit/?id=0a886fcacaab0fbce1306c0f99d482f940a8f705

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/perf/perf.bb