Try to open executed gcov files(*gcda,*gcno) but it's showing blank report.

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

Try to open executed gcov files(*gcda,*gcno) but it's showing blank report.

8,621 次查看
BG123
Contributor I

Executed properly and followed the below link steps.

Reference : https://mcuoneclipse.com/2021/09/19/tutorial-gnu-gcov-coverage-with-the-nxp-i-mx-rt1064/

Try to open "gcda" and "gcno" files using gcov profiling tool. (Below screenshot attached for "evkmimxrt1170_hello_world_demo_cm7" this example code)

Also try to open "FRDM-K64F_gcov_bm" already generated "gcda" and "gcno" files. But It's showing "0%" coverage data.

I think it's related to some plugins missed during a setup.

Can you guide which are plugins are mandatory to open ".gcda" and ".gcno" files.

Also, If you have a better solution then give me as soon as possible.

Board and Environment Details:

1). Board : evk i.MXRT1170

2). mcuexpresso IDE : MCUXpresso IDE v11.4.0 [Build 6237] [2021-08-06]

3). Gcov Library : GCov Integration 8.4.0.202109071933

4). SDK : 2.10.1 Version

 

 

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

8,602 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

 

Hello

Hope you are well. I was able to replicate this issue and found the same issue. This message was displayed when trying to open the gcno file and the coverage results were displayed in 0´s like the picture you attached:

Omar_Anguiano_0-1633021964751.png
To solve this, I opened the command prompt and executed "strings -v".

Omar_Anguiano_1-1633022060281.png

Omar_Anguiano_2-1633022147887.png
After doing this, the coverage data was captured correctly.

Omar_Anguiano_3-1633022195027.pngOmar_Anguiano_4-1633022240302.png

Please let me know if this solves your problem, if you have more questions do not hesitate to ask me.
Best regards,
Omar

0 项奖励
回复

8,565 次查看
robert_s
Contributor III

I too am having this issue, also on an RT1170 EVM.

I tried the 'strings -v' suggestion, both in the instrumented file's folder and the project folder, but this did not seem to change anything. Are there any other things I could try or check?

(Also I wonder how requesting an executable's version would affect anything?)

0 项奖励
回复

8,543 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello @robert_s 

Make sure that MCUXpresso has the tool installed, otherwise, you have to install it.

Omar_Anguiano_0-1636402936695.png

It is also important to check that the corresponding binary utilities are on the IDE, you can refer to this post: https://mcuoneclipse.com/2017/06/18/adding-gnu-coverage-tools-to-eclipse/

Which message is displayed when you try to open the gcov files?

Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar

 

0 项奖励
回复

8,535 次查看
robert_s
Contributor III

Hi Omar,

Thank you for your response.

1) I do appear to have gcov installed (although I also have certificate problems if I try to install software via Help->Install. Our IT will likely be resticting this anyway.)

2) If I execute gcov from the command line it seems to execute for individual files, e.g.:
> gcov fsl_gpio.o
File '../drivers/fsl_gpio.c'
Lines executed:60.00% of 45
Creating 'fsl_gpio.c.gcov'
Cannot open source file ../drivers/fsl_gpio.c

File '../drivers/fsl_gpio.h'
Lines executed:100.00% of 3
Creating 'fsl_gpio.h.gcov'
Cannot open source file ../drivers/fsl_gpio.h

File '../drivers/fsl_clock.h'
Lines executed:85.71% of 7
Creating 'fsl_clock.h.gcov'
Cannot open source file ../drivers/fsl_clock.h

File 'C:/Users/T0042908/Documents/MCUXpressoIDE_11.4.0_6224/workspace_topsisx/RT1170_iled_blinky_cm7/CMSIS/cmsis_gcc.h'
Lines executed:0.00% of 3
Creating 'cmsis_gcc.h.gcov'

3) I use the 'NewLib' rather than 'NewlibNano' as it generates the coverage files in less than a minute as opposed to an hour!


Rather than setting the gcov flags (-ftest-coverage -fprofile-arcs) for the whole project I have tried setting them for individual files.

  • Gcov_flags.PNG

This resulted in a successful population of the coverage data for the selected files in the gcov view, however, when certain files are added it appears to cause the following error and this prevents and data being displayed. For example, board/board.c:

Gcov_exception.PNG

I have tried cutting bits out of this file (e.g. unused functions, #def'd code) but have not yet been able to determine what MCUXpresso/gcov does not like about it!

Regards,

Robert

0 项奖励
回复

8,503 次查看
robert_s
Contributor III

Hi @Omar_Anguiano,

I thought I'd better give this post a kick as it's gone quite for a couple of weeks.

(Possibly this should be a separate problem/post.)

 

'gcov' tools is installed and for most files it works 'OK'(*), however, some files do cause the above 'Unhandled loop exception' error when the results are opened.

Thank you for any help you can provide,

Robert

 

(*) - Some of the results are wrong. I know this because I have stepped through some of the code it reports as not-executed!

0 项奖励
回复

8,553 次查看
BG123
Contributor I

Hello Robert_s,
In my case, i was used linux ubuntu 20.04 OS and prepared MCUxpressoIDE setup.

By installing "Gcovr" Package on ubuntu the problem was resolved.

0 项奖励
回复