AnsweredAssumed Answered

GCOV Code coverage

Question asked by fadilah mohd ali on Apr 17, 2019
Latest reply on Apr 18, 2019 by gusarambula

How to get code coverage(gcov) for Linux kernel(Android) in i.MX 8M evaluation kit? I share based on my study 


CASE 1:(specific directory)
I configure in config file as below:

 

CONFIG_DEBUG_FS=y 
CONFIG_GCOV_KERNEL=y
CONFIG_GCOV_FORMAT_AUTODETECT=y 

In specific directory I would like to get coverage, I configure the Makefile as below:
GCOV_PROFILE := y

Result: Board cannot boot up, keep rebooting until hangup

***if did not configure the Makefile(GCOV_PROFILE := y) ..then the gcov folder will be successfully created under directory /sys/kernel/debug/gcov.

 

CASE 2:(entire kernel)
I configure in config file as below:

 

CONFIG_DEBUG_FS=y 
CONFIG_GCOV_KERNEL=y 
CONFIG_GCOV_FORMAT_AUTODETECT=y

CONFIG_GCOV_PROFILE_ALL=y
Result: Error during patching by uuu tools because the img file is too big

Outcomes