COVERAGE: Fix COVERAGE_GCOV dependencies

CONFIG_COVERAGE has been incorrectly used to
change other kconfig options (stack sizes, etc)
code defaults, as well as some samples behaviour,
which should not have dependend on it.

Instead those should have depended on COVERAGE_GCOV,
which, being the one which adds special code and
temporary RAM storage for embedded targets,
require changes to many features.

When building for the native targets, all this was
unnecessary.

=> Fix the dependency.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-08-09 17:29:19 +02:00 committed by Carles Cufí
parent 818aa2d0c7
commit 9eeb78d86d
14 changed files with 17 additions and 17 deletions

View file

@ -53,7 +53,7 @@ config CMSIS_V2_THREAD_DYNAMIC_STACK_SIZE
default 2048
config IPM_CONSOLE_STACK_SIZE
default 4096 if COVERAGE
default 4096 if COVERAGE_GCOV
default 1024
endmenu

View file

@ -49,7 +49,7 @@ config TEST_EXTRA_STACK_SIZE
default 2048
config IPM_CONSOLE_STACK_SIZE
default 4096 if COVERAGE
default 4096 if COVERAGE_GCOV
default 1024
config NET_TX_STACK_SIZE

View file

@ -16,7 +16,7 @@ endif # SERIAL
config ZTEST_STACK_SIZE
default 4096 if ZTEST
if COVERAGE
if COVERAGE_GCOV
config MAIN_STACK_SIZE
default 4096
@ -33,6 +33,6 @@ config ISR_STACK_SIZE
config TEST_EXTRA_STACK_SIZE
default 4096
endif # COVERAGE
endif # COVERAGE_GCOV
endif

View file

@ -165,7 +165,7 @@ config IPM_CONSOLE_RECEIVER
config IPM_CONSOLE_STACK_SIZE
int "Stack size for IPM console receiver thread"
depends on IPM_CONSOLE_RECEIVER
default 2048 if COVERAGE
default 2048 if COVERAGE_GCOV
default 512
help
Each instance of the IPM console receiver driver creates a worker

View file

@ -14,6 +14,6 @@ void gcov_static_init(void);
static inline void gcov_coverage_dump(void) { }
static inline void gcov_static_init(void) { }
#endif /* CONFIG_COVERAGE */
#endif /* CONFIG_COVERAGE_GCOV */
#endif /* ZEPHYR_INCLUDE_DEBUG_GCOV_H_ */

View file

@ -497,7 +497,7 @@ endmenu
menu "Work Queue Options"
config SYSTEM_WORKQUEUE_STACK_SIZE
int "System workqueue stack size"
default 4096 if COVERAGE
default 4096 if COVERAGE_GCOV
default 1024
config SYSTEM_WORKQUEUE_PRIORITY

View file

@ -8,7 +8,7 @@
#define MY_PORT 4242
#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) || defined(CONFIG_NET_TCP) || \
defined(CONFIG_COVERAGE)
defined(CONFIG_COVERAGE_GCOV)
#define STACK_SIZE 4096
#else
#define STACK_SIZE 2048

View file

@ -15,7 +15,7 @@ if CMSIS_RTOS_V1
config CMSIS_THREAD_MAX_STACK_SIZE
int "Max stack size threads can be allocated in CMSIS RTOS application"
default 4096 if COVERAGE
default 4096 if COVERAGE_GCOV
default 512
help
Mention max stack size threads can be allocated in CMSIS RTOS application.

View file

@ -36,14 +36,14 @@ config CMSIS_V2_THREAD_DYNAMIC_MAX_COUNT
config CMSIS_V2_THREAD_MAX_STACK_SIZE
int "Max stack size threads can be allocated in CMSIS RTOS V2 application"
default 4096 if COVERAGE
default 4096 if COVERAGE_GCOV
default 512
help
Mention max stack size threads can be allocated in CMSIS RTOS V2 application.
config CMSIS_V2_THREAD_DYNAMIC_STACK_SIZE
int "Dynamic stack size threads are allocated in CMSIS RTOS V2 application"
default 4096 if COVERAGE
default 4096 if COVERAGE_GCOV
default 512
help
Mention dynamic stack size threads are allocated in CMSIS RTOS V2 application.

View file

@ -138,7 +138,7 @@ config USB_WORKQUEUE
config USB_WORKQUEUE_STACK_SIZE
int "USB workqueue stack size"
depends on USB_WORKQUEUE
default 4096 if COVERAGE
default 4096 if COVERAGE_GCOV
default 1024
config USB_WORKQUEUE_PRIORITY

View file

@ -29,7 +29,7 @@
#define NON_NULL_PTR ((void *)0x12345678)
#ifdef CONFIG_COVERAGE
#ifdef CONFIG_COVERAGE_GCOV
#define OFFLOAD_WORKQUEUE_STACK_SIZE 4096
#else
#define OFFLOAD_WORKQUEUE_STACK_SIZE 1024

View file

@ -92,7 +92,7 @@ static void thread_time_slice(void *p1, void *p2, void *p3)
thread_idx = (thread_idx + 1) % NUM_THREAD;
/** TESTPOINT: timeslice should be reset for each preemptive thread */
#ifndef CONFIG_COVERAGE
#ifndef CONFIG_COVERAGE_GCOV
zassert_true(t >= expected_slice_min,
"timeslice too small, expected %u got %u",
expected_slice_min, t);
@ -101,7 +101,7 @@ static void thread_time_slice(void *p1, void *p2, void *p3)
expected_slice_max, t);
#else
(void)t;
#endif /* CONFIG_COVERAGE */
#endif /* CONFIG_COVERAGE_GCOV */
/* Keep the current thread busy for more than one slice, even though,
* when timeslice used up the next thread should be scheduled in.

View file

@ -31,7 +31,7 @@
#define NUM_MILLISECONDS 50
#define TEST_TIMEOUT 200
#ifdef CONFIG_COVERAGE
#ifdef CONFIG_COVERAGE_GCOV
#define OFFLOAD_WORKQUEUE_STACK_SIZE 4096
#else
#define OFFLOAD_WORKQUEUE_STACK_SIZE 1024

View file

@ -8,7 +8,7 @@
#include <zephyr/kernel.h>
#include <cmsis_os.h>
#ifdef CONFIG_COVERAGE
#ifdef CONFIG_COVERAGE_GCOV
#define STACKSZ (512 + CONFIG_TEST_EXTRA_STACK_SIZE)
#else
#define STACKSZ (512U)