You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/09 13:27:54 UTC

(nuttx) branch master updated (8fe6c0ee8e -> 47fc3a67f7)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from 8fe6c0ee8e arch/x86_64: Map the new page table with read-write permissions
     new 034af29aab arch: adjust gcov configuration name
     new 47fc3a67f7 sim/kconfig: delete non-existent dependencie

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/Kconfig                               | 19 -------------------
 arch/arm/src/common/Toolchain.defs         |  6 +-----
 arch/arm64/src/Toolchain.defs              |  6 +-----
 arch/arm64/src/cmake/Toolchain.cmake       |  4 ----
 arch/arm64/src/cmake/platform.cmake        |  2 +-
 arch/risc-v/src/cmake/Toolchain.cmake      |  2 +-
 arch/risc-v/src/cmake/platform.cmake       |  2 +-
 arch/risc-v/src/common/Toolchain.defs      |  6 +-----
 arch/sim/Kconfig                           |  7 +++++++
 arch/sim/src/Makefile                      |  2 +-
 arch/sim/src/cmake/Toolchain.cmake         |  2 +-
 arch/sim/src/sim/CMakeLists.txt            |  2 +-
 arch/sim/src/sim/posix/sim_hostmisc.c      |  4 ++--
 arch/x86_64/src/cmake/Toolchain.cmake      |  2 +-
 arch/x86_64/src/cmake/platform.cmake       |  2 +-
 arch/xtensa/src/lx6/Toolchain.defs         |  6 +-----
 arch/xtensa/src/lx7/Toolchain.defs         |  6 +-----
 boards/sim/sim/sim/configs/kasan/defconfig |  2 +-
 boards/sim/sim/sim/scripts/Make.defs       |  2 +-
 sched/Kconfig                              | 12 ++++++++++++
 tools/Config.mk                            |  2 +-
 21 files changed, 37 insertions(+), 61 deletions(-)


(nuttx) 01/02: arch: adjust gcov configuration name

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 034af29aabef65d4d6502add49f1f52ffed07532
Author: yinshengkai <yi...@xiaomi.com>
AuthorDate: Tue Apr 9 18:25:38 2024 +0800

    arch: adjust gcov configuration name
    
    Signed-off-by: yinshengkai <yi...@xiaomi.com>
---
 arch/Kconfig                               | 19 -------------------
 arch/arm/src/common/Toolchain.defs         |  6 +-----
 arch/arm64/src/Toolchain.defs              |  6 +-----
 arch/arm64/src/cmake/Toolchain.cmake       |  4 ----
 arch/arm64/src/cmake/platform.cmake        |  2 +-
 arch/risc-v/src/cmake/Toolchain.cmake      |  2 +-
 arch/risc-v/src/cmake/platform.cmake       |  2 +-
 arch/risc-v/src/common/Toolchain.defs      |  6 +-----
 arch/sim/Kconfig                           |  8 ++++++++
 arch/sim/src/Makefile                      |  2 +-
 arch/sim/src/cmake/Toolchain.cmake         |  2 +-
 arch/sim/src/sim/CMakeLists.txt            |  2 +-
 arch/sim/src/sim/posix/sim_hostmisc.c      |  4 ++--
 arch/x86_64/src/cmake/Toolchain.cmake      |  2 +-
 arch/x86_64/src/cmake/platform.cmake       |  2 +-
 arch/xtensa/src/lx6/Toolchain.defs         |  6 +-----
 arch/xtensa/src/lx7/Toolchain.defs         |  6 +-----
 boards/sim/sim/sim/configs/kasan/defconfig |  2 +-
 boards/sim/sim/sim/scripts/Make.defs       |  2 +-
 sched/Kconfig                              | 12 ++++++++++++
 tools/Config.mk                            |  2 +-
 21 files changed, 38 insertions(+), 61 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 9237150062..746b97c1ae 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -311,25 +311,6 @@ config ARCH_SIZET_LONG
 		C++ library routines because the NuttX size_t might not have
 		the same underlying type as your toolchain's size_t.
 
