mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 02:52:51 +03:00
gpu: nvgpu: Disable logging for safety build
This patch adds a conditional flag to filter out logging functions from safety release build. Logging functions are replaced with stubs. Jira NVGPU-869 Change-Id: If898b9ce8edb260727df28b407df83f0a92f61ad Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2109509 Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
d8b2e22de9
commit
6f37ac5de2
@@ -66,6 +66,7 @@ CONFIGS := -D__NVGPU_POSIX__ \
|
||||
-D__NVGPU_UNIT_TEST__
|
||||
|
||||
NVGPU_FORCE_SAFETY_PROFILE := 1
|
||||
NVGPU_FORCE_DEBUG_PROFILE := 1
|
||||
include $(NVGPU_SRC)/Makefile.shared.configs
|
||||
CONFIGS+=$(NVGPU_COMMON_CFLAGS)
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ NV_COMPONENT_CFLAGS += \
|
||||
-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)
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ NV_COMPONENT_CFLAGS += -D__NVGPU_UNIT_TEST__
|
||||
endif
|
||||
|
||||
NVGPU_FORCE_SAFETY_PROFILE := 1
|
||||
NVGPU_FORCE_DEBUG_PROFILE := 1
|
||||
-include $(NV_SOURCE)/kernel/nvgpu/drivers/gpu/nvgpu/Makefile.shared.configs
|
||||
NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS)
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include "nvgpu-fifo.h"
|
||||
#include "nvgpu-fifo-gv11b.h"
|
||||
|
||||
static struct unit_module *global_m;
|
||||
|
||||
bool test_fifo_subtest_pruned(u32 branches, u32 final_branches)
|
||||
{
|
||||
u32 match = branches & final_branches;
|
||||
@@ -93,7 +95,7 @@ static int stub_userd_setup_sw(struct gk20a *g)
|
||||
|
||||
err = nvgpu_userd_init_slabs(g);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "failed to init userd support");
|
||||
unit_err(global_m, "failed to init userd support");
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -116,6 +118,7 @@ int test_fifo_init_support(struct unit_module *m, struct gk20a *g, void *args)
|
||||
g->ops.tsg.init_eng_method_buffers = NULL;
|
||||
|
||||
#ifdef CONFIG_NVGPU_USERD
|
||||
global_m = m;
|
||||
/*
|
||||
* Regular USERD init requires bar1.vm to be initialized
|
||||
* Use a stub in unit tests, since it will be disabled in
|
||||
|
||||
@@ -472,7 +472,7 @@ static int test_nvgpu_gmmu_map_unmap(struct unit_module *m,
|
||||
unit_return_fail(m, "Mapped VA is not 4KB-aligned\n");
|
||||
}
|
||||
|
||||
nvgpu_log(g, gpu_dbg_map, "Mapped VA=%p", (void *) mem.gpu_va);
|
||||
unit_info(m, "Mapped VA=%p", (void *) mem.gpu_va);
|
||||
|
||||
/*
|
||||
* Based on the VA returned from gmmu_map, lookup the corresponding
|
||||
@@ -482,7 +482,7 @@ static int test_nvgpu_gmmu_map_unmap(struct unit_module *m,
|
||||
if (result != 0) {
|
||||
unit_return_fail(m, "PTE lookup failed with code=%d\n", result);
|
||||
}
|
||||
nvgpu_log(g, gpu_dbg_map, "Found PTE=%08x %08x", pte[1], pte[0]);
|
||||
unit_info(m, "Found PTE=%08x %08x", pte[1], pte[0]);
|
||||
|
||||
/* Make sure PTE is valid */
|
||||
if (!pte_is_valid(pte) &&
|
||||
@@ -925,7 +925,7 @@ static int check_pte_valid(struct unit_module *m, struct gk20a *g,
|
||||
if (result != 0) {
|
||||
unit_return_fail(m, "PTE lookup failed with code=%d\n", result);
|
||||
}
|
||||
nvgpu_log(g, gpu_dbg_map, "Found PTE=%08x %08x", pte[1], pte[0]);
|
||||
unit_info(m, "Found PTE=%08x %08x", pte[1], pte[0]);
|
||||
|
||||
/* Make sure PTE is valid */
|
||||
if (!pte_is_valid(pte)) {
|
||||
|
||||
Reference in New Issue
Block a user