[Bug gcov-profile/112829] Dump PGO profiles to a memory buffer

2023-12-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112829

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

--- Comment #3 from Andrew Pinski  ---
GCC does not currently have a way. Though I suspect one of the reasons is that
for embedded, folks don't use -fprofile-generate/-fprofile-use that much or
they use a simulator which then has direct access to the host machine to
generate the files.

I Know for Octeon SE (MIPS baremetal interface on the Cavium Octeon) that they
had a way to do this using memory dump but it was hooked up outside of gcov and
in newlib instead.

I do think this is a good idea for embedded env but I am not sure if anyone who
is interested in doing it. for Linux env, using nfs mount and
-fprofile-dir=/-fprofile-prefix-map=/-fprofile-prefix-path= is one way of doing
it.

Also if you are using Zephyr, it does handle the writes and does the store to
memory and such too.  See
https://docs.zephyrproject.org/latest/develop/test/coverage.html .

[Bug gcov-profile/112829] Dump PGO profiles to a memory buffer

2023-12-03 Thread zamazan4ik at tut dot by via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112829

--- Comment #2 from Alexander Zaitsev  ---
Am I right that right now in GCC there are no ready-to-use alternatives to "int
__llvm_profile_write_buffer(char *Buffer)" from LLVM and it should be
implemented somehow manually (as you described)?

[Bug gcov-profile/112829] Dump PGO profiles to a memory buffer

2023-12-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112829

--- Comment #1 from Andrew Pinski  ---
One way is to simple replace all of the functions in gcov-io.c and implement
them, gcov_open, etc.