diff options
author | Jiri Olsa <jolsa@redhat.com> | 2022-10-19 11:56:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-10-28 13:57:12 +0300 |
commit | c5006abb80e276896ff7237300a6d447708c7924 (patch) | |
tree | 46521cdf31d5598a417a4d54316f8ec863ab001c /scripts/pahole-flags.sh | |
parent | f5f413cb3e8af235c5d310bea9942424fb242c2c (diff) | |
download | linux-c5006abb80e276896ff7237300a6d447708c7924.tar.xz |
kbuild: Unify options for BTF generation for vmlinux and modules
commit 9741e07ece7c247dd65e1aa01e16b683f01c05a8 upstream.
[skipped --btf_gen_floats option in pahole-flags.sh, skipped
Makefile.modfinal change, because there's no BTF kmod support,
squashing in 'exit 0' change from merge commit fc02cb2b37fe]
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.
[ fixed issues found by kernel test robot ]
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211029125729.70002-1-jolsa@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/pahole-flags.sh')
-rwxr-xr-x | scripts/pahole-flags.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh new file mode 100755 index 000000000000..27445cb72974 --- /dev/null +++ b/scripts/pahole-flags.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +extra_paholeopt= + +if ! [ -x "$(command -v ${PAHOLE})" ]; then + exit 0 +fi + +pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/') + +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 + +echo ${extra_paholeopt} |