public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Bill Rugolsky Jr." <brugolsky@yahoo.com>
To: gcc@gcc.gnu.org
Subject: Inlining __cyg_profile_func_{enter,exit} ?
Date: Tue, 11 Dec 2001 09:18:00 -0000	[thread overview]
Message-ID: <20011211120753.A20918@ead45> (raw)

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.

             reply	other threads:[~2001-12-11 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-11  9:18 Bill Rugolsky Jr. [this message]
2001-12-11 16:03 ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011211120753.A20918@ead45 \
    --to=brugolsky@yahoo.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).