Re: [RFC PATCH 0/4] add support for gcov format introduced in gcc4.7

From: Peter Oberparleiter
Date: Mon Aug 26 2013 - 10:19:40 EST


On 26.08.2013 13:39, LF.Tan wrote:
> Hi all
>
> I am interested to enable Gcov on my platform (on a target board). I
> have tried to apply the 4 patches submitted by Frantisek Hrbata. But,
> the *.gcda is always empty. Note, I am using GCC 4.7.3.
>
> I have followed the steps in Documentation/gcov.txt. I've mounted the
> NFS filesystem and it has access to the kernel build directory on host
> machine.The path for the kernel source in host and target are same.
>
> Let said my kernel module is under drivers/misc,
> drivers/misc/module.ko. Turn on Gcov in drivers/misc/Makefile.
>
> 1. mount -t debugfs none /sys/kernel/debug/
> 2. insmod <PATH>/module.ko
> 3. Perform some actions to excute code in module.ko
> 4. rmmod <PATH>/module.ko
> 5. Check /sys/kernel/debug/gcov/<PATH>/drivers/misc/. There is a soft
> link of module.gcno (I check the soft link is working), but
> module.gcda is empty.

Are you sure they are empty? .gcda files report a file size of 0 as many
virtual files do, but you can read data from them nevertheless. You could
try running "cat" on them to copy their contents for example.

> Any step is incorrect or missing? Or anyone know how to enable GCOV on
> target board? Please advice.
> I would like to enable GCOV in arch/ code as well.
> Thank you very much.

--
Peter Oberparleiter
Linux on System z Development - IBM Germany

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/