3. for packages which you want to compile with pgo, you have to use cflags.pgo, see here for instructions.
4. emerge <pkgs>
5. you need to chown/chmod /var/tmp/pgo/${PN} so that your normal user can write to the files/dirs
6. use the pkgs as you normally would
7. emerge <pkgs> (again)
8. now you have PGO builds

Caveats:

- Well you will have to compile twice (for the first time) and use the application in between compiles, after that it will use the existing profile stats.
- Step 5, sometimes during the compilation, some exec are run (conftest, ...) so there are files generated in /var/tmp/pgo/${PN}, you will have to manually delete those or fix the permissions.
- if you want to regenerate the profile stats then you need to manually delete /var/tmp/pgo/${PN} and start over

It's not fully automatic method, but this is as far as I could get to reduce the manual steps, any suggestions are welcome._________________http://wojia.be

How? Trigger any possible action in the application, only what is used mostly?_________________++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

The caveat, however, is that the sample of data fed to the program during the profiling stage must be statistically representative of the typical usage scenarios; otherwise, profile-guided feedback has the potential to harm the overall performance of the final build instead of improve it.

I'm gonna give this a try on a few applications. Ran into the same problem i13m did, but solved it by using symlinks as mentioned above, after which everything compiled fine.
It would be interesting to see benchmarks, or any other information, as to the possible performance benefits in some use cases, so one can determine which (if any) applications are worth the while.

If you use portage-bashrc-mv (available e.g. from the mv overlay), you can simply put into /etc/portage/package.cflags (or, if you prefer, into a file in there):

/etc/portage/package.cflags/pgo wrote:

category/package PGO=true

(if you have installed eix then instead of category/package you can also specify versions/version ranges/slots/overlays as usual in /etc/portage/package.* files).

Then after the first emerge of the correponding packages run them and then re-emerge them a second time. (The mechanism used is quite similar than in this thread and is described in more detail in the README).

You need >=portage-bashrc-mv-12.0 for the correct name PGO (in earlier versions, this was the misnomer GPO which I realized only after reading this thread...).