-config ARCH_COVERAGE
-	bool "Enable code coverage analysis"
-	select HAVE_CXXINITIALIZE
-	default n
-	---help---
-		Generate code coverage
-
-config ARCH_COVERAGE_ALL
-	bool "Enable code coverage for the entire image"
-	depends on ARCH_COVERAGE
-	default n
-	---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.
-
 config ARCH_INSTRUMENT_ALL
 	bool "Instrument All"
 	default n
diff --git a/arch/arm/src/common/Toolchain.defs b/arch/arm/src/common/Toolchain.defs
index 69fd68dcdc..03f7b6bce0 100644
--- a/arch/arm/src/common/Toolchain.defs
+++ b/arch/arm/src/common/Toolchain.defs
@@ -72,10 +72,6 @@ ifneq ($(CONFIG_STACK_USAGE_WARNING),0)
   ARCHOPTIMIZATION += -Wstack-usage=$(CONFIG_STACK_USAGE_WARNING)
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
-  ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
-endif
-
 ifeq ($(CONFIG_MM_UBSAN_ALL),y)
   ARCHOPTIMIZATION += $(CONFIG_MM_UBSAN_OPTION)
 endif
@@ -491,7 +487,7 @@ ifeq ($(CONFIG_LIBSUPCXX),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE),y)
+ifeq ($(CONFIG_SCHED_GCOV),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcov.a))
 endif
 
diff --git a/arch/arm64/src/Toolchain.defs b/arch/arm64/src/Toolchain.defs
index b8917db48a..b785e1d403 100644
--- a/arch/arm64/src/Toolchain.defs
+++ b/arch/arm64/src/Toolchain.defs
@@ -66,10 +66,6 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
   ARCHOPTIMIZATION += -fstack-protector-all
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
-  ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
-endif
-
 ifeq ($(CONFIG_MM_UBSAN_ALL),y)
   ARCHOPTIMIZATION += $(CONFIG_MM_UBSAN_OPTION)
 endif
@@ -196,7 +192,7 @@ ifeq ($(CONFIG_LIBSUPCXX),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE),y)
+ifeq ($(CONFIG_SCHED_GCOV),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcov.a))
 endif
 
diff --git a/arch/arm64/src/cmake/Toolchain.cmake b/arch/arm64/src/cmake/Toolchain.cmake
index 38113dba40..c1f08d46e3 100644
--- a/arch/arm64/src/cmake/Toolchain.cmake
+++ b/arch/arm64/src/cmake/Toolchain.cmake
@@ -107,10 +107,6 @@ if(CONFIG_STACK_CANARIES)
   add_compile_options(-fstack-protector-all)
 endif()
 
-if(CONFIG_ARCH_COVERAGE_ALL)
-  add_compile_options(-fprofile-generate -ftest-coverage)
-endif()
-
 if(CONFIG_MM_UBSAN_ALL)
   add_compile_options(${CONFIG_MM_UBSAN_OPTION})
 endif()
diff --git a/arch/arm64/src/cmake/platform.cmake b/arch/arm64/src/cmake/platform.cmake
index 0f12b7ffc0..71795cda38 100644
--- a/arch/arm64/src/cmake/platform.cmake
+++ b/arch/arm64/src/cmake/platform.cmake
@@ -56,7 +56,7 @@ if(CONFIG_LIBSUPCXX)
     OUTPUT_VARIABLE extra_library)
   list(APPEND EXTRA_LIB ${extra_library})
 endif()
