0

I am trying to use GCOV to test a Device Driver eg: Ethernet Driver wrote in C language. This driver is in Userspace and has a lot of Kernelspace calls. Using a Linux Ubuntu machine Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-96-generic x86_64)

On compiling Driver code - Object file ( .o file is generated for each c file) and combined (.ko file). main() starts from startup code in my understanding. After loading the (*.ko ) file ethernet device needs to be tested functionally and a later coverage report shall be used.

I have a limited knowledge of Linux. Articles that I have come across are executing programs in Userspace only.

Question1:

I am not sure what are the steps to do so. Please suggest.

Appreciate your help in Advance.

2 Answers2

0

I think the right manual lives here: https://www.kernel.org/doc/html/latest/dev-tools/gcov.html?highlight=gcov

marxin
  • 715
  • 1
  • 10
  • 18
0

I have been through this manual. And this doesn't give complete details. However, I have practically tried and achieved gcov coverage and gcovr also helped me to generate proper results.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 28 '22 at 21:09