public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcda files not getting formed from gcov
@ 2012-11-22  7:50 IAMTubby
  2012-11-22  7:52 ` IAMTubby
  0 siblings, 1 reply; 2+ messages in thread
From: IAMTubby @ 2012-11-22  7:50 UTC (permalink / raw)
  To: gcc-help

Hi,
I understand this question is very specific to gcov, but I would like to go
ahead and ask as I have been stuck for a long time. 

[u][b]My scenario is as follows[/b][/u]
1. My code contains an app folder and a lib folder. The lib folder contains
a shared library called libcli.so
2. On building, gcno files are created for files both in the app and lib
folder
3. This application is then run(executed) on a powerpc architecture.
4. On running, gcda files are created only for those source files which
reside in the app folder, but not for those source files in the lib folder.
5. 
a) On executing gcov for a source file from within the app folder
[u]Assume that main.c exists within the app folder[/u]
[code]
#gcov main.c
File '/home/projects/src/main.c'
Lines executed:61.19% of 67
[/code]

b) On executing gcov for a source file from within the lib
folder(constituent of libcli.so)
[U]Assume that getfile.c exists within the lib folder[/U]
[code]
#gcov getfile.c
File '/home/projects/src/getfile.c'
Lines executed:0.00% of 27
/home/projects/src/getfile.c                                                                                      
:creating 'getfile.c.gcov'[/code]
As you can see, it says 0.00% because the corresponding .gcda file is not
created.

[u][b]Common mistakes I have taken care of and learnt from other
forums[/b][/u]
1. Yes, I have run the executable in a way(with appropriate arguments) such
that the code in getfile.c gets called.  
   I'm running the executable on the powerpc from a local folder. The .gcda
files do not get created here for getfile.c     but main.gcda gets created
here.
2. I have checked if the .gcda's are created in the .libs folder. No it's
not.
3. I have created the same file chain on the target powerpc machine as is on
the host machine where code was compiled in case it was expecting this path.
4. I have checked if I have write permission for the .libs folder. Yes I
have.
5. I have flashed the libcli.so on the target PC.
6. I have added -fprofile-arcs --coverage on both the CFLAGS as well as
LDFLAGS
My Makefiles in both the app as well as lib folder look as follows
[code]
CFLAGS+= -fprofile-arcs -ftest-coverage --coverage
LDFLAGS+= --cref --warn-common -shared -nostdlib -Wl,-Bsymbolic
--fprofile-arcs
.
.
.
.
$(LIBFILE) : $(OBJS)
        $(LINK) $(LDFLAGS)
/home/projects/toolchain/ppc_4xx/usr/lib/gcc/ppc-linux/4.2.2/libgcov.a \
                --retain-symbols-file,$(SYMFILE) \
                -Wl,-soname,$(LIBFILE) \
                -Wl,-Map,$(MAPFILE) \
                -o $@ \
                $(OBJS) \
                $(LIBS)
/home/projects/toolchain/ppc_4xx/usr/lib/gcc/ppc-linux/4.2.2/libgcov.a
[/code]
7.I didn't quite understand how to use these 2 environment variables. Please
refer
[url]http://gcc.gnu.org/onlinedocs/gcc/Cross_002dprofiling.html#Cross_002dprofiling[/url]


[b][u]Some important paths[/u][/b]
1. All the sources files on the x86 pc are on : /home/projects/map/src/cli
2. Code is getting built on the x86 pc from   :
/home/projects/map/build/cli/lib/linux
3. I's running the executable on the powerpc from : /tmp(I have copied
main.gcno and getfile.gcno here and have copied main.c and getfile.c into
/home/projects/map/src/cli on the powerpc. (Yes I created the same path on
the powerpc).


Please advise.



--
View this message in context: http://gcc.1065356.n5.nabble.com/gcda-files-not-getting-formed-from-gcov-tp890705.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gcda files not getting formed from gcov
  2012-11-22  7:50 gcda files not getting formed from gcov IAMTubby
@ 2012-11-22  7:52 ` IAMTubby
  0 siblings, 0 replies; 2+ messages in thread
From: IAMTubby @ 2012-11-22  7:52 UTC (permalink / raw)
  To: gcc-help

Please note that I have also posted the same question on ubuntuforums.org as
I was not aware of gcc-help.
Thanks.



--
View this message in context: http://gcc.1065356.n5.nabble.com/gcda-files-not-getting-formed-from-gcov-tp890705p890707.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-22  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-22  7:50 gcda files not getting formed from gcov IAMTubby
2012-11-22  7:52 ` IAMTubby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).