-if(CONFIG_ARCH_COVERAGE)
+if(CONFIG_SCHED_GCOV)
   execute_process(
     COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
             --print-file-name=libgcov.a
diff --git a/arch/risc-v/src/cmake/Toolchain.cmake b/arch/risc-v/src/cmake/Toolchain.cmake
index a409c1097c..caac1972ae 100644
--- a/arch/risc-v/src/cmake/Toolchain.cmake
+++ b/arch/risc-v/src/cmake/Toolchain.cmake
@@ -158,7 +158,7 @@ if(${CONFIG_STACK_USAGE_WARNING})
   endif()
 endif()
 
-if(CONFIG_ARCH_COVERAGE)
+if(CONFIG_SCHED_GCOV)
   add_compile_options(-fprofile-generate -ftest-coverage)
 endif()
 
diff --git a/arch/risc-v/src/cmake/platform.cmake b/arch/risc-v/src/cmake/platform.cmake
index daaad0ae05..df38ed77d1 100644
--- a/arch/risc-v/src/cmake/platform.cmake
+++ b/arch/risc-v/src/cmake/platform.cmake
@@ -61,7 +61,7 @@ if(CONFIG_LIBSUPCXX)
   list(APPEND EXTRA_LIB ${extra_library})
 endif()
 
-if(CONFIG_ARCH_COVERAGE)
+if(CONFIG_SCHED_GCOV)
   execute_process(
     COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
             --print-file-name=libgcov.a
diff --git a/arch/risc-v/src/common/Toolchain.defs b/arch/risc-v/src/common/Toolchain.defs
index c91183d8f7..5a67042a56 100644
--- a/arch/risc-v/src/common/Toolchain.defs
+++ b/arch/risc-v/src/common/Toolchain.defs
@@ -81,10 +81,6 @@ ifneq ($(CONFIG_STACK_USAGE_WARNING),0)
   ARCHOPTIMIZATION += -Wstack-usage=$(CONFIG_STACK_USAGE_WARNING)
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
-  ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
-endif
-
 ARCHCFLAGS += -fno-common
 ARCHCXXFLAGS += -fno-common
 
@@ -400,7 +396,7 @@ ifeq ($(CONFIG_LIBSUPCXX),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE),y)
+ifeq ($(CONFIG_SCHED_GCOV),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcov.a))
 endif
 
diff --git a/arch/sim/Kconfig b/arch/sim/Kconfig
index 90eba49a7b..78ca9ac7db 100644
--- a/arch/sim/Kconfig
+++ b/arch/sim/Kconfig
@@ -90,6 +90,14 @@ config SIM_UBSAN_DUMMY
 	---help---
 		Keep SIM_UBSAN compile time but disable runtime actions.
 
+config SIM_GCOV_ALL
+	bool "Enable code coverage for the entire image"
+	depends on COVERAGE
+	default n
+	---help---
+		This option activates code coverage instrumentation for the
+		entire image.
+
 choice
 	prompt "X64_64 ABI"
 	default SIM_X8664_SYSTEMV if HOST_LINUX
diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile
index 2f25984ed4..c466dc18c8 100644
--- a/arch/sim/src/Makefile
+++ b/arch/sim/src/Makefile
@@ -140,7 +140,7 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
   STDLIBS += -lm
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE),y)
+ifeq ($(CONFIG_SCHED_GCOV),y)
   STDLIBS += -lgcov
 endif
 
diff --git a/arch/sim/src/cmake/Toolchain.cmake b/arch/sim/src/cmake/Toolchain.cmake
index 024168d4e2..a480c004e7 100644
--- a/arch/sim/src/cmake/Toolchain.cmake
+++ b/arch/sim/src/cmake/Toolchain.cmake
@@ -88,7 +88,7 @@ if(CONFIG_STACK_USAGE_WARNING)
   add_compile_options(-Wstack-usage=${CONFIG_STACK_USAGE_WARNING})
 endif()
 
-if(CONFIG_SIM_GCOV_ALL)
+if(CONFIG_SCHED_GCOV)
   add_compile_options(-fprofile-generate -ftest-coverage)
 endif()
 
diff --git a/arch/sim/src/sim/CMakeLists.txt b/arch/sim/src/sim/CMakeLists.txt
index a4e114b147..f6fbc72489 100644
--- a/arch/sim/src/sim/CMakeLists.txt
+++ b/arch/sim/src/sim/CMakeLists.txt
@@ -27,7 +27,7 @@ set(HOSTSRCS)
 set(HOST_INCLUDE_DIRS)
 set(STDLIBS pthread)
 
-if(CONFIG_ARCH_COVERAGE)
+if(CONFIG_SCHED_GCOV)
   list(APPEND STDLIBS gcov)
 endif()
 
diff --git a/arch/sim/src/sim/posix/sim_hostmisc.c b/arch/sim/src/sim/posix/sim_hostmisc.c
index a8b3f2584e..44f3f19c87 100644
--- a/arch/sim/src/sim/posix/sim_hostmisc.c
+++ b/arch/sim/src/sim/posix/sim_hostmisc.c
@@ -50,7 +50,7 @@
  * Public Function Prototypes
  ****************************************************************************/
 
-#ifdef CONFIG_ARCH_COVERAGE
+#ifdef CONFIG_SCHED_GCOV
 void __gcov_dump(void);
 #endif
 
@@ -72,7 +72,7 @@ extern int backtrace(void **array, int size);
 
 void host_abort(int status)
 {
-#ifdef CONFIG_ARCH_COVERAGE
+#ifdef CONFIG_SCHED_GCOV
   /* Dump gcov data. */
 
   host_uninterruptible_no_return(__gcov_dump);
diff --git a/arch/x86_64/src/cmake/Toolchain.cmake b/arch/x86_64/src/cmake/Toolchain.cmake
index 6b38198c80..8885f3f054 100644
--- a/arch/x86_64/src/cmake/Toolchain.cmake
+++ b/arch/x86_64/src/cmake/Toolchain.cmake
@@ -75,7 +75,7 @@ if(${CONFIG_STACK_USAGE_WARNING})
   endif()
 endif()
 
-if(CONFIG_ARCH_COVERAGE)
+if(CONFIG_SCHED_GCOV)
   add_compile_options(-fprofile-generate -ftest-coverage)
 endif()
 
diff --git a/arch/x86_64/src/cmake/platform.cmake b/arch/x86_64/src/cmake/platform.cmake
index a160c03b35..7ad51311a4 100644
--- a/arch/x86_64/src/cmake/platform.cmake
+++ b/arch/x86_64/src/cmake/platform.cmake
@@ -59,7 +59,7 @@ if(CONFIG_LIBSUPCXX)
   list(APPEND EXTRA_LIB ${extra_library})
 endif()
 
-if(CONFIG_ARCH_COVERAGE)
+if(CONFIG_SCHED_GCOV)
   execute_process(
     COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${NUTTX_EXTRA_FLAGS}
             --print-file-name=libgcov.a
diff --git a/arch/xtensa/src/lx6/Toolchain.defs b/arch/xtensa/src/lx6/Toolchain.defs
index c1e9d6b62e..9f8eb9620e 100644
--- a/arch/xtensa/src/lx6/Toolchain.defs
+++ b/arch/xtensa/src/lx6/Toolchain.defs
@@ -91,10 +91,6 @@ ifneq ($(CONFIG_STACK_USAGE_WARNING),0)
   ARCHOPTIMIZATION += -Wstack-usage=$(CONFIG_STACK_USAGE_WARNING)
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
-  ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
-endif
-
 # Instrumentation options
 
 ifeq ($(CONFIG_ARCH_INSTRUMENT_ALL),y)
@@ -195,7 +191,7 @@ ifeq ($(CONFIG_LIBSUPCXX),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE),y)
+ifeq ($(CONFIG_SCHED_GCOV),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcov.a))
 endif
 
diff --git a/arch/xtensa/src/lx7/Toolchain.defs b/arch/xtensa/src/lx7/Toolchain.defs
index caad6d2811..071ccd9d05 100644
--- a/arch/xtensa/src/lx7/Toolchain.defs
+++ b/arch/xtensa/src/lx7/Toolchain.defs
@@ -95,10 +95,6 @@ ifneq ($(CONFIG_STACK_USAGE_WARNING),0)
   ARCHOPTIMIZATION += -Wstack-usage=$(CONFIG_STACK_USAGE_WARNING)
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
-  ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
-endif
-
 # Instrumentation options
 
 ifeq ($(CONFIG_ARCH_INSTRUMENT_ALL),y)
@@ -199,7 +195,7 @@ ifeq ($(CONFIG_LIBSUPCXX),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE),y)
+ifeq ($(CONFIG_SCHED_GCOV),y)
   EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcov.a))
 endif
 
