arch: Add ARCH_COVERAGE_ALL option

so the user could disable the full image instrumentation,
but enable the instrumentation by files or directories.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-08-20 06:38:35 +08:00 committed by Petro Karashchenko
parent f1355680ca
commit c44a7cbf88
12 changed files with 23 additions and 11 deletions

View File

@ -304,6 +304,18 @@ config ARCH_COVERAGE
---help---
Generate code coverage
config ARCH_COVERAGE_ALL
bool "Enable code coverage for the entire image"
depends on ARCH_COVERAGE
default y
---help---
This option activates code coverage instrumentation for the
entire image. If you don't enable this option, you have to
explicitly specify "-fprofile-generate -ftest-coverage" for
the files/directories you want to check. Enabling this option
will get image size increased and performance decreased
significantly.
comment "Architecture Options"
config ARCH_NOINTC

View File

@ -75,7 +75,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -79,7 +79,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -120,7 +120,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -81,7 +81,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -69,7 +69,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -81,7 +81,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -58,7 +58,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -63,7 +63,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -75,7 +75,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -75,7 +75,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -67,7 +67,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif