From: Jiri Olsa <hidden> Date: 2021-10-26 21:24:26
Using new PAHOLE_FLAGS variable to pass extra arguments to
pahole for both vmlinux and modules BTF data generation.
Adding new scripts/pahole-flags.sh script that detect and
prints pahole options.
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
v2 changes:
- posting separately from original patchset
- added Andrii's ack
Makefile | 3 +++
scripts/Makefile.modfinal | 2 +-
scripts/link-vmlinux.sh | 11 +----------
scripts/pahole-flags.sh | 20 ++++++++++++++++++++
4 files changed, 25 insertions(+), 11 deletions(-)
create mode 100755 scripts/pahole-flags.sh
@@ -40,7 +40,7 @@ quiet_cmd_ld_ko_o = LD [M] $@quiet_cmd_btf_ko=BTF[M]$@cmd_btf_ko=\ if [ -f vmlinux ]; then \-LLVM_OBJCOPY="$(OBJCOPY)"$(PAHOLE)-J--btf_basevmlinux$@;\+LLVM_OBJCOPY="$(OBJCOPY)"$(PAHOLE)-J$(PAHOLE_FLAGS)--btf_basevmlinux$@;\$(RESOLVE_BTFIDS)-bvmlinux$@;\ else \printf"Skipping BTF generation for %s due to unavailability of vmlinux\n"$@1>&2;\
@@ -205,7 +205,6 @@ vmlinux_link() gen_btf(){localpahole_ver-localextra_paholeopt=if![-x"$(command-v${PAHOLE})"];thenecho>&2"BTF: ${1}: pahole (${PAHOLE}) is not available"
@@ -220,16 +219,8 @@ gen_btf()vmlinux_link${1}-if["${pahole_ver}"-ge"118"]&&["${pahole_ver}"-le"121"];then-# pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars-extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_vars"-fi-if["${pahole_ver}"-ge"121"];then-extra_paholeopt="${extra_paholeopt} --btf_gen_floats"-fi-info"BTF"${2}-LLVM_OBJCOPY="${OBJCOPY}"${PAHOLE}-J${extra_paholeopt}${1}+LLVM_OBJCOPY="${OBJCOPY}"${PAHOLE}-J${PAHOLE_FLAGS}${1}# Create ${2} which contains just .BTF section but no symbols. Add# SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
--
quoted
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
--
quoted
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
--
quoted
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/sh: 1: scripts/pahole-flags.sh: not found
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
make[1]: *** [Makefile:1871: init] Error 2
make[1]: *** [Makefile:1871: arch/openrisc] Error 2
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
/bin/bash: scripts/pahole-flags.sh: No such file or directory
make[1]: *** [Makefile:1871: security] Error 2
make[1]: *** [Makefile:1871: mm] Error 2
make[1]: *** [Makefile:1871: block] Error 2
make[1]: *** [Makefile:1871: kernel] Error 2
make[1]: *** [Makefile:1871: net] Error 2
make[1]: *** [Makefile:1871: lib] Error 2
make[1]: *** [Makefile:1871: fs] Error 2
make[1]: *** [Makefile:1871: drivers] Error 2
make[1]: *** [Makefile:1871: sound] Error 2
make[1]: Target '__all' not remade because of errors.
--
quoted
/bin/bash: scripts/pahole-flags.sh: No such file or directory
From: Jiri Olsa <hidden> Date: 2021-10-28 17:14:52
On Tue, Oct 26, 2021 at 11:24:19PM +0200, Jiri Olsa wrote:
Using new PAHOLE_FLAGS variable to pass extra arguments to
pahole for both vmlinux and modules BTF data generation.
Adding new scripts/pahole-flags.sh script that detect and
prints pahole options.
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
I'm checking on reported build failures and will send v3
jirka
@@ -40,7 +40,7 @@ quiet_cmd_ld_ko_o = LD [M] $@quiet_cmd_btf_ko=BTF[M]$@cmd_btf_ko=\ if [ -f vmlinux ]; then \-LLVM_OBJCOPY="$(OBJCOPY)"$(PAHOLE)-J--btf_basevmlinux$@;\+LLVM_OBJCOPY="$(OBJCOPY)"$(PAHOLE)-J$(PAHOLE_FLAGS)--btf_basevmlinux$@;\$(RESOLVE_BTFIDS)-bvmlinux$@;\ else \printf"Skipping BTF generation for %s due to unavailability of vmlinux\n"$@1>&2;\
@@ -205,7 +205,6 @@ vmlinux_link() gen_btf(){localpahole_ver-localextra_paholeopt=if![-x"$(command-v${PAHOLE})"];thenecho>&2"BTF: ${1}: pahole (${PAHOLE}) is not available"
@@ -220,16 +219,8 @@ gen_btf()vmlinux_link${1}-if["${pahole_ver}"-ge"118"]&&["${pahole_ver}"-le"121"];then-# pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars-extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_vars"-fi-if["${pahole_ver}"-ge"121"];then-extra_paholeopt="${extra_paholeopt} --btf_gen_floats"-fi-info"BTF"${2}-LLVM_OBJCOPY="${OBJCOPY}"${PAHOLE}-J${extra_paholeopt}${1}+LLVM_OBJCOPY="${OBJCOPY}"${PAHOLE}-J${PAHOLE_FLAGS}${1}# Create ${2} which contains just .BTF section but no symbols. Add# SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all