From 07493f1c8e8f6c02ba241a9860ee3d353727be88 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Thu, 28 Nov 2024 11:50:24 +0800 Subject: [PATCH] gcov: Add gcov gcc implementation and toolchain to ci compilation When running qemu/nsh_smp or sim/nsh configuration, run gcov -d /tmp/xxx to save all gcov generated data and export them to the host. Use ./tools/gcov.sh to parse and generate reports. For details, see: Documentation/applications/system/gcov/index.rst Signed-off-by: wangmingrong1 --- boards/arm64/qemu/qemu-armv8a/configs/nsh_smp/defconfig | 8 ++++++-- boards/sim/sim/sim/configs/kasan/defconfig | 2 -- boards/sim/sim/sim/configs/nsh/defconfig | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/boards/arm64/qemu/qemu-armv8a/configs/nsh_smp/defconfig b/boards/arm64/qemu/qemu-armv8a/configs/nsh_smp/defconfig index 48663bb3a9..cd9f46b031 100644 --- a/boards/arm64/qemu/qemu-armv8a/configs/nsh_smp/defconfig +++ b/boards/arm64/qemu/qemu-armv8a/configs/nsh_smp/defconfig @@ -23,6 +23,8 @@ CONFIG_BOARDCTL_RESET=y CONFIG_BOARD_ASSERT_RESET_VALUE=2 CONFIG_BOARD_RESET_ON_ASSERT=2 CONFIG_BUILTIN=y +CONFIG_COVERAGE_ALL=y +CONFIG_COVERAGE_MINI=y CONFIG_DEBUG_ASSERTIONS=y CONFIG_DEBUG_FEATURES=y CONFIG_DEBUG_FULLOPT=y @@ -38,12 +40,13 @@ CONFIG_FRAME_POINTER=y CONFIG_FS_PROCFS=y CONFIG_FS_PROCFS_REGISTER=y CONFIG_FS_ROMFS=y +CONFIG_FS_TMPFS=y +CONFIG_HAVE_CXXINITIALIZE=y CONFIG_IDLETHREAD_STACKSIZE=16384 CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_INTELHEX_BINARY=y CONFIG_LIBC_EXECFUNCS=y -CONFIG_MM_KASAN=y -CONFIG_MM_KASAN_GLOBAL=y +CONFIG_LIBC_MEMFD_ERROR=y CONFIG_NSH_ARCHINIT=y CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_FILEIOSIZE=512 @@ -66,6 +69,7 @@ CONFIG_STACK_COLORATION=y CONFIG_START_MONTH=3 CONFIG_START_YEAR=2022 CONFIG_SYMTAB_ORDEREDBYNAME=y +CONFIG_SYSTEM_GCOV=y CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_SYSTEM=y CONFIG_SYSTEM_TASKSET=y diff --git a/boards/sim/sim/sim/configs/kasan/defconfig b/boards/sim/sim/sim/configs/kasan/defconfig index 22c1e04eae..ada4467c45 100644 --- a/boards/sim/sim/sim/configs/kasan/defconfig +++ b/boards/sim/sim/sim/configs/kasan/defconfig @@ -13,7 +13,6 @@ CONFIG_ARCH_SIM=y CONFIG_BOARDCTL_POWEROFF=y CONFIG_BUILTIN=y CONFIG_CANCELLATION_POINTS=y -CONFIG_COVERAGE_TOOLCHAIN=y CONFIG_DEBUG_FEATURES=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEV_LOOP=y @@ -45,7 +44,6 @@ CONFIG_SCHED_LPWORK=y CONFIG_SCHED_WAITPID=y CONFIG_SIG_DEFAULT=y CONFIG_SIG_EVTHREAD=y -CONFIG_SYSTEM_GCOV=y CONFIG_SYSTEM_NSH=y CONFIG_TESTING_OSTEST=y CONFIG_TESTING_OSTEST_AIO=y diff --git a/boards/sim/sim/sim/configs/nsh/defconfig b/boards/sim/sim/sim/configs/nsh/defconfig index eaa288908c..891491ca46 100644 --- a/boards/sim/sim/sim/configs/nsh/defconfig +++ b/boards/sim/sim/sim/configs/nsh/defconfig @@ -16,6 +16,8 @@ CONFIG_BOARDCTL_POWEROFF=y CONFIG_BOARD_LOOPSPERMSEC=0 CONFIG_BOOT_RUNFROMEXTSRAM=y CONFIG_BUILTIN=y +CONFIG_COVERAGE_ALL=y +CONFIG_COVERAGE_TOOLCHAIN=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEV_GPIO=y CONFIG_DEV_LOOP=y @@ -33,6 +35,7 @@ CONFIG_FS_PROCFS=y CONFIG_FS_RAMMAP=y CONFIG_FS_ROMFS=y CONFIG_GPIO_LOWER_HALF=y +CONFIG_HAVE_CXXINITIALIZE=y CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_IOEXPANDER=y @@ -62,5 +65,6 @@ CONFIG_SIM_WALLTIME_SIGNAL=y CONFIG_START_MONTH=6 CONFIG_START_YEAR=2008 CONFIG_SYSTEM_DUMPSTACK=y +CONFIG_SYSTEM_GCOV=y CONFIG_SYSTEM_NSH=y CONFIG_TESTING_OSTEST=y