This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Inlining __cyg_profile_func_{enter,exit} ?
- From: "Bill Rugolsky Jr." <brugolsky at yahoo dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 11 Dec 2001 12:07:53 -0500
- Subject: Inlining __cyg_profile_func_{enter,exit} ?
Hi,
I'd like to use the -finstrument-functions to do little more than stuff
a few values on a circular queue that will be read out by another
thread, and I was wondering whether there is any inherent obstacle
in the current implementation to inlining __cyg_profile_func_{enter,exit}?
With gcc-2.94.3/gcc-3.0.1, if one compiles
[gcc -O3 -finstrument-functions] the code below, it does not have
the intended effect.
============================
#include <stdio.h>
int depth;
inline void
__attribute__((__no_instrument_function__))
__cyg_profile_func_enter(void *this_fn, void *call_site)
{
++depth;
}
inline void
__attribute__((__no_instrument_function__))
__cyg_profile_func_exit(void *this_fn, void *call_site)
{
--depth;
}
void
foo(void)
{
printf("%ld\n",depth);
}
int
main(int argc, char *argv)
{
foo();
return 0;
}
============================
Regards,
Bill Rugolsky
PS: Please CC me on any replies; I'm not subscribed to the list.