Skip to contentSkip to conversation

Building perf is broken in linux-6.6.y

DISCUSSION Thomas Voegtle 3 participants 3 messages Jan 22

Subsystems (2)
lore
Share & tools
lore

Thomas Voegtle

author Reviewed-by Ian Rogers Reviewed-by James Clark
#0 lore raw

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

maintainer
#1 lore raw
Quoted 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.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.

Stable-dep-of: 33e1fffea492 ("perf arm_spe: Fix memset subclass in
operation")

Quoted 8 lines
 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

#2 lore raw

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
index adf4cde320aa..8d16619cd098 100644
@@ -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