public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* -fprofile-generate and multiple runs
@ 2011-09-24 15:11 Martin Mitáš
  2011-09-26  8:22 ` Andi Hellmund
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Mitáš @ 2011-09-24 15:11 UTC (permalink / raw)
  To: gcc-help

Hi.

I'm working on a shared lib which I would like to optimize
with profile guided optimization. I would prefer to have
multiple small programs (one for typical use case), each
examining a single module of the lib rather then one big
program covering complete lib's API, and to generate the
profile by running all those use cases.

When built with -fprofile-generate, and the resulted binary
is executed multiple times, are the .gcda files (re)written
from scratch every time, or are they updated so they contain
a combined profile data from multiple runs?

Any other gotchas this approach might bring?

gcc manual does not provide any details about this...

Thanks in advance,
Mity

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

* Re: -fprofile-generate and multiple runs
  2011-09-24 15:11 -fprofile-generate and multiple runs Martin Mitáš
@ 2011-09-26  8:22 ` Andi Hellmund
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Hellmund @ 2011-09-26  8:22 UTC (permalink / raw)
  To: Martin Mitáš; +Cc: gcc-help

Hi Mity
>
> When built with -fprofile-generate, and the resulted binary
> is executed multiple times, are the .gcda files (re)written
> from scratch every time, or are they updated so they contain
> a combined profile data from multiple runs?
The files are updated, so it is permitted to run the program mutiple times.
>
> Any other gotchas this approach might bring?

No, it shouldn't ...

Best regards,
Andi

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

end of thread, other threads:[~2011-09-25 20:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-24 15:11 -fprofile-generate and multiple runs Martin Mitáš
2011-09-26  8:22 ` Andi Hellmund

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).