gcov issues on kernel

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

gcov issues on kernel

1,076 次查看
chaitanyaraju
Contributor I

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.

标签 (1)
0 项奖励
1 回复

869 次查看
b36401
NXP Employee
NXP Employee

Please make sure that these files are accessible for write. I mean the filesystem is not read-only and the files have appropriate permissions.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励