Re: Help on Gcov

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Harry Trinta <harrytpc@xxxxxxxxx> writes:

> I have some question about "branch probabilities". I think I don't
> quite understand how this works.
> - What is the purpose of calculating the branch probabilities? The
> propose is to use information about past executions (gcda files) to
> optimize better the program that is compiling?

Yes.

> - Â"branch probabilities" is calculated by the compiler even when the
> parameters Âprofile-arcs and ftest-coverage were not used?

Yes, but in the absence of profiling information they are just informed
guesses.

> The source coverage.c Âhas a method coverage_init which is called by toplev.c.
> The coverage_init calls the read_counts_file (in coverage.c), wich try
> to open a file gcda. If this method find the file gcda, load the file
> content in a hash (counts_hash) in memory ... Is that right?
> If I'm right, what is the purpose of loading the information from a
> GCDA in memory at compile time? This information is used by the
> compiler only for branch probabilities?

I think also for value profiling.  Although it's possible that that data
is stored somewhere else, I haven't looked.

Ian



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux