From a3d91c4f47e9e67b2f0e25b3e81ceb0337a31ca4 Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Wed, 8 Jan 2020 14:49:43 +0530 Subject: [PATCH] gpu: nvgpu: build unit tests for safety qnx based on umbrella chosen Earlier, libnvgpu-drv.so and unit tests were being built with safety debug profile unconditionally for all qnx and l4t builds. In order to get coverage numbers corresponding to the release build let us remove the overriding of the build profile for safety qnx build. This also needs that these components are built only for safety qnx and l4t builds. For x86 and L4T userspace build, default profile is still set to safety-debug. JIRA NVGPU-4830 Change-Id: I02f572761bda9eb0c1b8fcdf7b22a07a9d10303a Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2275764 Tested-by: mobile promotions Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- Makefile.umbrella.tmk | 13 +++++++++++++ drivers/gpu/nvgpu/Makefile.tmk | 4 ++-- userspace/Makefile | 10 ++-------- userspace/Makefile.tmk | 4 ++-- userspace/units/Makefile.units.common.tmk | 3 +++ 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Makefile.umbrella.tmk b/Makefile.umbrella.tmk index e43bf3428..c574adcbb 100644 --- a/Makefile.umbrella.tmk +++ b/Makefile.umbrella.tmk @@ -32,6 +32,18 @@ NV_REPOSITORY_COMPONENTS := ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_INTEGRITY),1) + +ifeq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) +ifeq ($(NV_BUILD_CONFIGURATION_IS_SAFETY),1) +# On QNX, the unit tests are built only for safety profile. +build_nvgpu_ut := 1 +endif +else +# On L4T, the unit tests are built with safety profile forced. +build_nvgpu_ut := 1 +endif + +ifeq ($(build_nvgpu_ut),1) NV_REPOSITORY_COMPONENTS := drivers/gpu/nvgpu NV_REPOSITORY_COMPONENTS += userspace NV_REPOSITORY_COMPONENTS += userspace/units/posix/bitops @@ -148,6 +160,7 @@ NV_REPOSITORY_COMPONENTS += userspace/units/sync NV_REPOSITORY_COMPONENTS += userspace/units/mock-iospace NV_REPOSITORY_COMPONENTS += userspace/units/ecc endif +endif # Local Variables: # indent-tabs-mode: t diff --git a/drivers/gpu/nvgpu/Makefile.tmk b/drivers/gpu/nvgpu/Makefile.tmk index 4ea5ea64b..fef42393c 100644 --- a/drivers/gpu/nvgpu/Makefile.tmk +++ b/drivers/gpu/nvgpu/Makefile.tmk @@ -51,14 +51,14 @@ NV_COMPONENT_INCLUDES := \ $(NVGPU_NEXT_SOURCE)/../../../include ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += pthread +NVGPU_FORCE_SAFETY_PROFILE := 1 +NVGPU_FORCE_DEBUG_PROFILE := 1 endif NV_COMPONENT_CFLAGS += \ -D__NVGPU_POSIX__ \ -DCONFIG_NVGPU_SUPPORT_TURING \ -D__NVGPU_UNIT_TEST__ -NVGPU_FORCE_SAFETY_PROFILE := 1 -NVGPU_FORCE_DEBUG_PROFILE := 1 -include $(NV_COMPONENT_DIR)/Makefile.shared.configs NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS) diff --git a/userspace/Makefile b/userspace/Makefile index dfc297a4a..4ce634961 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -70,15 +70,9 @@ CONFIGS := -D__NVGPU_POSIX__ \ -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT \ -D__NVGPU_UNIT_TEST__ -# For target "libnvgpu", safety profile should be used -# safety-debug profile is used otherwise -ifeq ( ,$(findstring libnvgpu, '$(MAKECMDGOALS)')) -NVGPU_FORCE_DEBUG_PROFILE := 1 -else -NVGPU_FORCE_DEBUG_PROFILE := 0 -endif - +# safety-debug profile is used by default NVGPU_FORCE_SAFETY_PROFILE := 1 +NVGPU_FORCE_DEBUG_PROFILE := 1 include $(NVGPU_SRC)/Makefile.shared.configs CONFIGS+=$(NVGPU_COMMON_CFLAGS) diff --git a/userspace/Makefile.tmk b/userspace/Makefile.tmk index c848ede93..264edcc82 100644 --- a/userspace/Makefile.tmk +++ b/userspace/Makefile.tmk @@ -137,14 +137,14 @@ NV_COMPONENT_INCLUDES := \ ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += pthread NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += dl +NVGPU_FORCE_SAFETY_PROFILE := 1 +NVGPU_FORCE_DEBUG_PROFILE := 1 endif NV_COMPONENT_CFLAGS += \ -D__NVGPU_POSIX__ \ -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT -NVGPU_FORCE_SAFETY_PROFILE := 1 -NVGPU_FORCE_DEBUG_PROFILE := 1 -include ../drivers/gpu/nvgpu/Makefile.shared.configs NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS) diff --git a/userspace/units/Makefile.units.common.tmk b/userspace/units/Makefile.units.common.tmk index f48776d72..3c3c1b35d 100644 --- a/userspace/units/Makefile.units.common.tmk +++ b/userspace/units/Makefile.units.common.tmk @@ -56,8 +56,11 @@ endif NV_COMPONENT_CFLAGS += -D__NVGPU_UNIT_TEST__ NV_COMPONENT_CFLAGS += -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT +ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) NVGPU_FORCE_SAFETY_PROFILE := 1 NVGPU_FORCE_DEBUG_PROFILE := 1 +endif + -include $(NV_SOURCE)/kernel/nvgpu/drivers/gpu/nvgpu/Makefile.shared.configs NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS)