https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47618

--- Comment #28 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #26)
> (In reply to qinzhao from comment #25)
> > (In reply to Martin Liška from comment #24)
> > > 
> > > > How about the patch for the above 2? has it been committed?
> > > 
> > > It has been there for a while, please take a look at:
> > > 
> > > $ gcov-tool merge --help
> > > merge: unrecognized option '--help'
> > > Merge subcomand usage:  merge [options] <dir1> <dir2>         Merge 
> > > coverage
> > > file contents
> > >     -o, --output <dir>                  Output directory
> > >     -v, --verbose                       Verbose mode
> > >     -w, --weight <w1,w2>                Set weights (float point values)
> > 
> > two more questions on this merge tool:
> > 1. it can only merge two directories at one time. So, for multiple
> > directories, for example "n", we have to invoke gcov-tool merge n-1 times in
> > order to merge all of them?
> 
> Yep. I guess one can write a simple bash script that does that.
> 
> > 2. Intel compiler (icc)'s profmerge is able to merge all the .dyn files
> > under one directory, does gcc have such functionality currently?
> 
> We have folder-base merging where we search for all .gcda files and we merge
> them to a destination folder.

$ echo "int main() {return 0;}" >> main.c && gcc --coverage main.c && ./a.out
$ mkdir a && mkdir b && cp main.gcda c && cp main.gcda b
$ gcov-tool merge a b -o a+b -v
reading file: ./main.gcda
tag one function id=108032747
reading file: ./main.gcda
tag one function id=108032747

$ ls a+b
main.gcda

$ gcov-dump a+b/main.gcda 
a+b/main.gcda:data:magic `gcda':version `A83*'
a+b/main.gcda:stamp 2031787297
a+b/main.gcda:  a3000000:  22:PROGRAM_SUMMARY checksum=0x33c369a8
a+b/main.gcda:                counts=1, runs=1, sum_all=2, run_max=2, sum_max=2
a+b/main.gcda:                counter histogram:
a+b/main.gcda:                 2: num counts=1, min counter=2, cum_counter=2
a+b/main.gcda:  01000000:   3:FUNCTION ident=108032747,
lineno_checksum=0x3b5ee2be, cfg_checksum=0xdb5de9e8
a+b/main.gcda:    01a10000:   2:COUNTERS arcs 1 counts

Reply via email to