Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: add CONFIG_GCOV_PROFILE_AMDGPU Kconfig option

Add a Kconfig option to enable GCOV code coverage profiling for the
amdgpu driver, following the established upstream pattern used by
CONFIG_GCOV_PROFILE_FTRACE (kernel/trace), CONFIG_GCOV_PROFILE_RDS
(net/rds), and CONFIG_GCOV_PROFILE_URING (io_uring).

This allows CI systems to enable amdgpu code coverage entirely via
.config (e.g., scripts/config --enable GCOV_PROFILE_AMDGPU) without
manually editing the amdgpu Makefile. The option depends on both
DRM_AMDGPU and GCOV_KERNEL, defaults to n, and is therefore never
enabled in production or distro builds.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Vitaly Prosyak and committed by
Alex Deucher
1d0a26cf d290d6ee

+21
+17
drivers/gpu/drm/amd/amdgpu/Kconfig
··· 103 103 Add -Werror to the build flags for amdgpu.ko. 104 104 Only enable this if you are warning code for amdgpu.ko. 105 105 106 + 107 + config GCOV_PROFILE_AMDGPU 108 + bool "Enable GCOV profiling on amdgpu" 109 + depends on DRM_AMDGPU 110 + depends on GCOV_KERNEL 111 + default n 112 + help 113 + Enable GCOV profiling on the amdgpu driver for checking which 114 + functions/lines are executed during testing. This adds compiler 115 + instrumentation flags to all amdgpu source files, producing 116 + .gcda/.gcno coverage data accessible via debugfs. 117 + 118 + This increases the amdgpu module size by ~50% and adds ~2-5% 119 + runtime overhead on GPU submission paths. 120 + 121 + If unsure, say N. 122 + 106 123 source "drivers/gpu/drm/amd/acp/Kconfig" 107 124 source "drivers/gpu/drm/amd/display/Kconfig" 108 125 source "drivers/gpu/drm/amd/amdkfd/Kconfig"
+4
drivers/gpu/drm/amd/amdgpu/Makefile
··· 27 27 DISPLAY_FOLDER_NAME=display 28 28 FULL_AMD_DISPLAY_PATH = $(FULL_AMD_PATH)/$(DISPLAY_FOLDER_NAME) 29 29 30 + ifdef CONFIG_GCOV_PROFILE_AMDGPU 31 + GCOV_PROFILE := y 32 + endif 33 + 30 34 ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \ 31 35 -I$(FULL_AMD_PATH)/include \ 32 36 -I$(FULL_AMD_PATH)/amdgpu \