[PATCH] Add support for profile merging hooks

Nathan Sidwell nathan@codesourcery.com
Wed Apr 23 14:19:00 GMT 2003

Zdenek Dvorak wrote:
> Hello,
> some of the rtlopt profiling features require other info in addition
> to counters be stored in .da file. Merging this extra information by
> summing it clearly is not the right thing to do, so we added a support
> for section specific merging functions.
> Zdenek
> 	* gcov-io.h (merger_function, profile_merger_for_tag): Declare.
> 	* gcov-io.c (profile_merger_for_tag): New.
> 	* libgcov.c (gcov_exit): Use it.
I'm not happy with linking in functions that won't necessarily be used
by libgcov.

Add function pointers to gcov_ctr_info, and get build_gcov_info to
emit the correct value for each counter type there. Then
get libgcov to call it from the counter info. I guess a NULL there
can obtain the current behaviour.

the bodies of the merger functions should be in libgcov.c, but protected
by L_merge_foo macros, like libgcc2.c is. You'll have to adjust libgcov's


Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
          The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org

More information about the Gcc-patches mailing list