AnsweredAssumed Answered

gcov issues on kernel

Question asked by Chaitanya Raju on Feb 26, 2018
Latest reply on Feb 27, 2018 by Victor Linnik

Trying to get gcov working on imx6 platform with linux.

 

When enabled with following options,

CONFIG_GCOV_KERNEL=y
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
CONFIG_GCOV_PROFILE_ALL=y
CONFIG_GCOV_FORMAT_AUTODETECT=y

 

When compiled, .tmp_driver_name.gcno file will be created.

For example:

.tmp_spi-imx.gcno

 

kernel zImage seems to be 14mb in  size. 

When loaded, system boots and corresponding .gcda and .gcno files are created under directory /sys/kernel/debug/gcov

Here actually spi-imx.gcno files got created at runtime is a softlink for .tmp_spi-imx.gcno(created actually during compilation time). So it requires kernel sources to be part of rootfs on the target file system, where device is running. 

 

This status is on bootup. once test code for corresponding driver is executed, there is no update happening on the spi-imx.gcda file. Still the file seems to be empty.

 

Kernel been used is 4.15 kernel.

gcc version is 5.3.

Added changes related to latest stable kernel for gcov to support gcc version above 5. Since current code support only upto gcc version 4.7

Still .gcda files are empty. Could not get the code coverage data of the kernel.

Outcomes