This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]