Allow CONFIG_DEBUG_INFO_DWARF5=y + CONFIG_DEBUG_INFO_BTF=y
Subsystems (5)
cover Allow CONFIG_DEBUG_INFO_DWARF5=y + CONFIG_DEBUG_INFO_BTF=y
Hi all,
This series allows CONFIG_DEBUG_INFO_DWARF5 to be selected with CONFIG_DEBUG_INFO_BTF=y by checking the pahole version.
The first four patches add CONFIG_PAHOLE_VERSION and scripts/pahole-version.sh to clean up all the places that pahole's version is transformed into a 3-digit form.
The fourth patch adds a PAHOLE_VERSION dependency to DEBUG_INFO_DWARF5 so that there are no build errors when it is selected with DEBUG_INFO_BTF.
I build tested Fedora's aarch64 and x86_64 config with ToT clang 14.0.0 and GCC 11 with CONFIG_DEBUG_INFO_DWARF5 enabled with both pahole 1.21 and 1.23.
Nathan Chancellor (5):
MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
kbuild: Add CONFIG_PAHOLE_VERSION scripts/pahole-flags.sh: Use pahole-version.sh lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
MAINTAINERS | 2 ++ init/Kconfig | 4 ++++ lib/Kconfig.debug | 6 +++--- scripts/pahole-flags.sh | 2 +- scripts/pahole-version.sh | 13 +++++++++++++ 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100755 scripts/pahole-version.sh
base-commit: 533de4aea6a91eb670ff8ff2b082bb34f2c5d6ab
Signature · 1 line
2.35.1
PATCH 1/5 MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
Currently, scripts/pahole-flags.sh has no formal maintainer. Add it to the BPF section so that patches to it can be properly reviewed and picked up.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -3523,6 +3523,7 @@ F: net/sched/act_bpf.c F: net/sched/cls_bpf.c F: samples/bpf/ F: scripts/bpf_doc.py +F: scripts/pahole-flags.sh F: tools/bpf/ F: tools/lib/bpf/ F: tools/testing/selftests/bpf/
Signature · 1 line
2.35.1
PATCH 2/5 kbuild: Add CONFIG_PAHOLE_VERSION
In reply to Nathan ChancellorThere 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.
--- MAINTAINERS | 1 + init/Kconfig | 4 ++++ scripts/pahole-version.sh | 13 +++++++++++++ 3 files changed, 18 insertions(+) create mode 100755 scripts/pahole-version.sh
MAINTAINERS +1 -0
@@ -3524,6 +3524,7 @@ F: net/sched/cls_bpf.c F: samples/bpf/ F: scripts/bpf_doc.py F: scripts/pahole-flags.sh +F: scripts/pahole-version.sh F: tools/bpf/ F: tools/lib/bpf/ F: tools/testing/selftests/bpf/
init/Kconfig +4 -0
@@ -86,6 +86,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
scripts/pahole-version.sh new file +13 -0
@@ -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/'
Signature · 1 line
2.35.1
PATCH 3/5 scripts/pahole-flags.sh: Use pahole-version.sh
In reply to Nathan ChancellorUse pahole-version.sh to get pahole's version code to reduce the amount of duplication across the tree.
--- scripts/pahole-flags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/pahole-flags.sh +1 -1
@@ -7,7 +7,7 @@ if ! [ -x "$(command -v ${PAHOLE})" ]; then exit 0 fi -pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/') +pahole_ver=$($(dirname $0)/pahole-version.sh ${PAHOLE}) if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
Signature · 1 line
2.35.1
PATCH 4/5 lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION
In reply to Nathan ChancellorNow that CONFIG_PAHOLE_VERSION exists, use it in the definition of CONFIG_PAHOLE_HAS_SPLIT_BTF and CONFIG_PAHOLE_HAS_BTF_TAG to reduce the amount of duplication across the tree.
--- lib/Kconfig.debug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/Kconfig.debug +2 -2
@@ -323,10 +323,10 @@ config DEBUG_INFO_BTF DWARF type info into equivalent deduplicated BTF type info. config PAHOLE_HAS_SPLIT_BTF - def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119") + def_bool PAHOLE_VERSION >= 119 config PAHOLE_HAS_BTF_TAG - def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "123") + def_bool PAHOLE_VERSION >= 123 depends on CC_IS_CLANG help Decide whether pahole emits btf_tag attributes (btf_type_tag and
Signature · 1 line
2.35.1
PATCH 5/5 lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
In reply to Nathan ChancellorCommit 98cd6f521f10 ("Kconfig: allow explicit opt in to DWARF v5") prevented CONFIG_DEBUG_INFO_DWARF5 from being selected when CONFIG_DEBUG_INFO_BTF is enabled because pahole had issues with clang's DWARF5 info. This was resolved by [1], which is in pahole v1.21.
Allow DEBUG_INFO_DWARF5 to be selected with DEBUG_INFO_BTF when using pahole v1.21 or newer.
--- lib/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
@@ -296,7 +296,7 @@ config DEBUG_INFO_DWARF4 config DEBUG_INFO_DWARF5 bool "Generate DWARF Version 5 debuginfo" depends on !CC_IS_CLANG || (CC_IS_CLANG && (AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502))) - depends on !DEBUG_INFO_BTF + depends on !DEBUG_INFO_BTF || PAHOLE_VERSION >= 121 help Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc 5.0+ accepts the -gdwarf-5 flag but only had partial support for some
Signature · 1 line
2.35.1
Quoted 18 lines · Nathan Chancellor
Hi all,
This series allows
CONFIG_DEBUG_INFO_DWARF5to be selected withCONFIG_DEBUG_INFO_BTF=yby checking the pahole version.The first four patches add
CONFIG_PAHOLE_VERSIONandscripts/pahole-version.shto clean up all the places that pahole's version is transformed into a 3-digit form.The fourth patch adds a
PAHOLE_VERSIONdependency toDEBUG_INFO_DWARF5so that there are no build errors when it is selected withDEBUG_INFO_BTF.I build tested Fedora's aarch64 and
x86_64config with ToT clang 14.0.0 and GCC 11 withCONFIG_DEBUG_INFO_DWARF5enabled with both pahole 1.21 and 1.23.
Quoted 7 lines
Nathan Chancellor (5):
MAINTAINERS: Addscripts/pahole-flags.shto BPF section
kbuild: AddCONFIG_PAHOLE_VERSIONscripts/pahole-flags.sh: Usepahole-version.shlib/Kconfig.debug: UseCONFIG_PAHOLE_VERSIONlib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
LGTM. I'd probably combine patches 2 and 3, but it's minor. I really like the CONFIG_PAHOLE_VERSION and how much cleaner it makes Kconfig options.
Quoted 13 lines
MAINTAINERS | 2 ++ init/Kconfig | 4 ++++ lib/Kconfig.debug | 6 +++--- scripts/pahole-flags.sh | 2 +- scripts/pahole-version.sh | 13 +++++++++++++ 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100755 scripts/pahole-version.shbase-commit:
533de4aea6a91eb670ff8ff2b082bb34f2c5d6ab--
2.35.1
Daniel Borkmann
maintainerQuoted 25 lines · Andrii Nakryiko
Quoted 16 lines · Nathan Chancellor
This series allows
CONFIG_DEBUG_INFO_DWARF5to be selected withCONFIG_DEBUG_INFO_BTF=yby checking the pahole version.The first four patches add
CONFIG_PAHOLE_VERSIONandscripts/pahole-version.shto clean up all the places that pahole's version is transformed into a 3-digit form.The fourth patch adds a
PAHOLE_VERSIONdependency toDEBUG_INFO_DWARF5so that there are no build errors when it is selected withDEBUG_INFO_BTF.I build tested Fedora's aarch64 and
x86_64config with ToT clang 14.0.0 and GCC 11 withCONFIG_DEBUG_INFO_DWARF5enabled with both pahole 1.21 and 1.23.Quoted 7 lines
Nathan Chancellor (5):
MAINTAINERS: Addscripts/pahole-flags.shto BPF section
kbuild: AddCONFIG_PAHOLE_VERSIONscripts/pahole-flags.sh: Usepahole-version.shlib/Kconfig.debug: UseCONFIG_PAHOLE_VERSIONlib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
Quoted 3 lines
LGTM. I'd probably combine patches 2 and 3, but it's minor. I really like the
CONFIG_PAHOLE_VERSIONand how much cleaner it makesKconfigoptions.
+1, thanks for working on getting this enabled! I think patches 2 and 3 are rather logically separate, so as-is is fine as well imho. Applied, thanks!
This series was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This series was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Quoted 10 lines · On Tue, 1 Feb 2022 13:56:19 -0700 you wrote:
Hi all,
This series allows
CONFIG_DEBUG_INFO_DWARF5to be selected withCONFIG_DEBUG_INFO_BTF=yby checking the pahole version.The first four patches add
CONFIG_PAHOLE_VERSIONandscripts/pahole-version.shto clean up all the places that pahole's version is transformed into a 3-digit form.[...]
Here is the summary with links:
- [bpf-next,1/5] MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
https://git.kernel.org/bpf/bpf-next/c/f67644b4f282 - [bpf-next,2/5] kbuild: Add CONFIG_PAHOLE_VERSION https://git.kernel.org/bpf/bpf-next/c/613fe1692377 - [bpf-next,3/5] scripts/pahole-flags.sh: Use pahole-version.sh https://git.kernel.org/bpf/bpf-next/c/2d6c9810eb89 - [bpf-next,4/5] lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION https://git.kernel.org/bpf/bpf-next/c/6323c81350b7 - [bpf-next,5/5] lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+ https://git.kernel.org/bpf/bpf-next/c/42d9b379e3e1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
cover Allow CONFIG_DEBUG_INFO_DWARF5=y + CONFIG_DEBUG_INFO_BTF=y
In reply to Nathan ChancellorFrom: Matthias Maennich <[email protected]>
Can we please pick this series up for 5.15? I am particularly interested in the last patch to enable BTF + DWARF5, but the cleanup patches before are a very reasonable choice for stable@ as well as they simplify the pahole version calculation and allow future BTF/pahole related patches to apply cleanly as well. I intentionally kept the config PAHOLE_HAS_BTF_TAG and hence its patch complete, even though there is no user for it.
Cheers,
Matthias
Nathan Chancellor (5):
MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
kbuild: Add CONFIG_PAHOLE_VERSION scripts/pahole-flags.sh: Use pahole-version.sh lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
MAINTAINERS | 2 ++ init/Kconfig | 4 ++++ lib/Kconfig.debug | 12 ++++++++++-- scripts/pahole-flags.sh | 2 +- scripts/pahole-version.sh | 13 +++++++++++++ 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100755 scripts/pahole-version.sh
Signature · 1 line
2.39.2.637.g21b0678d19-goog
Greg Kroah-Hartman
maintainerQuoted 9 lines · On Wed, Feb 22, 2023 at 11:21:37AM +0000, [email protected] wrote:
From: Matthias Maennich <[email protected]>
Can we please pick this series up for 5.15? I am particularly interested in the last patch to enable BTF + DWARF5, but the cleanup patches before are a very reasonable choice for stable@ as well as they simplify the pahole version calculation and allow future BTF/pahole related patches to apply cleanly as well. I intentionally kept the config
PAHOLE_HAS_BTF_TAGand hence its patch complete, even though there is no user for it.
What are the upstream git commit ids for these changes?
thanks,
greg k-h
Quoted 12 lines · Greg Kroah-Hartman
Quoted 9 lines · On Wed, Feb 22, 2023 at 11:21:37AM +0000, [email protected] wrote:
From: Matthias Maennich <[email protected]>
Can we please pick this series up for 5.15? I am particularly interested in the last patch to enable BTF + DWARF5, but the cleanup patches before are a very reasonable choice for stable@ as well as they simplify the pahole version calculation and allow future BTF/pahole related patches to apply cleanly as well. I intentionally kept the config
PAHOLE_HAS_BTF_TAGand hence its patch complete, even though there is no user for it.
Quoted 1 line
What are the upstream git commit ids for these changes?
Sorry, they should have been part of the commit message ... here they are
f67644b4f282d42acf5ad9b0175ef5671314ab12 ("MAINTAINERS: Add scripts/pahole-flags.sh to BPF section") 613fe169237785a4bb1d06397b52606b2967da53 ("kbuild: Add CONFIG_PAHOLE_VERSION") 2d6c9810eb8915c4ddede707b8e167a1d919e1ca ("scripts/pahole-flags.sh:
Use pahole-version.sh")6323c81350b73a4569cf52df85f80273faa64071 ("lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION")42d9b379e3e1790eafb87c799c9edfd0b37a37c7 ("lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+")
Cheers,
Matthias
Quoted 4 lines
thanks,
greg k-h
PATCH 1/5 MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
Currently, scripts/pahole-flags.sh has no formal maintainer. Add it to the BPF section so that patches to it can be properly reviewed and picked up.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -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-flags.sh F: tools/bpf/ F: tools/lib/bpf/ F: tools/testing/selftests/bpf/
Signature · 1 line
2.39.2.637.g21b0678d19-goog
kernel test robot
build botRe: [PATCH 1/5] MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
FYI: kernel test robot notices the stable kernel rule is not satisfied.
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
Rule: 'Cc: [email protected]' or 'commit <sha1> upstream.'
Subject: [PATCH 1/5] MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests
Greg Kroah-Hartman
maintainerRe: [PATCH 1/5] MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
In reply to [email protected]Quoted 30 lines · On Wed, Feb 22, 2023 at 11:21:39AM +0000, [email protected] wrote:
From: Nathan Chancellor <[email protected]>
Currently,
scripts/pahole-flags.shhas no formal maintainer. Add it to the BPF section so that patches to it can be properly reviewed and picked up.Signed-off-by Nathan Chancellor <[email protected]>Signed-off-by Daniel Borkmann <[email protected]>Acked-by Andrii Nakryiko <[email protected]>Signed-off-by Matthias Maennich <[email protected]>--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)MAINTAINERS +1
-0@@ -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-flags.sh F: tools/bpf/ F: tools/lib/bpf/ F: tools/testing/selftests/bpf/Signature · 1 line
2.39.2.637.g21b0678d19-goog
No need for MAINTAINERS updates for older kernels as no one should be making new patches against them, right?
thanks,
greg k-h
Re: [PATCH 1/5] MAINTAINERS: Add scripts/pahole-flags.sh to BPF section
Quoted 27 lines · Greg Kroah-Hartman
Quoted 25 lines · On Wed, Feb 22, 2023 at 11:21:39AM +0000, [email protected] wrote:
From: Nathan Chancellor <[email protected]>
Currently,
scripts/pahole-flags.shhas no formal maintainer. Add it to the BPF section so that patches to it can be properly reviewed and picked up.Signed-off-by Nathan Chancellor <[email protected]>Signed-off-by Daniel Borkmann <[email protected]>Acked-by Andrii Nakryiko <[email protected]>Signed-off-by Matthias Maennich <[email protected]>--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)MAINTAINERS +1
-0@@ -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-flags.sh F: tools/bpf/
Quoted 8 lines
Quoted 5 lines
MAINTAINERS +0
-1F: tools/lib/bpf/ F: tools/testing/selftests/bpf/ --2.39.2.637.g21b0678d19-goog
No need for
MAINTAINERSupdates for older kernels as no one should be making new patches against them, right?
This one is optional, but it makes the next one apply cleanly and I picked the entire series.
Cheers,
Matthias
Quoted 4 lines
thanks,
greg k-h
PATCH 2/5 kbuild: Add CONFIG_PAHOLE_VERSION
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
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.
--- MAINTAINERS | 1 + init/Kconfig | 4 ++++ scripts/pahole-version.sh | 13 +++++++++++++ 3 files changed, 18 insertions(+) create mode 100755 scripts/pahole-version.sh
MAINTAINERS +1 -0
@@ -3408,6 +3408,7 @@ F: net/sched/cls_bpf.c F: samples/bpf/ F: scripts/bpf_doc.py F: scripts/pahole-flags.sh +F: scripts/pahole-version.sh F: tools/bpf/ F: tools/lib/bpf/ F: tools/testing/selftests/bpf/
init/Kconfig +4 -0
@@ -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
scripts/pahole-version.sh new file +13 -0
@@ -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/'
Signature · 1 line
2.39.2.637.g21b0678d19-goog
PATCH 3/5 scripts/pahole-flags.sh: Use pahole-version.sh
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
Use pahole-version.sh to get pahole's version code to reduce the amount of duplication across the tree.
--- scripts/pahole-flags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/pahole-flags.sh +1 -1
@@ -7,7 +7,7 @@ if ! [ -x "$(command -v ${PAHOLE})" ]; then exit 0 fi -pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/') +pahole_ver=$($(dirname $0)/pahole-version.sh ${PAHOLE}) if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
Signature · 1 line
2.39.2.637.g21b0678d19-goog
PATCH 4/5 lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
Now that CONFIG_PAHOLE_VERSION exists, use it in the definition of CONFIG_PAHOLE_HAS_SPLIT_BTF and CONFIG_PAHOLE_HAS_BTF_TAG to reduce the amount of duplication across the tree.
--- lib/Kconfig.debug | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
lib/Kconfig.debug +9 -1
@@ -328,7 +328,15 @@ config DEBUG_INFO_BTF DWARF type info into equivalent deduplicated BTF type info. config PAHOLE_HAS_SPLIT_BTF - def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119") + def_bool PAHOLE_VERSION >= 119 + +config PAHOLE_HAS_BTF_TAG + def_bool PAHOLE_VERSION >= 123 + depends on CC_IS_CLANG + help + Decide whether pahole emits btf_tag attributes (btf_type_tag and + btf_decl_tag) or not. Currently only clang compiler implements + these attributes, so make the config depend on CC_IS_CLANG. config DEBUG_INFO_BTF_MODULES def_bool y
Signature · 1 line
2.39.2.637.g21b0678d19-goog
Greg Kroah-Hartman
maintainerRe: [PATCH 4/5] lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION
Quoted 23 lines · On Wed, Feb 22, 2023 at 11:21:45AM +0000, [email protected] wrote:
From: Nathan Chancellor <[email protected]>
Now that
CONFIG_PAHOLE_VERSIONexists, use it in the definition ofCONFIG_PAHOLE_HAS_SPLIT_BTFandCONFIG_PAHOLE_HAS_BTF_TAGto reduce the amount of duplication across the tree.Signed-off-by Nathan Chancellor <[email protected]>Signed-off-by Daniel Borkmann <[email protected]>Acked-by Andrii Nakryiko <[email protected]>Signed-off-by Matthias Maennich <[email protected]>--- lib/Kconfig.debug | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)lib/Kconfig.debug +0
-0@@ -328,7 +328,15 @@ config DEBUG_INFO_BTF DWARF type info into equivalent deduplicated BTF type info. config PAHOLE_HAS_SPLIT_BTF
lib/Kconfig.debug config DEBUG_INFO_BTF · line 339
Quoted 10 lines
lib/Kconfig.debug +9
-1- def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119") + def_bool PAHOLE_VERSION >= 119 + +config PAHOLE_HAS_BTF_TAG + def_bool PAHOLE_VERSION >= 123 + depends on CC_IS_CLANG + help + Decide whether pahole emits btf_tag attributes (btf_type_tag and + btf_decl_tag) or not. Currently only clang compiler implements + these attributes, so make the config depend on CC_IS_CLANG.
Note, this is very different from the original commit, are you sure this is correct?
You took a MAINTAINERS file update in patch 1/5 to make a later patch simpler, but yet you massively changed this commit and included stuff from a different one and did not mention it anywhere?
Please fix this commit up, and resubmit the whole series with the git commit ids in the commits to make it easier for me to review and apply properly.
thanks,
greg k-h
PATCH 5/5 lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
Commit 98cd6f521f10 ("Kconfig: allow explicit opt in to DWARF v5") prevented CONFIG_DEBUG_INFO_DWARF5 from being selected when CONFIG_DEBUG_INFO_BTF is enabled because pahole had issues with clang's DWARF5 info. This was resolved by [1], which is in pahole v1.21.
Allow DEBUG_INFO_DWARF5 to be selected with DEBUG_INFO_BTF when using pahole v1.21 or newer.
--- lib/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
@@ -302,7 +302,7 @@ config DEBUG_INFO_DWARF4 config DEBUG_INFO_DWARF5 bool "Generate DWARF Version 5 debuginfo" depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128) - depends on !DEBUG_INFO_BTF + depends on !DEBUG_INFO_BTF || PAHOLE_VERSION >= 121 help Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc 5.0+ accepts the -gdwarf-5 flag but only had partial support for some
Signature · 1 line
2.39.2.637.g21b0678d19-goog
v2 cover Allow CONFIG_DEBUG_INFO_DWARF5=y + CONFIG_DEBUG_INFO_BTF=y
In reply to Nathan ChancellorHi!
Can we please pick up the essential parts of this series for 5.15? I am particularly interested in the last patch to enable BTF + DWARF5, but the cleanup patches before are a very reasonable choice for stable@ as well as they simplify the pahole version calculation and allow future BTF/pahole related patches to apply cleanly as well.
Cheers,
Matthias
Nathan Chancellor (4):
kbuild: Add CONFIG_PAHOLE_VERSION scripts/pahole-flags.sh: Use pahole-version.sh lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
MAINTAINERS | 1 + init/Kconfig | 4 ++++ lib/Kconfig.debug | 4 ++-- scripts/pahole-flags.sh | 2 +- scripts/pahole-version.sh | 13 +++++++++++++ 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 scripts/pahole-version.sh
Signature · 1 line
2.39.2.637.g21b0678d19-goog
Greg Kroah-Hartman
maintainerQuoted 23 lines · Matthias Maennich
Hi!
Can we please pick up the essential parts of this series for 5.15? I am particularly interested in the last patch to enable BTF + DWARF5, but the cleanup patches before are a very reasonable choice for stable@ as well as they simplify the pahole version calculation and allow future BTF/pahole related patches to apply cleanly as well.
Cheers,
MatthiasCc <[email protected]> # v5.15+Cc Greg Kroah-Hartman <[email protected]>Cc Nathan Chancellor <[email protected]>Cc Andrii Nakryiko <[email protected]>Signed-off-by Matthias Maennich <[email protected]>Nathan Chancellor (4):
kbuild: AddCONFIG_PAHOLE_VERSIONscripts/pahole-flags.sh: Usepahole-version.shlib/Kconfig.debug: UseCONFIG_PAHOLE_VERSIONlib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
Quoted 7 lines
MAINTAINERS | 1 + init/Kconfig | 4 ++++ lib/Kconfig.debug | 4 ++-- scripts/pahole-flags.sh | 2 +- scripts/pahole-version.sh | 13 +++++++++++++ 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 scripts/pahole-version.sh
Thanks, all now queued up. Hopefully quilt/git will handle the permission of this file properly, sometimes it gets confused...
greg k-h
PATCH v2 1/4 kbuild: Add CONFIG_PAHOLE_VERSION
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 613fe169237785a4bb1d06397b52606b2967da53 ]
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.
--- MAINTAINERS | 1 + init/Kconfig | 4 ++++ scripts/pahole-version.sh | 13 +++++++++++++ 3 files changed, 18 insertions(+) create mode 100755 scripts/pahole-version.sh
MAINTAINERS +1 -0
@@ -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/
init/Kconfig +4 -0
@@ -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
scripts/pahole-version.sh new file +13 -0
@@ -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/'
Signature · 1 line
2.39.2.637.g21b0678d19-goog
PATCH v2 2/4 scripts/pahole-flags.sh: Use pahole-version.sh
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 2d6c9810eb8915c4ddede707b8e167a1d919e1ca ]
Use pahole-version.sh to get pahole's version code to reduce the amount of duplication across the tree.
--- scripts/pahole-flags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/pahole-flags.sh +1 -1
@@ -7,7 +7,7 @@ if ! [ -x "$(command -v ${PAHOLE})" ]; then exit 0 fi -pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/') +pahole_ver=$($(dirname $0)/pahole-version.sh ${PAHOLE}) if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
Signature · 1 line
2.39.2.637.g21b0678d19-goog
PATCH v2 3/4 lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 6323c81350b73a4569cf52df85f80273faa64071 ]
Now that CONFIG_PAHOLE_VERSION exists, use it in the definition of CONFIG_PAHOLE_HAS_SPLIT_BTF and CONFIG_PAHOLE_HAS_BTF_TAG to reduce the amount of duplication across the tree.
--- lib/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
@@ -328,7 +328,7 @@ config DEBUG_INFO_BTF DWARF type info into equivalent deduplicated BTF type info. config PAHOLE_HAS_SPLIT_BTF - def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119") + def_bool PAHOLE_VERSION >= 119 config DEBUG_INFO_BTF_MODULES def_bool y
Signature · 1 line
2.39.2.637.g21b0678d19-goog
PATCH v2 4/4 lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+
In reply to Nathan ChancellorFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 42d9b379e3e1790eafb87c799c9edfd0b37a37c7 ]
Commit 98cd6f521f10 ("Kconfig: allow explicit opt in to DWARF v5") prevented CONFIG_DEBUG_INFO_DWARF5 from being selected when CONFIG_DEBUG_INFO_BTF is enabled because pahole had issues with clang's DWARF5 info. This was resolved by [1], which is in pahole v1.21.
Allow DEBUG_INFO_DWARF5 to be selected with DEBUG_INFO_BTF when using pahole v1.21 or newer.
--- lib/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
@@ -302,7 +302,7 @@ config DEBUG_INFO_DWARF4 config DEBUG_INFO_DWARF5 bool "Generate DWARF Version 5 debuginfo" depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128) - depends on !DEBUG_INFO_BTF + depends on !DEBUG_INFO_BTF || PAHOLE_VERSION >= 121 help Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc 5.0+ accepts the -gdwarf-5 flag but only had partial support for some
Signature · 1 line
2.39.2.637.g21b0678d19-goog