diff --git a/boards/sim/sim/sim/configs/kasan/defconfig b/boards/sim/sim/sim/configs/kasan/defconfig
index ea9b255517..34b43ed9a2 100644
--- a/boards/sim/sim/sim/configs/kasan/defconfig
+++ b/boards/sim/sim/sim/configs/kasan/defconfig
@@ -9,7 +9,6 @@ CONFIG_ARCH="sim"
 CONFIG_ARCH_BOARD="sim"
 CONFIG_ARCH_BOARD_SIM=y
 CONFIG_ARCH_CHIP="sim"
-CONFIG_ARCH_COVERAGE=y
 CONFIG_ARCH_SIM=y
 CONFIG_BOARDCTL_POWEROFF=y
 CONFIG_BUILTIN=y
@@ -39,6 +38,7 @@ CONFIG_PTHREAD_MUTEX_TYPES=y
 CONFIG_PTHREAD_MUTEX_UNSAFE=y
 CONFIG_READLINE_TABCOMPLETION=y
 CONFIG_RR_INTERVAL=10
+CONFIG_SCHED_GCOV=y
 CONFIG_SCHED_HAVE_PARENT=y
 CONFIG_SCHED_LPWORK=y
 CONFIG_SCHED_WAITPID=y
diff --git a/boards/sim/sim/sim/scripts/Make.defs b/boards/sim/sim/sim/scripts/Make.defs
index 08a20a7b2c..c38a6c60ea 100644
--- a/boards/sim/sim/sim/scripts/Make.defs
+++ b/boards/sim/sim/sim/scripts/Make.defs
@@ -72,7 +72,7 @@ ifneq ($(CONFIG_STACK_USAGE_WARNING),0)
   ARCHOPTIMIZATION += -Wstack-usage=$(CONFIG_STACK_USAGE_WARNING)
 endif
 
-ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
+ifeq ($(CONFIG_SIM_GCOV_ALL),y)
   ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
 endif
 
diff --git a/sched/Kconfig b/sched/Kconfig
index 38dfe43443..b765ef6856 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -1341,6 +1341,18 @@ config SCHED_STACK_RECORD
 		to disable.Through instrumentation, record the backtrace at
 		the deepest point in the stack.
 
+config SCHED_GCOV
+	bool "Enable GCOV support"
+	select HAVE_CXXINITIALIZE
+	default n
+	---help---
+		Enable GCOV support for code coverage analysis.
+		After turning on this option, code coverage can be analyzed.
+		If this option is enabled, image size and performance will be
+		significantly reduced. Before use, you need to add the
+		"-fprofile-generate -ftest-coverage" compilation parameters
+		to the file to be analyzed.
+
 endmenu
 
 menu "Files and I/O"
diff --git a/tools/Config.mk b/tools/Config.mk
index 584bab754f..2637786f0e 100644
--- a/tools/Config.mk
+++ b/tools/Config.mk
@@ -659,7 +659,7 @@ endef
 
 # CLEAN - Default clean target
 
-ifeq ($(CONFIG_ARCH_COVERAGE),y)
+ifeq ($(CONFIG_SCHED_GCOV),y)
 	EXTRA = *.gcno *.gcda
 endif
 


(nuttx) 02/02: sim/kconfig: delete non-existent dependencie

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 47fc3a67f776253259b87bd359b74e3945d60fad
Author: wangmingrong1 <wa...@xiaomi.com>
AuthorDate: Tue Jul 16 16:26:17 2024 +0800

    sim/kconfig: delete non-existent dependencie
    
    Signed-off-by: wangmingrong1 <wa...@xiaomi.com>
---
 arch/sim/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/sim/Kconfig b/arch/sim/Kconfig
index 78ca9ac7db..92ce5edf66 100644
--- a/arch/sim/Kconfig
+++ b/arch/sim/Kconfig
@@ -92,7 +92,6 @@ config SIM_UBSAN_DUMMY
 
 config SIM_GCOV_ALL
 	bool "Enable code coverage for the entire image"
-	depends on COVERAGE
 	default n
 	---help---
 		This option activates code coverage instrumentation for the