Building perf is broken in linux-6.6.y
Subsystems (2)
Hello,
building perf is broken for me since Linux 6.6.119.
linux-stable-rc/tools/perf# make perf NO_JEVENTS=1 NO_LIBTRACEEVENT=1
BUILD: Doing 'make -j12' parallel build
HOSTCC fixdep.o
HOSTLD fixdep-in.o
...
...
CC tests/sample-parsing.o CC util/intel-pt-decoder/intel-pt-pkt-decoder.o CC util/perf-regs-arch/perf_regs_csky.o CC util/arm-spe-decoder/arm-spe-pkt-decoder.o CC util/perf-regs-arch/perf_regs_loongarch.o
In file included from util/arm-spe-decoder/arm-spe-pkt-decoder.h:10,
from util/arm-spe-decoder/arm-spe-pkt-decoder.c:14:
/local/git/linux-stable-rc/tools/include/linux/bitfield.h: In function ‘le16_encode_bits’:
/local/git/linux-stable-rc/tools/include/linux/bitfield.h:166:31: error: implicit declaration of function ‘cpu_to_le16’; did you mean ‘htole16’? [-Werror=implicit-function-declaration]
____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \
^~~~~~~~~
/local/git/linux-stable-rc/tools/include/linux/bitfield.h:149:9: note: in definition of macro
‘____MAKE_OP’
return to((v & field_mask(field)) * field_multiplier(field)); \
^~/local/git/linux-stable-rc/tools/include/linux/bitfield.h:170:1: note: in expansion of macro ‘__MAKE_OP’
__MAKE_OP(16)
...
Quick bisect showed this:
linux-stable-rc/tools/perf# git bisect bad 64378caea949d24f479bc809f9890cba683bb131 is the first bad commit commit 64378caea949d24f479bc809f9890cba683bb131 (HEAD)
Author: Leo Yan <[email protected]> Date: Tue Mar 4 11:12:35 2025 +0000
perf arm-spe: Extend branch operations
[ Upstream commit 64d86c03e1441742216b6332bdfabfb6ede31662 ]
In Arm ARM (ARM DDI 0487, L.a), the section "D18.2.7 Operation Type packet", the branch subclass is extended for Call Return (CR), Guarded control stack data access (GCS).
This commit adds support CR and GCS operations. The IND (indirect) operation is defined only in bit [1], its macro is updated
accordingly.
Move the COND (Conditional) macro into the same group with other operations for better maintenance.
Link:
https://lore.kernel.org/r/[email protected]
Stable-dep-of: 33e1fffea492 ("perf arm_spe: Fix memset subclass in
operation")
tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 12 +++++++++--- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 11 ++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-)
Is that already known? Am I missing something here?
Thomas
Greg KH
maintainerQuoted 68 lines · Thomas Voegtle
Hello,
building perf is broken for me since Linux 6.6.119.
linux-stable-rc/tools/perf# make perf NO_JEVENTS=1 NO_LIBTRACEEVENT=1
BUILD: Doing 'make -j12' parallel build
HOSTCC fixdep.o
HOSTLD fixdep-in.o
...
...CC tests/sample-parsing.o CC util/intel-pt-decoder/intel-pt-pkt-decoder.o CC util/perf-regs-arch/perf_regs_csky.o CC util/arm-spe-decoder/arm-spe-pkt-decoder.o CC util/perf-regs-arch/perf_regs_loongarch.oIn file included from
util/arm-spe-decoder/arm-spe-pkt-decoder.h:10,
fromutil/arm-spe-decoder/arm-spe-pkt-decoder.c:14:
/local/git/linux-stable-rc/tools/include/linux/bitfield.h: In function ‘le16_encode_bits’:
/local/git/linux-stable-rc/tools/include/linux/bitfield.h:166:31: error:
implicit declaration of
function ‘cpu_to_le16’; did you mean ‘htole16’? [-Werror=implicit-function-declaration]____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \ ^~~~~~~~~ /local/git/linux-stable-rc/tools/include/linux/bitfield.h:149:9: note: in definition of macro ‘____MAKE_OP’ return to((v & field_mask(field)) * field_multiplier(field)); \ ^~/local/git/linux-stable-rc/tools/include/linux/bitfield.h:170:1: note: in expansion of macro
‘__MAKE_OP’
__MAKE_OP(16)
...Quick bisect showed this:
linux-stable-rc/tools/perf# git bisect bad
64378caea949d24f479bc809f9890cba683bb131is the first bad commit commit64378caea949d24f479bc809f9890cba683bb131(HEAD)Author: Leo Yan <[email protected]> Date: Tue Mar 4 11:12:35 2025 +0000perf arm-spe: Extend branch operations
[ Upstream commit
64d86c03e1441742216b6332bdfabfb6ede31662]In Arm ARM (ARM DDI 0487, L.a), the section "D18.2.7 Operation Type packet", the branch subclass is extended for Call Return (CR), Guarded control stack data access (GCS).
This commit adds support CR and GCS operations. The IND (indirect) operation is defined only in bit [1], its macro is updated accordingly.
Move the COND (Conditional) macro into the same group with other operations for better maintenance.
Reviewed-by Ian Rogers <[email protected]>Reviewed-by James Clark <[email protected]>Signed-off-by Leo Yan <[email protected]>Signed-off-by Namhyung Kim <[email protected]>Stable-dep-of:
33e1fffea492("perfarm_spe: Fix memset subclass in
operation")
Quoted 8 lines
Signed-off-by Sasha Levin <[email protected]>tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 12 +++++++++--- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 11 ++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-)Is that already known? Am I missing something here?
No idea, sorry, I'm usually not ever able to build perf for any older kernels :)
If that commit is reverted, does it fix the issue? If so, can you send a revert?
thanks,
greg k-h
Hi all,
Quoted 7 lines · Greg KH
Quoted 1 line
Is that already known? Am I missing something here?
No idea, sorry, I'm usually not ever able to build perf for any older kernels :)
If that commit is reverted, does it fix the issue? If so, can you send a revert?
I root caused the issue.
---8<--
tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h +1 -0
@@ -7,6 +7,7 @@#ifndef INCLUDE__ARM_SPE_PKT_DECODER_H__ #define INCLUDE__ARM_SPE_PKT_DECODER_H__ +#include <linux/kernel.h> #include <linux/bitfield.h> #include <stddef.h> #include <stdint.h>
I will send a formal patch tomorrow. It needs to be applied to the stable kernel, and it would be good to apply it to mainline as well.
The mainline kernel is lucky that the relevant C files already include the required header, but the above change would be more reliable.
Thanks,
Leo