redhat/configs: create a separate config for gcov options

Use existing config infrastructure to build and validate
gcov-enabled configs. Meaning for each arch we also apply
GCOV options on top and validate it.

From same options dir (kgcov) build also partial config, which
contains only GCOV options. We can merge this partial config
during build on top of existing config, which avoids the need
to store all possible combinations in dist-git and SRPM.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
This commit is contained in:
Jan Stancek 2021-10-20 14:51:07 +02:00 committed by Justin M. Forbes
parent f65216f098
commit 7455990167
No known key found for this signature in database
GPG Key ID: B8FA7924A4B1C140
9 changed files with 37 additions and 8 deletions

View File

@ -141,6 +141,7 @@ dist-configs-check: dist-configs-prep
cd $(REDHAT)/configs; ./process_configs.sh $(PROCESS_CONFIGS_CHECK_OPTS) $(PACKAGE_NAME)
dist-configs-prep: dist-clean-configs dist-buildreq-check
cd $(REDHAT)/configs; ./build_configs.sh "partial" "$(ARCH_MACH)" "snip"
cd $(REDHAT)/configs; ./build_configs.sh "$(PACKAGE_NAME)" "$(ARCH_MACH)" "$(FLAVOR)"
dist-configs-arch: ARCH_MACH = $(MACH)
@ -259,6 +260,7 @@ sources-rh: $(TARBALL) generate-testpatch-tmp setup-source dist-configs-check
keys/rhel*.x509 \
kabi/check-kabi \
configs/$(PACKAGE_NAME)-*.config \
configs/partial*.config \
gating.yaml \
rpminspect.yaml \
update_scripts.sh \

View File

@ -1,5 +1,6 @@
*merged
config-*
kernel*config
partial*config
*.old
*.tmp

View File

@ -0,0 +1 @@
CONFIG_GCOV_KERNEL=y

View File

@ -0,0 +1 @@
CONFIG_GCOV_PROFILE_ALL=y

View File

@ -0,0 +1 @@
# CONFIG_GCOV_PROFILE_FTRACE is not set

View File

@ -22,26 +22,33 @@ EMPTY=s390x-zfcpdump
# x86_64
x86_64=generic:generic-x86:generic-x86-x86_64
x86_64-debug=generic:generic-x86:generic-x86-x86_64:debug:debug-x86-x86_64
x86_64-kgcov=generic:generic-x86:generic-x86-x86_64:kgcov
# i686
i686=generic:generic-x86:generic-x86-i686
i686-debug=generic:generic-x86:generic-x86-i686:debug:debug-x86
i686-kgcov=generic:generic-x86:generic-x86-i686:kgcov
# ppc64le
ppc64le=generic:generic-powerpc
ppc64le-debug=generic:generic-powerpc:debug:debug-powerpc
ppc64le-kgcov=generic:generic-powerpc:kgcov
# s390x
s390x=generic:generic-s390x
s390x-debug=generic:generic-s390x:debug:debug-s390x
s390x-kgcov=generic:generic-s390x:kgcov
# aarch64
aarch64=generic:generic-arm:generic-arm-aarch64
aarch64-debug=generic:generic-arm:generic-arm-aarch64:debug:debug-arm-aarch64
aarch64-kgcov=generic:generic-arm:generic-arm-aarch64:kgcov
# arm
armv7hl=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-armv7
armv7hl-debug=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-armv7:debug:debug-arm
armv7hl-kgcov=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-armv7:kgcov
armv7hl-lpae=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-lpae
armv7hl-lpae-debug=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-lpae:debug:debug-arm
armv7hl-lpae-kgcov=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-lpae:kgcov

View File

@ -22,15 +22,20 @@ EMPTY=armv7hl armv7hl-debug armv7hl-lpae armv7hl-lpae-debug i686 i686-debug
# x86_64
x86_64=generic:generic-x86:generic-x86-x86_64
x86_64-debug=generic:generic-x86:generic-x86-x86_64:debug:debug-x86-x86_64
x86_64-kgcov=generic:generic-x86:generic-x86-x86_64:kgcov
# ppc64le
ppc64le=generic:generic-powerpc
ppc64le-debug=generic:generic-powerpc:debug:debug-powerpc
ppc64le-kgcov=generic:generic-powerpc:kgcov
# s390x
s390x=generic:generic-s390x
s390x-debug=generic:generic-s390x:debug:debug-s390x
s390x-zfcpdump=generic:generic-s390x:generic-s390x-zfcpdump
s390x-kgcov=generic:generic-s390x:kgcov
# aarch64
aarch64=generic:generic-arm:generic-arm-aarch64
aarch64-debug=generic:generic-arm:generic-arm-aarch64:debug:debug-arm-aarch64
aarch64-kgcov=generic:generic-arm:generic-arm-aarch64:kgcov

View File

@ -0,0 +1,12 @@
# Individual entries must be ordered as
# config-variant=config-1:config-2:config-3 in a descending order through
# the hierarchy
# kernel.config files are build on the fly based on this config,
# the first arg is arch and variant, the second is a hierarchy of
# config options, lowest priority to highest
ORDER=common
EMPTY=
# gcov options
kgcov=kgcov

View File

@ -797,6 +797,7 @@ Source72: filter-s390x.sh.fedora
Source73: filter-modules.sh.fedora
%endif
Source75: partial-kgcov-snip.config
Source80: generate_all_configs.sh
Source81: process_configs.sh
@ -1438,15 +1439,13 @@ for i in %{all_arch_configs}
do
mv $i $i.tmp
./merge.pl %{SOURCE3001} $i.tmp > $i
rm $i.tmp
done
%endif
# enable GCOV kernel config options if gcov is on
%if %{with_gcov}
for i in *.config
do
sed -i 's/# CONFIG_GCOV_KERNEL is not set/CONFIG_GCOV_KERNEL=y\nCONFIG_GCOV_PROFILE_ALL=y\n/' $i
echo "Merging with gcov options"
cat %{SOURCE75}
mv $i $i.tmp
./merge.pl %{SOURCE75} $i.tmp > $i
%endif
rm $i.tmp
done
%endif