This is a note to let you know that I've just added the patch titled kbuild: Add CONFIG_PAHOLE_VERSION to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kbuild-add-config_pahole_version.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 613fe169237785a4bb1d06397b52606b2967da53 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor <nathan@xxxxxxxxxx> Date: Tue, 1 Feb 2022 13:56:21 -0700 Subject: kbuild: Add CONFIG_PAHOLE_VERSION From: Nathan Chancellor <nathan@xxxxxxxxxx> commit 613fe169237785a4bb1d06397b52606b2967da53 upstream. There are a few different places where pahole's version is turned into a three digit form with the exact same command. Move this command into scripts/pahole-version.sh to reduce the amount of duplication across the tree. Create CONFIG_PAHOLE_VERSION so the version code can be used in Kconfig to enable and disable configuration options based on the pahole version, which is already done in a couple of places. Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx> Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx> Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> Link: https://lore.kernel.org/bpf/20220201205624.652313-3-nathan@xxxxxxxxxx Signed-off-by: Matthias Maennich <maennich@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- MAINTAINERS | 1 + init/Kconfig | 4 ++++ scripts/pahole-version.sh | 13 +++++++++++++ 3 files changed, 18 insertions(+) create mode 100755 scripts/pahole-version.sh --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3407,6 +3407,7 @@ F: net/sched/act_bpf.c F: net/sched/cls_bpf.c F: samples/bpf/ F: scripts/bpf_doc.py +F: scripts/pahole-version.sh F: tools/bpf/ F: tools/lib/bpf/ F: tools/testing/selftests/bpf/ --- a/init/Kconfig +++ b/init/Kconfig @@ -91,6 +91,10 @@ config CC_HAS_ASM_INLINE config CC_HAS_NO_PROFILE_FN_ATTR def_bool $(success,echo '__attribute__((no_profile_instrument_function)) int x();' | $(CC) -x c - -c -o /dev/null -Werror) +config PAHOLE_VERSION + int + default $(shell,$(srctree)/scripts/pahole-version.sh $(PAHOLE)) + config CONSTRUCTORS bool --- /dev/null +++ b/scripts/pahole-version.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Usage: $ ./pahole-version.sh pahole +# +# Prints pahole's version in a 3-digit form, such as 119 for v1.19. + +if [ ! -x "$(command -v "$@")" ]; then + echo 0 + exit 1 +fi + +"$@" --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/' Patches currently in stable-queue which might be from nathan@xxxxxxxxxx are queue-5.15/scripts-pahole-flags.sh-use-pahole-version.sh.patch queue-5.15/lib-kconfig.debug-allow-btf-dwarf5-with-pahole-1.21.patch queue-5.15/ext4-fix-function-prototype-mismatch-for-ext4_feat_ktype.patch queue-5.15/kbuild-add-config_pahole_version.patch queue-5.15/lib-kconfig.debug-use-config_pahole_version.patch